original_string: protected function new_redis($server, $prefix = '', $password = '') {
          $redis = new Redis();
          $port = null;
          if (strpos($server, ':')) {
              $serverconf = explode(':', $server);
              $server = $serverconf[0];
              $port = $serverconf[1];
          }
          if ($redis->connect($server, $port)) {
              if (!empty($password)) {
                  $redis->auth($password);
              }
              $redis->setOption(Redis::OPT_SERIALIZER, $this->serializer);
              if (!empty($prefix)) {
                  $redis->setOption(Redis::OPT_PREFIX, $prefix);
              }
              // Database setting option...
              $this->isready = $this->ping($redis);
          } else {
              $this->isready = false;
          }
          return $redis;
      }
code: protected function new_redis($server, $prefix = '', $password = '') {
          $redis = new Redis();
          $port = null;
          if (strpos($server, ':')) {
              $serverconf = explode(':', $server);
              $server = $serverconf[0];
              $port = $serverconf[1];
          }
          if ($redis->connect($server, $port)) {
              if (!empty($password)) {
                  $redis->auth($password);
              }
              $redis->setOption(Redis::OPT_SERIALIZER, $this->serializer);
              if (!empty($prefix)) {
                  $redis->setOption(Redis::OPT_PREFIX, $prefix);
              }
              // Database setting option...
              $this->isready = $this->ping($redis);
          } else {
              $this->isready = false;
          }
          return $redis;
      }
code_tokens: protected function new_redis ( $ server , $ prefix = '' , $ password = '' ) { $ redis = new Redis ( ) ; $ port = null ; if ( strpos ( $ server , ':' ) ) { $ serverconf = explode ( ':' , $ server ) ; $ server = $ serverconf [ 0 ] ; $ port = $ serverconf [ 1 ] ; } if ( $ redis -> connect ( $ server , $ port ) ) { if ( ! empty ( $ password ) ) { $ redis -> auth ( $ password ) ; } $ redis -> setOption ( Redis :: OPT_SERIALIZER , $ this -> serializer ) ; if ( ! empty ( $ prefix ) ) { $ redis -> setOption ( Redis :: OPT_PREFIX , $ prefix ) ; } // Database setting option... $ this -> isready = $ this -> ping ( $ redis ) ; } else { $ this -> isready = false ; } return $ redis ; }
docstring: Create a new Redis instance and
  connect to the server.
  
  @param string $server The server connection string
  @param string $prefix The key prefix
  @param string $password The server connection password
  @return Redis
docstring_tokens: Create a new Redis instance and connect to the server .