Cache_Lite::setOption PHP Method

setOption() public method

see Cache_Lite constructor for available options
public setOption ( $name, $value )
    function setOption($name, $value)
    {
        $availableOptions = array('errorHandlingAPIBreak', 'hashedDirectoryUmask', 'hashedDirectoryLevel', 'automaticCleaningFactor', 'automaticSerialization', 'fileNameProtection', 'memoryCaching', 'onlyMemoryCaching', 'memoryCachingLimit', 'cacheDir', 'caching', 'lifeTime', 'fileLocking', 'writeControl', 'readControl', 'readControlType', 'pearErrorMode');
        if (in_array($name, $availableOptions)) {
            $property = '_' . $name;
            $this->{$property} = $value;
        }
    }

Usage Example

コード例 #1
0
ファイル: CacheLite.php プロジェクト: verbazend/AWFA
 /**
  * Sets options for Cache_Lite based on the needs of the current method.
  * Options set include the subdirectory to be used, and the expiration.
  * 
  * @param string $key    The sub-directory of the cacheDir
  * @param string $expire The cache lifetime (expire) to be used
  * 
  * @return void
  */
 protected function setOptions($key, $expire = null)
 {
     $cacheDir = $this->options['cacheDir'] . '/oauth/';
     $cacheDir .= rtrim($key, '/') . '/';
     $this->ensureDirectoryExists($cacheDir);
     $this->cache->setOption('cacheDir', $cacheDir);
     $this->cache->setOption('lifeTime', $expire);
 }
All Usage Examples Of Cache_Lite::setOption