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


PHP Database::connection方法代碼示例

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


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

示例1: __construct

 public function __construct(SessionManager $manager, Database $db)
 {
     parent::__construct($manager);
     $this->key = env('COMMON_SESSION');
     $this->redis = $db->connection('common');
     if ($this->redis === null) {
         throw new ResourceNotFoundException('Redis Common Connection is not exists.');
     }
 }
開發者ID:spyc,項目名稱:elearn-foundation,代碼行數:9,代碼來源:CommonSession.php

示例2: testDelete

 public function testDelete()
 {
     $job = new RedisQueueIntegrationTestJob(30);
     $this->queue->push($job);
     /** @var RedisJob $redisJob */
     $redisJob = $this->queue->pop();
     $redisJob->delete();
     $this->assertEquals(0, $this->redis->connection()->zcard('queues:default:delayed'));
     $this->assertEquals(0, $this->redis->connection()->zcard('queues:default:reserved'));
     $this->assertEquals(0, $this->redis->connection()->llen('queues:default'));
     $this->assertNull($this->queue->pop());
 }
開發者ID:halaei,項目名稱:hredis,代碼行數:12,代碼來源:RedisQueueIntegrationTest.php

示例3: connection

 /**
  * Get the Redis connection instance.
  *
  * @return \Predis\ClientInterface
  */
 public function connection()
 {
     return $this->redis->connection($this->connection);
 }
開發者ID:mubassirhayat,項目名稱:Laravel51-starter,代碼行數:9,代碼來源:RedisStore.php

示例4: connection

 /**
  * Get a specific Redis connection instance.
  *
  * @param string $name
  * @return \Predis\ClientInterface 
  * @static 
  */
 public static function connection($name = 'default')
 {
     return \Illuminate\Redis\Database::connection($name);
 }
開發者ID:nmkr,項目名稱:basic-starter,代碼行數:11,代碼來源:_ide_helper.php

示例5: getConnection

 /**
  * Get the connection for the queue.
  *
  * @return \Predis\ClientInterface
  */
 protected function getConnection()
 {
     return $this->redis->connection($this->connection);
 }
開發者ID:rodrigopbel,項目名稱:ong,代碼行數:9,代碼來源:RedisQueue.php

示例6:

 function __construct(RedisDatabase $redis)
 {
     $this->redis = $redis->connection();
 }
開發者ID:michaeljhopkins,項目名稱:alexa-app,代碼行數:4,代碼來源:RedisCertificateProvider.php


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