Ignore:
Timestamp:
May 24, 2015 3:01:42 PM (9 years ago)
Author:
anonymous
Message:

First set of changes towards 2.2.0. Improved functinoality with integration in wordpress; bugs fixed.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Cache.inc.php

    r502 r523  
    7979
    8080        if (true !== $app->getParam('enable_session')) {
     81            // Force disable the cache because there is no session to save to.
    8182            $app->logMsg('Cache disabled, enable_session is false.', LOG_DEBUG, __FILE__, __LINE__);
    8283            $this->setParam(array('enabled' => false));
    83         }
    84 
    85         if (!isset($_SESSION['_cache'][$this->_ns])) {
     84        } else if (!isset($_SESSION['_cache'][$this->_ns])) {
     85            // Otherwise, clear to initialize the session variable.
    8686            $this->clear();
    8787        }
     
    252252    public function delete($key)
    253253    {
     254        $app =& App::getInstance();
     255
     256        if (true !== $this->getParam('enabled')) {
     257            $app->logMsg(sprintf('Cache disabled, skipping delete of %s', $key), LOG_DEBUG, __FILE__, __LINE__);
     258            return false;
     259        }
     260
    254261        if (isset($_SESSION['_cache'][$this->_ns]) && array_key_exists($key, $_SESSION['_cache'][$this->_ns])) {
    255262            unset($_SESSION['_cache'][$this->_ns][$key]);
Note: See TracChangeset for help on using the changeset viewer.