Esempio n. 1
0
 /**
  * Instantiates the appropriate CacheLite object.
  * Only initializes the engine if it does not already exist.
  * Note this is a protected method
  *
  * @param   array  $cloptions  optional parameters
  *
  * @return  object
  *
  * @since   11.1
  */
 protected function initCache($cloptions)
 {
     if (!class_exists('Cache_Lite')) {
         require_once 'Cache/Lite.php';
     }
     self::$CacheLiteInstance = new Cache_Lite($cloptions);
     return self::$CacheLiteInstance;
 }
Esempio n. 2
0
	/**
	 * Instantiates the appropriate CacheLite object.
	 * Only initializes the engine if it does not already exist.
	 * Note this is a protected method
	 *
	 * @param   array  $options  optional parameters
	 *
	 * @return  object
	 *
	 * @since   11.1
	 */
	protected function initCache($cloptions)
	{
		require_once 'Cache/Lite.php';

		self::$CacheLiteInstance = new Cache_Lite($cloptions);

		return self::$CacheLiteInstance;
	}
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  */
 protected function setUp()
 {
     if (!JCacheStorageCachelite::isSupported()) {
         $this->markTestSkipped('The Cache_Lite cache handler is not supported on this system.');
     }
     parent::setUp();
     $this->handler = new JCacheStorageCachelite(array('caching' => true, 'cachebase' => JPATH_TESTS . '/tmp'));
     // Override the lifetime because the JCacheStorage API multiplies it by 60 (converts minutes to seconds)
     $this->handler->_lifetime = 2;
 }
 /**
  * Check availability of all cache handlers
  *
  * @return void
  */
 private function checkAvailability()
 {
     $this->available = array('apc' => JCacheStorageApc::isSupported(), 'apcu' => JCacheStorageApcu::isSupported(), 'cachelite' => JCacheStorageCachelite::isSupported(), 'file' => true, 'memcache' => JCacheStorageMemcache::isSupported(), 'memcached' => JCacheStorageMemcached::isSupported(), 'redis' => JCacheStorageRedis::isSupported(), 'wincache' => JCacheStorageWincache::isSupported(), 'xcache' => JCacheStorageXcache::isSupported());
 }
 /**
  * Testing isSupported().
  *
  * @return  void
  */
 public function testIsSupported()
 {
     $this->assertEquals($this->extensionAvailable, $this->object->isSupported(), 'Claims Cache_Lite is not loaded.');
 }