Ignore:
Timestamp:
May 30, 2006 10:05:54 PM (18 years ago)
Author:
scdev
Message:

updated Prefs:: and SessionCache::

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0singleton/bin/module_maker/skel/admin.php

    r130 r132  
    3232// The object to validate form input.
    3333$fv = new FormValidator();
     34
     35$cache =& SessionCache::getInstance();
    3436
    3537%SORT_ORDER%
     
    5658if (getFormData('break_list_cache', false)) {
    5759    // Break the cache because we are changing the list data.
    58     SessionCache::breakCache($_SERVER['PHP_SELF']);
     60    $cache->breakCache($_SERVER['PHP_SELF']);
    5961}
    6062
     
    248250    global $lock;
    249251    $db =& DB::getInstance();
     252    $cache =& SessionCache::getInstance();
    250253   
    251254    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $id);
     
    255258
    256259    // Break the cache because we are changing the list data.
    257     SessionCache::breakCache($_SERVER['PHP_SELF']);
     260    $cache->breakCache($_SERVER['PHP_SELF']);
    258261
    259262    // Get the information for this object.
     
    282285    global $auth;
    283286    $db =& DB::getInstance();
     287    $cache =& SessionCache::getInstance();
    284288   
    285289    // Break the cache because we are changing the list data.
    286     SessionCache::breakCache($_SERVER['PHP_SELF']);
     290    $cache->breakCache($_SERVER['PHP_SELF']);
    287291
    288292%INSERT%
     
    300304function updateRecord($frm)
    301305{
    302     global $auth, $lock;
    303 
     306    global $auth, $lock;
     307    $app =& App::getInstance();
     308    $cache =& SessionCache::getInstance();
     309   
    304310    $lock->select('%DB_TBL%', '%PRIMARY_KEY%', $frm['%PRIMARY_KEY%']);
    305311    if ($lock->isLocked() && !$lock->isMine()) {
     
    308314
    309315    // Break the cache because we are changing the list data.
    310     SessionCache::breakCache($_SERVER['PHP_SELF']);
     316    $cache->breakCache($_SERVER['PHP_SELF']);
    311317
    312318%UPDATE%
     
    327333    global $so;
    328334    $db =& DB::getInstance();
     335    $prefs =& Prefs::getInstance();
     336    $cache =& SessionCache::getInstance();
    329337   
    330338    $where_clause = '';
     
    375383    // without knowing the hash.
    376384    $cache_hash = md5($sql . '|' . $page->total_items);
    377     if (Prefs::getValue('cache_hash', $_SERVER['PHP_SELF']) != $cache_hash) {
    378         SessionCache::breakCache($_SERVER['PHP_SELF']);
    379         Prefs::setValue('cache_hash', $cache_hash, $_SERVER['PHP_SELF']);
    380     }
    381 
    382     if (SessionCache::isCached($_SERVER['PHP_SELF'])) {
     385    if ($prefs->getValue('cache_hash', $_SERVER['PHP_SELF']) != $cache_hash) {
     386        $cache->breakCache($_SERVER['PHP_SELF']);
     387        $prefs->setValue('cache_hash', $cache_hash, $_SERVER['PHP_SELF']);
     388    }
     389
     390    if ($cache->isCached($_SERVER['PHP_SELF'])) {
    383391        // Get the cached results.
    384         $list = SessionCache::getCache($_SERVER['PHP_SELF']);
     392        $list = $cache->getCache($_SERVER['PHP_SELF']);
    385393    } else {
    386394        // If the list is not already cached, query now.
     
    393401        if (isset($list) && !empty($list)) {
    394402            // Cache the results.
    395             SessionCache::putCache($list, $_SERVER['PHP_SELF']);
     403            $cache->putCache($list, $_SERVER['PHP_SELF']);
    396404        }
    397405    }
     
    403411{
    404412    $db =& DB::getInstance();
     413    $cache =& SessionCache::getInstance();
    405414   
    406415    if (!is_array($ranks)) {
     
    410419
    411420    // Break the cache because we are changing the list data.
    412     SessionCache::breakCache($_SERVER['PHP_SELF']);
     421    $cache->breakCache($_SERVER['PHP_SELF']);
    413422
    414423    // Count the ranks with invalid numbers
Note: See TracChangeset for help on using the changeset viewer.