當前位置: 首頁>>代碼示例>>PHP>>正文


PHP JCacheStorage::getInstance方法代碼示例

本文整理匯總了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');
 }
開發者ID:ZerGabriel,項目名稱:joomla-platform,代碼行數:13,代碼來源:JCacheStorageXCacheTest.php

示例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');
 }
開發者ID:Joomla-on-NoSQL,項目名稱:LaMojo,代碼行數:14,代碼來源:JCacheStorageApcTest.php

示例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));
 }
開發者ID:rodhoff,項目名稱:MNW,代碼行數:7,代碼來源:JoomlamailerCache.php

示例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');
 }
開發者ID:Joomla-on-NoSQL,項目名稱:LaMojo,代碼行數:14,代碼來源:JCacheStorageEacceleratorTest.php

示例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'));
	}
開發者ID:robschley,項目名稱:joomla-platform,代碼行數:13,代碼來源:JCacheStorageFileTest.php

示例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');
		}
	}
開發者ID:realityking,項目名稱:JAJAX,代碼行數:34,代碼來源:JCacheStorageMemcacheTest.php

示例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.');
     }
 }
開發者ID:klas,項目名稱:joomla-cms,代碼行數:33,代碼來源:JCacheStorageXCacheTest.php

示例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');
 }
開發者ID:sural98,項目名稱:joomla-cms,代碼行數:14,代碼來源:JCacheStorageApcTest.php

示例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');
 }
開發者ID:rogatnev-nikita,項目名稱:cloudinterpreter,代碼行數:9,代碼來源:cache_16.php

示例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.');
     }
 }
開發者ID:SysBind,項目名稱:joomla-cms,代碼行數:16,代碼來源:JCacheStorageWincacheTest.php

示例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.');
     }
 }
開發者ID:jwest00724,項目名稱:joomla-cms,代碼行數:16,代碼來源:JCacheStorageApcuTest.php

示例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.');
     }
 }
開發者ID:klas,項目名稱:joomla-cms,代碼行數:16,代碼來源:JCacheStorageFileTest.php

示例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.');
     }
 }
開發者ID:klas,項目名稱:joomla-cms,代碼行數:17,代碼來源:JCacheStorageCacheliteTest.php

示例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.');
     }
 }
開發者ID:klas,項目名稱:joomla-cms,代碼行數:20,代碼來源:JCacheStorageRedisTest.php

示例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.');
     }
 }
開發者ID:SysBind,項目名稱:joomla-cms,代碼行數:23,代碼來源:JCacheStorageMemcacheTest.php


注:本文中的JCacheStorage::getInstance方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。