本文整理匯總了PHP中JCacheStorage::getInstance方法的典型用法代碼示例。如果您正苦於以下問題:PHP JCacheStorage::getInstance方法的具體用法?PHP JCacheStorage::getInstance怎麽用?PHP JCacheStorage::getInstance使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類JCacheStorage
的用法示例。
在下文中一共展示了JCacheStorage::getInstance方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
include_once JPATH_PLATFORM . '/joomla/cache/storage.php';
include_once JPATH_PLATFORM . '/joomla/cache/storage/xcache.php';
$this->xcacheAvailable = extension_loaded('xcache');
$this->object = JCacheStorage::getInstance('xcache');
}
示例2: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
* @access protected
*/
protected function setUp()
{
include_once JPATH_BASE . '/libraries/joomla/cache/storage.php';
include_once JPATH_BASE . '/libraries/joomla/cache/storage/apc.php';
$this->object = JCacheStorage::getInstance('apc');
$this->apcAvailable = extension_loaded('apc');
}
示例3: __construct
public function __construct($options = array())
{
$this->_root = JPATH_ADMINISTRATOR . '/cache';
$this->_hash = JFactory::getConfig()->get('secret');
$cache = new JCacheStorage();
$this->_cache = $cache->getInstance('file', array('cachebase' => $this->_root));
}
示例4: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
* @access protected
*/
protected function setUp()
{
include_once JPATH_BASE . '/libraries/joomla/cache/storage.php';
include_once JPATH_BASE . '/libraries/joomla/cache/storage/eaccelerator.php';
$this->eacceleratorAvailable = extension_loaded('eaccelerator') && function_exists('eaccelerator_get');
$this->object = JCacheStorage::getInstance('eaccelerator');
}
示例5: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
include_once JPATH_PLATFORM . '/joomla/cache/storage.php';
include_once JPATH_PLATFORM . '/joomla/cache/storage/file.php';
$this->object = JCacheStorage::getInstance('file', array('cachebase' => JPATH_BASE . '/cache'));
}
示例6: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
* @access protected
*/
protected function setUp()
{
$memcachetest = false;
include_once JPATH_BASE.'/libraries/joomla/cache/storage.php';
include_once JPATH_BASE.'/libraries/joomla/cache/storage/memcache.php';
if((extension_loaded('memcache') && class_exists('Memcache')) != true ) {
$this->memcacheAvailable = false; } else {
$config = JFactory::getConfig();
$host = $config->get('memcache_server_host', 'localhost');
$port = $config->get('memcache_server_port',11211);
$memcache = new Memcache;
$memcachetest = @$memcache->connect($host, $port); }
if (!$memcachetest)
{
$this->memcacheAvailable = false;
} else $this->memcacheAvailable = true;
if ($this->memcacheAvailable)
{
$this->object = JCacheStorage::getInstance('memcache');
}
}
示例7: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
parent::setUp();
$xcachetest = false;
if (extension_loaded('xcache')) {
// XCache Admin must be disabled for Joomla to use XCache
$xcache_admin_enable_auth = ini_get('xcache.admin.enable_auth');
// Some extensions ini variables are reported as strings
if ($xcache_admin_enable_auth == 'Off') {
$xcachetest = true;
}
// We require a string with contents 0, not a null value because it is not set since that then defaults to On/True
if ($xcache_admin_enable_auth === '0') {
$xcachetest = true;
}
// In some enviorments empty is equivalent to Off; See JC: #34044 && Github: #4083
if ($xcache_admin_enable_auth === '') {
$xcachetest = true;
}
}
$this->extensionAvailable = $xcachetest;
if ($this->extensionAvailable) {
$this->object = JCacheStorage::getInstance('xcache');
} else {
$this->markTestSkipped('This caching method is not supported on this system.');
}
}
示例8: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
parent::setUp();
include_once JPATH_PLATFORM . '/joomla/cache/storage.php';
include_once JPATH_PLATFORM . '/joomla/cache/storage/apc.php';
$this->object = JCacheStorage::getInstance('apc');
$this->apcAvailable = extension_loaded('apc');
}
示例9: array
function __construct($options = array())
{
$config =& JFactory::getConfig();
jimport('joomla.cache.cache');
$cache = new JCacheStorage();
$this->_cache = $cache->getInstance('file', array('cachebase' => JPATH_ADMINISTRATOR . DS . 'cache'));
$this->_root = JPATH_ADMINISTRATOR . DS . 'cache';
$this->_hash = $config->getValue('config.secret');
}
示例10: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
parent::setUp();
$this->extensionAvailable = extension_loaded('wincache') && function_exists('wincache_ucache_get') && !strcmp(ini_get('wincache.ucenabled'), '1');
if ($this->extensionAvailable) {
$this->object = JCacheStorage::getInstance('wincache');
} else {
$this->markTestSkipped('This caching method is not supported on this system.');
}
}
示例11: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
parent::setUp();
$this->extensionAvailable = JCacheStorageApcu::isSupported();
if ($this->extensionAvailable) {
$this->object = JCacheStorage::getInstance('apcu');
} else {
$this->markTestSkipped('This caching method is not supported on this system.');
}
}
示例12: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
parent::setUp();
$this->extensionAvailable = is_writable(JPATH_BASE . '/cache');
if ($this->extensionAvailable) {
$this->object = JCacheStorage::getInstance('file', array('cachebase' => JPATH_BASE . '/cache'));
} else {
$this->markTestSkipped('This caching method is not supported on this system.');
}
}
示例13: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
parent::setUp();
$this->extensionAvailable = class_exists('Cache_Lite');
if ($this->extensionAvailable) {
$options = array('cachebase' => JPATH_TESTS . '/tmp', 'caching' => true);
$this->object = JCacheStorage::getInstance('cachelite', $options);
} else {
$this->markTestSkipped('This caching method is not supported on this system.');
}
}
示例14: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*
* @since 3.4
*/
protected function setUp()
{
parent::setUp();
$this->saveFactoryState();
JFactory::$application = $this->getMockCmsApp();
$this->extensionAvailable = class_exists('Redis');
if ($this->extensionAvailable) {
$this->object = JCacheStorage::getInstance('redis');
} else {
$this->markTestSkipped('This caching method is not supported on this system.');
}
}
示例15: setUp
/**
* Sets up the fixture, for example, opens a network connection.
* This method is called before a test is executed.
*
* @return void
*/
protected function setUp()
{
$memcachetest = false;
if (extension_loaded('memcache') || class_exists('Memcache')) {
$config = JFactory::getConfig();
$host = $config->get('memcache_server_host', 'localhost');
$port = $config->get('memcache_server_port', 11211);
$memcache = new Memcache();
$memcachetest = @$memcache->connect($host, $port);
}
$this->extensionAvailable = $memcachetest;
if ($this->extensionAvailable) {
$this->object = JCacheStorage::getInstance('memcache');
} else {
$this->markTestSkipped('This caching method is not supported on this system.');
}
}