/**
  * 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;
 }
Exemplo n.º 2
0
 /**
  * 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;
 }
Exemplo n.º 3
0
 /**
  * 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;
 }
Exemplo n.º 4
0
 /**
  * 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;
 }