/**
  * Constructor
  *
  * @param   array  $options  Optional parameters.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function __construct($options = array())
 {
     if (!self::isSupported()) {
         throw new \RuntimeException('Wincache Extension is not available', 404);
     }
     parent::__construct($options);
 }
 /**
  * Constructor
  *
  * @param   array  $options  Optional parameters. A `dbo` options is required.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function __construct($options = array())
 {
     if (isset($options['db']) && $options['db'] instanceof DatabaseDriver) {
         parent::__construct($options);
     } else {
         throw new \RuntimeException(sprintf('The %s storage engine requires a `db` option that is an instance of Joomla\\Database\\DatabaseDriver.', __CLASS__));
     }
 }
Beispiel #3
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   1.0
  */
 protected function setUp()
 {
     // Skip these tests if WinCache isn't available.
     if (!StorageWincache::isSupported()) {
         $this->markTestSkipped('WinCache storage is not enabled on this system.');
     }
     $this->object = Storage::getInstance('Wincache');
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   1.0
  */
 protected function setUp()
 {
     parent::setUp();
     // Skip these tests if APC isn't available.
     if (!StorageAPC::isSupported()) {
         $this->markTestSkipped('APC storage is not enabled on this system.');
     }
     $this->object = Storage::getInstance('APC');
 }
 /**
  * Constructor
  *
  * @param   array  $options  Optional parameters.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function __construct($options = array())
 {
     if (!self::isSupported()) {
         throw new \RuntimeException('Memcache Extension is not available', 404);
     }
     parent::__construct($options);
     // This will be an array of loveliness
     // @todo: multiple servers
     $this->_servers = array(array('host' => isset($options['memcache_server_host']) ? $options['memcache_server_host'] : 'localhost', 'port' => isset($options['memcache_server_port']) ? $options['memcache_server_port'] : 11211));
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   1.0
  */
 protected function setUp()
 {
     if (!class_exists('Memcached')) {
         $this->markTestSkipped('The Memcached class does not exist.');
         return;
     }
     // Create the caching object
     static::$object = Storage::getInstance('Memcached');
     // Parent contains the rest of the setup
     parent::setUp();
 }
 /**
  * Constructor
  *
  * @param   array  $options  Optional parameters.
  *
  * @since   1.0
  * @throws  \RuntimeException
  */
 public function __construct($options = array())
 {
     if (!self::isSupported()) {
         throw new \RuntimeException('Memcached Extension is not available', 404);
     }
     // This will be an array of loveliness
     // @todo: multiple servers
     $this->_servers = array(array('host' => isset($options['memcache_server_host']) ? $options['memcache_server_host'] : 'localhost', 'port' => isset($options['memcache_server_port']) ? $options['memcache_server_port'] : 11211));
     // Only construct parent AFTER host and port are sent, otherwise when register is called this will fail.
     parent::__construct($options);
 }
 /**
  * Constructor
  *
  * @param   array  $options  Optional parameters.
  *
  * @since   11.1
  * @throws  RuntimeException
  */
 public function __construct($options = array())
 {
     if (!self::isSupported()) {
         throw new RuntimeException('Memcache Extension is not available', 404);
     }
     parent::__construct($options);
     $config = Factory::getConfig();
     // This will be an array of loveliness
     // @todo: multiple servers
     $this->_servers = array(array('host' => $config->get('memcache_server_host', 'localhost'), 'port' => $config->get('memcache_server_port', 11211)));
 }
Beispiel #9
0
 /**
  * Create a new session and copy variables from the old one
  *
  * @return  boolean $result true on success
  *
  * @since   1.0
  */
 public function fork()
 {
     if ($this->getState() !== 'active') {
         // @TODO :: generated error here
         return false;
     }
     // Keep session config
     $cookie = session_get_cookie_params();
     // Kill session
     session_destroy();
     // Re-register the session store after a session has been destroyed, to avoid PHP bug
     $this->store->register();
     // Restore config
     session_set_cookie_params($cookie['lifetime'], $cookie['path'], $cookie['domain'], $cookie['secure'], true);
     // Restart session with new id
     session_regenerate_id(true);
     session_start();
     return true;
 }
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   1.0
  */
 protected function setUp()
 {
     parent::setUp();
     $this->object = Storage::getInstance('None');
 }
Beispiel #11
0
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return  void
  *
  * @since   1.0
  */
 protected function setUp()
 {
     parent::setUp();
     $this->object = Storage::getInstance('Database', array('db' => static::$driver));
 }
 /**
  * Test isSupported
  *
  * @return void
  */
 public function testIsSupported()
 {
     $this->assertThat(static::$object->isSupported(), $this->isTrue(), __LINE__);
 }