__construct() public method

$options is an assoc. Available options are : $options = array( 'cacheDir' => directory where to put the cache files (string), 'caching' => enable / disable caching (boolean), 'lifeTime' => cache lifetime in seconds (int), 'fileLocking' => enable / disable fileLocking (boolean), 'writeControl' => enable / disable write control (boolean), 'readControl' => enable / disable read control (boolean), 'readControlType' => type of read control 'crc32', 'md5', 'strlen' (string), 'pearErrorMode' => pear error mode (when raiseError is called) (cf PEAR doc) (int), 'memoryCaching' => enable / disable memory caching (boolean), 'onlyMemoryCaching' => enable / disable only memory caching (boolean), 'memoryCachingLimit' => max nbr of records to store into memory caching (int), 'fileNameProtection' => enable / disable automatic file name protection (boolean), 'automaticSerialization' => enable / disable automatic serialization (boolean), 'automaticCleaningFactor' => distable / tune automatic cleaning process (int), 'hashedDirectoryLevel' => level of the hashed directory system (int), 'hashedDirectoryUmask' => umask for hashed directory structure (int), 'errorHandlingAPIBreak' => API break for better error handling ? (boolean) );
public __construct ( array $options = [NULL] )
$options array options
Esempio n. 1
0
 /**
  * Constructor
  *
  * $options is an assoc. To have a look at availables options,
  * see the constructor of the Cache_Lite class in 'Cache_Lite.php'
  *
  * Comparing to Cache_Lite constructor, there is another option :
  * $options = array(
  *     (...) see Cache_Lite constructor
  *     'defaultGroup' => default cache group for function caching (string)
  * );
  *
  * @param array $options options
  * @access public
  */
 function __construct($options = array(NULL))
 {
     if (isset($options['defaultGroup'])) {
         $this->_defaultGroup = $options['defaultGroup'];
     }
     parent::__construct($options);
 }
Esempio n. 2
0
 public function __construct($id, $group = null)
 {
     global $config;
     $this->cache_id = $id;
     if ($group) {
         $this->cache_group = $group;
     }
     $options = array('lifeTime' => \HodgePodge\Core\Cache::$lifetime[$group ?: 'default'] ?: 3600, 'pearErrorMode' => CACHE_LITE_ERROR_DIE, 'cacheDir' => $config['cache_dir'] ?: $config['cache']['dir'], 'automaticSerialization' => true);
     parent::__construct($options);
 }
Esempio n. 3
0
 /**
  * Constructor
  *
  * $options is an assoc. To have a look at availables options,
  * see the constructor of the Cache_Lite class in 'Cache_Lite.php'
  *
  * Comparing to Cache_Lite constructor, there is another option :
  * $options = array(
  *     (...) see Cache_Lite constructor
  *     'debugCacheLiteFunction' => (bool) debug the caching process,
  *     'defaultGroup' => default cache group for function caching (string),
  *     'dontCacheWhenTheOutputContainsNOCACHE' => (bool) don't cache when the function output contains "NOCACHE",
  *     'dontCacheWhenTheResultIsFalse' => (bool) don't cache when the function result is false,
  *     'dontCacheWhenTheResultIsNull' => (bool don't cache when the function result is null
  * );
  *
  * @param array $options options
  * @access public
  */
 function __construct($options = array(NULL))
 {
     $availableOptions = array('debugCacheLiteFunction', 'defaultGroup', 'dontCacheWhenTheOutputContainsNOCACHE', 'dontCacheWhenTheResultIsFalse', 'dontCacheWhenTheResultIsNull');
     while (list($name, $value) = each($options)) {
         if (in_array($name, $availableOptions)) {
             $property = '_' . $name;
             $this->{$property} = $value;
         }
     }
     reset($options);
     parent::__construct($options);
 }
Esempio n. 4
0
 /**
  * Constructor
  *
  * $options is an assoc. To have a look at availables options,
  * see the constructor of the Cache_Lite class in 'Cache_Lite.php'
  *
  * Comparing to Cache_Lite constructor, there is another option :
  * $options = array(
  *     (...) see Cache_Lite constructor
  *     'masterFile' => complete path of the file used for controlling the cache lifetime(string)
  * );
  *
  * @param array $options options
  * @access public
  */
 function __construct($options = array(NULL))
 {
     $options['lifetime'] = 0;
     parent::__construct($options);
     if (isset($options['masterFile'])) {
         $this->_masterFile = $options['masterFile'];
     } else {
         return $this->raiseError('Cache_Lite_File : masterFile option must be set !');
     }
     if (!($this->_masterFile_mtime = @filemtime($this->_masterFile))) {
         return $this->raiseError('Cache_Lite_File : Unable to read masterFile : ' . $this->_masterFile, -3);
     }
 }
Esempio n. 5
0
 /**
  * Constructor
  *
  * $options is an assoc. To have a look at availables options,
  * see the constructor of the Cache_Lite class in 'Cache_Lite.php'
  *
  * @param array $options options
  * @access public
  */
 function __construct($options = array(NULL))
 {
     parent::__construct($options);
 }
Esempio n. 6
0
 /**
  * Constructor
  *
  * $options is an assoc. To have a look at availables options,
  * see the constructor of the Cache_Lite class in 'Cache_Lite.php'
  *
  * @param array $options options
  * @access public
  */
 function __construct($options)
 {
     parent::__construct($options);
 }