本文整理匯總了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.');
}
}
示例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());
}
示例3: connection
/**
* Get the Redis connection instance.
*
* @return \Predis\ClientInterface
*/
public function connection()
{
return $this->redis->connection($this->connection);
}
示例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);
}
示例5: getConnection
/**
* Get the connection for the queue.
*
* @return \Predis\ClientInterface
*/
protected function getConnection()
{
return $this->redis->connection($this->connection);
}
示例6:
function __construct(RedisDatabase $redis)
{
$this->redis = $redis->connection();
}