/** * Sets the url for the cache server to enable query caching. * * Only table schema queries are cached at the moment. A general query cache * will follow. * * Example: * * <code> * $config->set_cache("memcached://localhost"); * $config->set_cache("memcached://localhost",array("expire" => 60)); * </code> * * @param string $url Url to your cache server. * @param array $options Array of options */ public function set_cache($url, $options = array()) { Cache::initialize($url, $options); }
public function tear_down() { Cache::flush(); Cache::initialize(null); }
public function test_initialize_with_null() { Cache::initialize(null); $this->assert_null(Cache::$adapter); }
public function testInitializeWithNull() { Cache::initialize(null); $this->assertNull(Cache::$adapter); }
/** * Sets the url for the cache server to enable query caching. * * Only table schema queries are cached at the moment. A general query cache * will follow. * * Example: * * <code> * $config->setCache("memcached://localhost"); * $config->setCache("memcached://localhost",array("expire" => 60)); * </code> * * @param string $url Url to your cache server. * @param array $options Array of options */ public function setCache($url, $options = []) { Cache::initialize($url, $options); }
/** * @expectedException ActiveRecord\CacheException * @expectedExceptionMessage Connection refused */ public function test_exception_when_connect_fails() { Cache::initialize('memcache://127.0.0.1:1234'); }