當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ServerProfile::getDevelopment方法代碼示例

本文整理匯總了PHP中Predis\Profile\ServerProfile::getDevelopment方法的典型用法代碼示例。如果您正苦於以下問題:PHP ServerProfile::getDevelopment方法的具體用法?PHP ServerProfile::getDevelopment怎麽用?PHP ServerProfile::getDevelopment使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Predis\Profile\ServerProfile的用法示例。


在下文中一共展示了ServerProfile::getDevelopment方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testGetDevelopment

 /**
  * @group disconnected
  */
 public function testGetDevelopment()
 {
     $profile1 = ServerProfile::get('dev');
     $profile2 = ServerProfile::getDevelopment();
     $this->assertInstanceOf('Predis\\Profile\\ServerProfileInterface', $profile1);
     $this->assertInstanceOf('Predis\\Profile\\ServerProfileInterface', $profile2);
     $this->assertEquals(self::DEVELOPMENT_PROFILE_VERSION, $profile2->getVersion());
 }
開發者ID:ningcaichen,項目名稱:laravel-4.1-quick-start-cn,代碼行數:11,代碼來源:ServerProfileTest.php

示例2: getCommandsQueue

 /**
  * Returns a list of queued command instances.
  *
  * @return SplQueue
  */
 protected function getCommandsQueue()
 {
     $profile = ServerProfile::getDevelopment();
     $pipeline = new SplQueue();
     $pipeline->enqueue($profile->createCommand('ping'));
     $pipeline->enqueue($profile->createCommand('ping'));
     $pipeline->enqueue($profile->createCommand('ping'));
     return $pipeline;
 }
開發者ID:GeorgeBroadley,項目名稱:caffeine-vendor,代碼行數:14,代碼來源:FireAndForgetExecutorTest.php

示例3: testSetLuaScriptAsReadOperation

 /**
  * @group disconnected
  */
 public function testSetLuaScriptAsReadOperation()
 {
     $strategy = new ReplicationStrategy();
     $profile = ServerProfile::getDevelopment();
     $writeScript = 'redis.call("set", "foo", "bar")';
     $readScript = 'return true';
     $strategy->setScriptReadOnly($readScript, true);
     $cmdEval = $profile->createCommand('EVAL', array($writeScript));
     $cmdEvalSHA = $profile->createCommand('EVALSHA', array(sha1($writeScript)));
     $this->assertFalse($strategy->isReadOperation($cmdEval));
     $this->assertFalse($strategy->isReadOperation($cmdEvalSHA));
     $cmdEval = $profile->createCommand('EVAL', array($readScript));
     $cmdEvalSHA = $profile->createCommand('EVALSHA', array(sha1($readScript)));
     $this->assertTrue($strategy->isReadOperation($cmdEval));
     $this->assertTrue($strategy->isReadOperation($cmdEvalSHA));
 }
開發者ID:Thomvh,項目名稱:turbine,代碼行數:19,代碼來源:ReplicationStrategyTest.php

示例4: testSettingCustomCommandHandler

 /**
  * @group disconnected
  */
 public function testSettingCustomCommandHandler()
 {
     $strategy = $this->getHashStrategy();
     $profile = ServerProfile::getDevelopment();
     $callable = $this->getMock('stdClass', array('__invoke'));
     $callable->expects($this->once())->method('__invoke')->with($this->isInstanceOf('Predis\\Command\\CommandInterface'))->will($this->returnValue('key'));
     $strategy->setCommandHandler('get', $callable);
     $command = $profile->createCommand('get', array('key'));
     $this->assertNotNull($strategy->getHash($command));
 }
開發者ID:ningcaichen,項目名稱:laravel-4.1-quick-start-cn,代碼行數:13,代碼來源:PredisClusterHashStrategyTest.php


注:本文中的Predis\Profile\ServerProfile::getDevelopment方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。