本文整理匯總了PHP中JCacheStorage::__construct方法的典型用法代碼示例。如果您正苦於以下問題:PHP JCacheStorage::__construct方法的具體用法?PHP JCacheStorage::__construct怎麽用?PHP JCacheStorage::__construct使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JCacheStorage
的用法示例。
在下文中一共展示了JCacheStorage::__construct方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
/**
* Constructor
*
* @param array $options Optional parameters.
*
* @since 11.1
*/
public function __construct($options = array())
{
parent::__construct($options);
if (self::$_db === null) {
$this->getConnection();
}
}
示例2: __construct
/**
* Constructor
*
* @param array $options Optional parameters.
*
* @since 3.4
*/
public function __construct($options = array())
{
parent::__construct($options);
if (static::$_redis === null) {
$this->getConnection();
}
}
示例3: array
/**
* Constructor
*
* @access protected
* @param array $options optional parameters
*/
function __construct($options = array())
{
if (!$this->test()) {
return JError::raiseError(404, "The memcache extension is not available");
}
parent::__construct($options);
$config =& JFactory::getConfig();
$params = $config->getValue('config.memcache_settings');
if (!is_array($params)) {
$params = unserialize(stripslashes($params));
}
if (!$params) {
$params = array();
}
$this->_compress = isset($params['compression']) ? $params['compression'] : 0;
$this->_persistent = isset($params['persistent']) ? $params['persistent'] : false;
// This will be an array of loveliness
$this->_servers = isset($params['servers']) ? $params['servers'] : array();
// Create the memcache connection
$this->_db = new Memcache();
for ($i = 0, $n = count($this->_servers); $i < $n; $i++) {
$server = $this->_servers[$i];
$this->_db->addServer($server['host'], $server['port'], $this->_persistent);
}
// Get the site hash
$this->_hash = $config->getValue('config.secret');
}
示例4: __construct
/**
* Constructor
*
* @param array $options Optional parameters.
*
* @since 12.1
*/
public function __construct($options = array())
{
parent::__construct($options);
if (static::isSupported() && static::$_db === null) {
$this->getConnection();
}
}
示例5: array
/**
* Constructor
*
* @access protected
* @param array $options optional parameters
*/
function __construct($options = array())
{
parent::__construct($options);
$config =& JFactory::getConfig();
$this->_root = $options['cachebase'];
$this->_hash = $config->getValue('config.secret');
}
示例6: array
/**
* Constructor
*
* @param array $options optional parameters
*/
function __construct( $options = array() )
{
parent::__construct($options);
$config =& JFactory::getConfig();
$this->_hash = $config->get('secret');
}
示例7: __construct
/**
* Constructor
*
* @param array $options Optional parameters.
*
* @since 11.1
*/
public function __construct($options = array())
{
parent::__construct($options);
$this->_compress = JFactory::getConfig()->get('memcache_compress', false) ? MEMCACHE_COMPRESSED : 0;
if (static::$_db === null) {
$this->getConnection();
}
}
示例8: __construct
/**
* Constructor
*
* @param array $options Optional parameters.
*
* @since 11.1
*/
public function __construct($options = array())
{
parent::__construct($options);
$this->_root = $options['cachebase'];
$cloptions = array('cacheDir' => $this->_root . '/', 'lifeTime' => $this->_lifetime, 'fileLocking' => $this->_locking, 'automaticCleaningFactor' => isset($options['autoclean']) ? $options['autoclean'] : 200, 'fileNameProtection' => false, 'hashedDirectoryLevel' => 0, 'caching' => $options['caching']);
if (self::$CacheLiteInstance === null) {
$this->initCache($cloptions);
}
}
示例9: array
/**
* Constructor
*
* @access protected
* @param array $options optional parameters
*/
function __construct($options = array())
{
if (!$this->test()) {
return JError::raiseError(404, "The memcache extension is not available");
}
parent::__construct($options);
$params =& JCacheStorageMemcache::getConfig();
$this->_compress = isset($params['compression']) ? $params['compression'] : 0;
$this->_db =& JCacheStorageMemcache::getConnection();
// Get the site hash
$this->_hash = $params['hash'];
}
示例10: array
/**
* Constructor
*
* @access protected
* @param array $options optional parameters
*/
function __construct($options = array())
{
if (!$this->test()) {
return JError::raiseError(404, "The memcache extension is not available");
}
parent::__construct($options);
$params =& JCacheStorageMemcache::getConfig();
$this->_compress = isset($params['compression']) ? $params['compression'] : 0;
$this->_db =& JCacheStorageMemcache::getConnection();
// memcahed has no list keys, we do our own accounting, initalise key index
if ($this->_db->get($this->_hash . '-index') === false) {
$empty = array();
$this->_db->set($this->_hash . '-index', $empty, $this->_compress, 0);
}
}
示例11: __construct
/**
* Constructor
*
* @param array $options Optional parameters
*
* @since 11.1
*/
public function __construct($options = array())
{
parent::__construct($options);
$this->_root = $options['cachebase'];
}
示例12: __construct
/**
* Constructor
*
* @param array $options optional parameters
*
* @since 11.1
*/
public function __construct($options = array())
{
parent::__construct($options);
}
示例13: array
/**
* Constructor
*
* @access protected
* @param array $options optional parameters
*/
function __construct($options = array())
{
parent::__construct($options);
$this->_root = $options['cachebase'] . DS . $this->_site;
}
示例14: __construct
/**
* Constructor.
*
* @param array $options
* @param RuntimeStorage $runtime
*/
public function __construct($options = array(), RuntimeStorage $runtime = null)
{
$this->runtime = $runtime ?: new RuntimeStorage();
parent::__construct($options);
}
示例15: __construct
/**
* Constructor.
*
* @param array $options
* @param JSession $session
*/
public function __construct($options = array(), JSession $session = null)
{
$this->session = $session ?: JFactory::getSession();
parent::__construct($options);
}