本文整理汇总了PHP中Predis\Client::quit方法的典型用法代码示例。如果您正苦于以下问题:PHP Client::quit方法的具体用法?PHP Client::quit怎么用?PHP Client::quit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Predis\Client
的用法示例。
在下文中一共展示了Client::quit方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __destruct
/**
* Closes the connection
*/
public function __destruct()
{
parent::quit();
}
示例2: testQuitIsAliasForDisconnect
/**
* @group disconnected
*/
public function testQuitIsAliasForDisconnect()
{
$connection = $this->getMock('Predis\\Connection\\ConnectionInterface');
$connection->expects($this->once())->method('disconnect');
$client = new Client($connection);
$client->quit();
}
示例3: StreamHandler
$log->pushHandler(new StreamHandler(dirname(__DIR__) . '/' . $config['client']['log_file']));
//get params
if (!$_REQUEST['sender'] || !$_REQUEST['receiver'] || !$_REQUEST['text']) {
$log->error('Invalid request');
header("HTTP/1.1 420 OK");
die("ERR 110");
}
$client = new PredisClient($config['redis_conn_url']);
$bulkNum = (int) $client->get(BULK_COUNTER);
$bulkNum++;
$client->set(BULK_COUNTER, $bulkNum);
$message = json_encode($_REQUEST);
//store message
$client->hset(BULK_HASH, $bulkNum, $message);
$client->publish('bulkmocksend', $message);
$client->quit();
$messageId = BulkUtils::guid();
$smsParts = BulkUtils::getNumberOfSMSsegments($_REQUEST['text']);
ob_start();
//close http conn. and flush
header("HTTP/1.1 202 OK");
echo "OK {$messageId} {$smsParts}";
$log->info("Valid request and replied: OK {$messageId} {$smsParts}");
header('Connection: close');
header('Content-Length: ' . ob_get_length());
ob_end_flush();
ob_flush();
flush();
//proceed with dlr
if (!isset($_REQUEST['dlr-url'])) {
return;