/** * Constructor. * * @param array $options */ public function __construct($options = []) { if (extension_loaded('wincache') === false) { throw new Exception('The PHP extension wincache is not loaded! You may enable it in "php.ini"!'); } parent::__construct($options); }
/** * Constructor. * * @param array $options */ public function __construct($options = []) { if (!extension_loaded('xcache')) { throw new Exception('The PHP extension "xcache" is not loaded. You may enable it in "php.ini"!'); } parent::__construct($options); }
/** * Constructor. * * Instantiate and connect to Memcache Server * * @param array $options */ public function __construct($options = []) { if (extension_loaded('memcached') === false) { throw new Exception('The PHP extension memcache (cache) is not loaded! You may enable it in "php.ini"!'); } $defaultOptions = ['useConnection' => 'default', 'connection' => ['default' => ['servers' => [['host' => '127.0.0.1', 'port' => 11211, 'persistent' => true]]]]]; $options += $defaultOptions; parent::__construct($options); $this->memcached = $this->getMemcachedInstance($options['useConnection']); }
/** * Constructor. * * @param array $options */ public function __construct($options = []) { if (extension_loaded('apc') === false) { throw new \Koch\Exception\Exception('The PHP extension APC (Alternative PHP Cache) is not loaded. You may enable it in "php.ini"!'); } $enabled = ini_get('apc.enabled'); if (PHP_SAPI === 'cli') { $enabled = $enabled && (bool) ini_get('apc.enable_cli'); } if ($enabled === false) { throw new \Koch\Exception\Exception('The PHP extension APC (Alternative PHP Cache) is not loaded.' . "You may enable it with 'apc.enabled=1' and 'apc.enable_cli=1'!"); } parent::__construct($options); }
/** * Constructor. * * @param array $options */ public function __construct($options = []) { if (extension_loaded('eaccelerator') === false) { throw new Exception('The PHP extension eAccelerator (cache) is not loaded! You may enable it in "php.ini!"'); } // @todo ensure eaccelerator 0.9.5 is in use // from 0.9.6 the user cache functions are removed /*if (false === function_exists('eaccelerator_info')) { throw new \Exception('eAccelerator isn\'t compiled with info support!'); } else { $info = eaccelerator_info(); $version = $info['name']; }*/ parent::__construct($options); }
public function __construct($options = []) { if (class_exists('Mongo') === false) { throw new \Koch\Exception\Exception('MongoDb was not found.'); } // omg. let's grab the passed in mock objects from the $options array if (UNIT_TEST_RUN === true) { $this->mongo = $options['mock']['mongo']; $this->database = $options['mock']['mongodb']; unset($options['mock']); } $defaultOptions = ['database' => 'kf_database', 'collection' => 'kf_coll']; $options = $options + $defaultOptions; parent::__construct($options); if (!$this->mongo) { // "mongodb://*****:*****@remotemongoserver:27017" $this->mongo = new \MongoDB(); // connects to localhost:27017 by default } if ($this->mongo === false) { throw new \MongoConnectionException('Connecting to MongoDb failed. Check server, port and credentials.'); } $this->initialize(); }
/** * Constructor. * * @param array $options */ public function __construct($options = []) { parent::__construct($options); }