2020-08-31 01:27:08 +08:00
|
|
|
<?php
|
2020-10-29 18:17:25 +08:00
|
|
|
declare(strict_types=1);
|
2020-08-31 01:27:08 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace Snowflake\Pool;
|
|
|
|
|
|
|
|
|
|
|
2020-12-17 14:12:44 +08:00
|
|
|
|
2020-08-31 01:27:08 +08:00
|
|
|
use Snowflake\Snowflake;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Class Pool
|
|
|
|
|
* @package Snowflake\Pool
|
|
|
|
|
* @property $redis
|
|
|
|
|
* @property $db
|
2020-09-03 15:23:11 +08:00
|
|
|
* @property $memcached
|
2020-08-31 01:27:08 +08:00
|
|
|
*/
|
|
|
|
|
class Pool extends \Snowflake\Abstracts\Pool
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
/**
|
2020-09-03 15:23:11 +08:00
|
|
|
* @return Redis
|
2020-08-31 01:27:08 +08:00
|
|
|
*/
|
2020-12-17 14:12:44 +08:00
|
|
|
public function getRedis(): Redis
|
2020-08-31 01:27:08 +08:00
|
|
|
{
|
2020-09-03 11:39:20 +08:00
|
|
|
return Snowflake::app()->redis_connections;
|
2020-08-31 01:27:08 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @return Connection
|
|
|
|
|
*/
|
2020-12-17 14:12:44 +08:00
|
|
|
public function getDb(): Connection
|
2020-08-31 01:27:08 +08:00
|
|
|
{
|
2020-09-03 11:39:20 +08:00
|
|
|
return Snowflake::app()->connections;
|
2020-08-31 01:27:08 +08:00
|
|
|
}
|
|
|
|
|
|
2020-09-03 15:23:11 +08:00
|
|
|
|
2020-08-31 01:27:08 +08:00
|
|
|
}
|