Author: Daniele Alessandri (suppakilla@gmail.com)
コード例 #1
0
ファイル: ProfileOption.php プロジェクト: huycao/yodelivery
 /**
  * Sets the commands processors that need to be applied to the profile.
  *
  * @param OptionsInterface $options Client options.
  * @param ProfileInterface $profile Server profile.
  */
 protected function setProcessors(OptionsInterface $options, ProfileInterface $profile)
 {
     if (isset($options->prefix) && $profile instanceof RedisProfile) {
         // NOTE: directly using __get('prefix') is actually a workaround for
         // HHVM 2.3.0. It's correct and respects the options interface, it's
         // just ugly. We will remove this hack when HHVM will fix re-entrant
         // calls to __get() once and for all.
         $profile->setProcessor($options->__get('prefix'));
     }
 }
コード例 #2
0
 /**
  * Returns the list of commands supported by the current
  * server profile.
  *
  * @param ProfileInterface $profile Server profile instance.
  *
  * @return array
  */
 protected function getCommands(ProfileInterface $profile)
 {
     $commands = $profile->getSupportedCommands();
     return array_keys($commands);
 }