quit() public method

This is the same as Client::disconnect() as it does not actually send the QUIT command to Redis, but simply closes the connection.
public quit ( )
Example #1
0
 /**
  * Closes the connection
  */
 public function __destruct()
 {
     parent::quit();
 }
Example #2
0
 /**
  * @group disconnected
  */
 public function testQuitIsAliasForDisconnect()
 {
     $connection = $this->getMock('Predis\\Connection\\ConnectionInterface');
     $connection->expects($this->once())->method('disconnect');
     $client = new Client($connection);
     $client->quit();
 }
Example #3
0
$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;