本文整理汇总了PHP中phpiredis_reader_create函数的典型用法代码示例。如果您正苦于以下问题:PHP phpiredis_reader_create函数的具体用法?PHP phpiredis_reader_create怎么用?PHP phpiredis_reader_create使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了phpiredis_reader_create函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initializeReader
/**
* Initializes the protocol reader resource.
*/
protected function initializeReader()
{
$reader = phpiredis_reader_create();
phpiredis_reader_set_status_handler($reader, $this->getStatusHandler());
phpiredis_reader_set_error_handler($reader, $this->getErrorHandler());
$this->reader = $reader;
}
示例2: initializeReader
/**
* Initializes the protocol reader resource.
*
* @param Boolean $throw_errors Specify if Redis errors throw exceptions.
*/
private function initializeReader($throw_errors = true)
{
if (!function_exists('phpiredis_reader_create')) {
throw new ClientException('The phpiredis extension must be loaded in order to be able to ' . 'use this connection class');
}
$reader = phpiredis_reader_create();
phpiredis_reader_set_status_handler($reader, $this->getStatusHandler());
phpiredis_reader_set_error_handler($reader, $this->getErrorHandler($throw_errors));
$this->_reader = $reader;
}
示例3: initializeReader
/**
* Initializes phpiredis' protocol reader.
*
* @param IConnectionParameters $parameters Parameters used to initialize the connection.
* @return resource
*/
private function initializeReader(IConnectionParameters $parameters)
{
$reader = phpiredis_reader_create();
phpiredis_reader_set_status_handler($reader, $this->getStatusHandler());
phpiredis_reader_set_error_handler($reader, $this->getErrorHandler($parameters->throw_errors));
return $reader;
}
示例4: createReader
/**
* Creates a new instance of the protocol reader resource.
*
* @return resource
*/
private function createReader()
{
$reader = phpiredis_reader_create();
phpiredis_reader_set_status_handler($reader, $this->getStatusHandler());
phpiredis_reader_set_error_handler($reader, $this->getErrorHandler());
return $reader;
}