本文整理汇总了PHP中Memcached::quit方法的典型用法代码示例。如果您正苦于以下问题:PHP Memcached::quit方法的具体用法?PHP Memcached::quit怎么用?PHP Memcached::quit使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Memcached
的用法示例。
在下文中一共展示了Memcached::quit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
public function setUp()
{
self::$memcached->flush();
self::$memcached->quit();
$this->storage = new MemcachedStorage(self::$memcached);
$this->tokenBucket = new TokenBucket('test', $this->storage);
}
示例2: __destruct
public function __destruct()
{
//Terminate active memcached connection.
if (isset($this->cache)) {
$this->cache->quit();
}
}
示例3: setUp
public function setUp()
{
self::$memcached->flush();
self::$memcached->quit();
self::$memcached->set('found', array('count' => 5, 'time' => strtotime('2015-01-01 00:00:00')));
self::$memcached->set('oldkey', 'old story');
$this->storage = new MemcachedStorage(self::$memcached);
}
示例4: __destruct
public function __destruct()
{
if ($this->alive) {
try {
$this->instance->quit();
} catch (BaseException $e) {
// shhhh.
}
}
}
示例5: disconnect
/**
* Disconnect the open connection
*
* @return static
*/
public function disconnect()
{
if ($this->_connection !== null) {
if (method_exists($this->_connection, 'quit')) {
$this->_connection->quit();
}
}
$this->_connection = null;
return $this;
}
示例6: _after
public function _after(TestCase $test)
{
$this->memcache->flush();
switch (get_class($this->memcache)) {
case 'Memcache':
$this->memcache->close();
break;
case 'Memcached':
$this->memcache->quit();
break;
}
}
示例7: close
/**
* Close connection to memcache server
*
* @return bool
*/
protected function close()
{
if (!$this->is_connected) {
return false;
}
return $this->memcached->quit();
}
示例8: __destruct
/**
* Destroy the connections.
*/
public function __destruct()
{
switch (NN_CACHE_TYPE) {
case self::TYPE_REDIS:
$this->server->close();
break;
case self::TYPE_MEMCACHED:
$this->server->quit();
break;
}
}
示例9: close
/**
* Close
*
* Releases locks and closes connection.
*
* @return bool
*/
public function close()
{
if (isset($this->_memcached)) {
isset($this->_lock_key) && $this->_memcached->delete($this->_lock_key);
if (!$this->_memcached->quit()) {
return $this->_failure;
}
$this->_memcached = NULL;
return $this->_success;
}
return $this->_failure;
}
示例10: close
/**
* Close
*
* Releases locks and closes connection.
*
* @return bool
*/
public function close()
{
if (isset($this->memcached)) {
isset($this->lockKey) && $this->memcached->delete($this->lockKey);
if (!$this->memcached->quit()) {
return false;
}
$this->memcached = null;
return true;
}
return false;
}
示例11: close
/**
* Close
*
* Releases locks and closes connection.
*
* @return bool
*/
public function close()
{
if (isset($this->_memcached)) {
$this->_release_lock();
if (!$this->_memcached->quit()) {
return $this->_fail();
}
$this->_memcached = NULL;
return $this->_success;
}
return $this->_fail();
}
示例12: close
/**
* Close
*
* Releases locks and closes connection.
*
* @return bool
*/
public function close()
{
if (isset($this->_memcached)) {
isset($this->_lock_key) && $this->_memcached->delete($this->_lock_key);
if (!$this->_memcached->quit()) {
return FALSE;
}
$this->_memcached = NULL;
return TRUE;
}
return FALSE;
}
示例13: maybeAddServerConnections
/**
* Maybe add server connections.
*
* @since 151216 Memcached utilities.
*/
protected function maybeAddServerConnections()
{
if (!$this->Pool) {
return;
// Not possible.
}
if ($this->serversDiffer()) {
$this->Pool->quit();
$this->Pool->resetServerList();
$this->Pool->addServers($this->servers);
}
}
示例14: tearDown
/**
* @inheritDoc
*/
protected function tearDown()
{
parent::tearDown();
/* Close all active connections. */
$this->client->quit();
}
示例15: _close
/**
* Closes connection to server(s)
*/
protected function _close()
{
return $this->_connection->quit();
}