改名
This commit is contained in:
@@ -296,10 +296,10 @@ abstract class BaseApplication extends Service
|
||||
|
||||
|
||||
/**
|
||||
* @return Pool
|
||||
* @return SPool
|
||||
* @throws ComponentException
|
||||
*/
|
||||
public function getPool(): Pool
|
||||
public function getPool(): SPool
|
||||
{
|
||||
return $this->get('pool');
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ use Exception;
|
||||
use Snowflake\Abstracts\Component;
|
||||
use Snowflake\Abstracts\Config;
|
||||
use Snowflake\Event;
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Exception\ConfigException;
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
@@ -121,10 +122,11 @@ SCRIPT;
|
||||
/**
|
||||
* 销毁连接池
|
||||
* @throws ConfigException
|
||||
* @throws ComponentException
|
||||
*/
|
||||
public function destroy()
|
||||
{
|
||||
$connections = Snowflake::app()->pool->redis;
|
||||
$connections = Snowflake::app()->getPool()->getRedis();
|
||||
$connections->destroy($this->get_config(), true);
|
||||
}
|
||||
|
||||
@@ -134,7 +136,7 @@ SCRIPT;
|
||||
*/
|
||||
public function proxy(): \Redis
|
||||
{
|
||||
$connections = Snowflake::app()->pool->redis;
|
||||
$connections = Snowflake::app()->getPool()->getRedis();
|
||||
|
||||
$client = $connections->getConnection($this->get_config(), true);
|
||||
if (!($client instanceof \Redis)) {
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace Snowflake\Pool;
|
||||
|
||||
|
||||
|
||||
use Snowflake\Exception\ComponentException;
|
||||
use Snowflake\Snowflake;
|
||||
|
||||
/**
|
||||
@@ -20,18 +21,20 @@ class Pool extends \Snowflake\Abstracts\Pool
|
||||
|
||||
/**
|
||||
* @return Redis
|
||||
* @throws ComponentException
|
||||
*/
|
||||
public function getRedis(): Redis
|
||||
{
|
||||
return Snowflake::app()->redis_connections;
|
||||
return Snowflake::app()->get('redis_connections');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Connection
|
||||
* @throws ComponentException
|
||||
*/
|
||||
public function getDb(): Connection
|
||||
{
|
||||
return Snowflake::app()->connections;
|
||||
return Snowflake::app()->get('connections');
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user