Ignore:
Timestamp:
Feb 19, 2014 2:28:00 AM (10 years ago)
Author:
anonymous
Message:

Merged in changes from trunk to finish Eli's branch.

Location:
branches/eli_branch
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/eli_branch

  • branches/eli_branch/lib/Cache.inc.php

    r439 r467  
    44 * For details visit the project site: <http://trac.strangecode.com/codebase/>
    55 * Copyright 2001-2012 Strangecode, LLC
    6  * 
     6 *
    77 * This file is part of The Strangecode Codebase.
    88 *
     
    1111 * Free Software Foundation, either version 3 of the License, or (at your option)
    1212 * any later version.
    13  * 
     13 *
    1414 * The Strangecode Codebase is distributed in the hope that it will be useful, but
    1515 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1616 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
    1717 * details.
    18  * 
     18 *
    1919 * You should have received a copy of the GNU General Public License along with
    2020 * The Strangecode Codebase. If not, see <http://www.gnu.org/licenses/>.
     
    3131 * @since   2001
    3232 */
    33  
     33
    3434// Flags.
    3535define('CACHE_ALLOW_OVERSIZED', 1);
     
    4242    // Configuration parameters for this object.
    4343    private $_params = array(
    44        
     44
    4545        // If false nothing will be cached or retrieved. Useful for testing realtime data requests.
    4646        'enabled' => true,
     
    4848        // The maximum size in bytes of any one variable.
    4949        'item_size_limit' => 4194304, // 4 MB
    50        
     50
    5151        // The maximum size in bytes before the cache will begin flushing out old items.
    5252        'stack_size_limit' => 4194304, // 4 MB
    53        
     53
    5454        // The minimum items to keep in the cache regardless of item or cache size.
    5555        'min_items' => 5,
    5656    );
    57    
     57
    5858    /*
    5959    * Constructor
     
    6868    {
    6969        $app =& App::getInstance();
    70        
     70
    7171        $this->_ns = $namespace;
    7272
     
    7575            $this->setParam(array('enabled' => false));
    7676        }
    77        
     77
    7878        if (!isset($_SESSION['_cache'][$this->_ns])) {
    7979            $this->clear();
     
    127127    {
    128128        $app =& App::getInstance();
    129    
     129
    130130        if (isset($this->_params[$param])) {
    131131            return $this->_params[$param];
     
    138138    /**
    139139     * Stores a new variable in the session cache. The $key should not be numeric
    140      * because the array_shift function will reset the key to the next largest 
     140     * because the array_shift function will reset the key to the next largest
    141141     * int key. Weird behavior I can't understand. For example $cache["123"] will become $cache[0]
    142142     *
     
    168168            $app->logMsg(sprintf('Serialized variable (%s bytes) more than stack_size_limit (%s bytes).', $var_len, $this->getParam('stack_size_limit')), LOG_NOTICE, __FILE__, __LINE__);
    169169            return false;
    170         }       
     170        }
    171171
    172172        // Remove any value already stored under this key.
     
    253253        }
    254254    }
    255    
     255
    256256    /*
    257257    * Delete all existing items from the cache.
Note: See TracChangeset for help on using the changeset viewer.