本文整理汇总了PHP中Cache_Lite::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP Cache_Lite::__construct方法的具体用法?PHP Cache_Lite::__construct怎么用?PHP Cache_Lite::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cache_Lite
的用法示例。
在下文中一共展示了Cache_Lite::__construct方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* 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);
}
示例2: __construct
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);
}
示例3: array
/**
* 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);
}
示例4: array
/**
* 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);
}
}
示例5: array
/**
* 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);
}
示例6:
/**
* 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);
}