Ignore:
Timestamp:
Jun 1, 2006 7:42:53 AM (18 years ago)
Author:
scdev
Message:

Q - Finished integrating singleton methods into existing code. Renamed SessionCache? to Cache, and renamed methods in Cache and Prefs

File:
1 edited

Legend:

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

    r132 r135  
    5858if (getFormData('break_list_cache', false)) {
    5959    // Break the cache because we are changing the list data.
    60     $cache->breakCache($_SERVER['PHP_SELF']);
     60    $cache->delete($_SERVER['PHP_SELF']);
    6161}
    6262
     
    258258
    259259    // Break the cache because we are changing the list data.
    260     $cache->breakCache($_SERVER['PHP_SELF']);
     260    $cache->delete($_SERVER['PHP_SELF']);
    261261
    262262    // Get the information for this object.
     
    288288   
    289289    // Break the cache because we are changing the list data.
    290     $cache->breakCache($_SERVER['PHP_SELF']);
     290    $cache->delete($_SERVER['PHP_SELF']);
    291291
    292292%INSERT%
     
    314314
    315315    // Break the cache because we are changing the list data.
    316     $cache->breakCache($_SERVER['PHP_SELF']);
     316    $cache->delete($_SERVER['PHP_SELF']);
    317317
    318318%UPDATE%
     
    383383    // without knowing the hash.
    384384    $cache_hash = md5($sql . '|' . $page->total_items);
    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'])) {
     385    if ($prefs->get('cache_hash', $_SERVER['PHP_SELF']) != $cache_hash) {
     386        $cache->delete($_SERVER['PHP_SELF']);
     387        $prefs->set('cache_hash', $cache_hash, $_SERVER['PHP_SELF']);
     388    }
     389
     390    if ($cache->exists($_SERVER['PHP_SELF'])) {
    391391        // Get the cached results.
    392         $list = $cache->getCache($_SERVER['PHP_SELF']);
     392        $list = $cache->get($_SERVER['PHP_SELF']);
    393393    } else {
    394394        // If the list is not already cached, query now.
     
    401401        if (isset($list) && !empty($list)) {
    402402            // Cache the results.
    403             $cache->putCache($list, $_SERVER['PHP_SELF']);
     403            $cache->set($list, $_SERVER['PHP_SELF']);
    404404        }
    405405    }
     
    419419
    420420    // Break the cache because we are changing the list data.
    421     $cache->breakCache($_SERVER['PHP_SELF']);
     421    $cache->delete($_SERVER['PHP_SELF']);
    422422
    423423    // Count the ranks with invalid numbers
Note: See TracChangeset for help on using the changeset viewer.