改名
This commit is contained in:
@@ -149,8 +149,8 @@ class Connection extends Pool
|
|||||||
if (!isset($this->hasCreate[$coroutineName])) {
|
if (!isset($this->hasCreate[$coroutineName])) {
|
||||||
$this->hasCreate[$coroutineName] = 0;
|
$this->hasCreate[$coroutineName] = 0;
|
||||||
}
|
}
|
||||||
if (Context::hasContext($coroutineName)) {
|
if (($pdo = Context::getContext($coroutineName)) instanceof PDO) {
|
||||||
return Context::getContext($coroutineName);
|
return $pdo;
|
||||||
}
|
}
|
||||||
if (!$this->hasItem($coroutineName)) {
|
if (!$this->hasItem($coroutineName)) {
|
||||||
$this->newClient($config, $coroutineName);
|
$this->newClient($config, $coroutineName);
|
||||||
|
|||||||
@@ -44,8 +44,8 @@ class Redis extends Pool
|
|||||||
{
|
{
|
||||||
$name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases'];
|
$name = $config['host'] . ':' . $config['prefix'] . ':' . $config['databases'];
|
||||||
$coroutineName = $this->name('redis:' . $name, $isMaster);
|
$coroutineName = $this->name('redis:' . $name, $isMaster);
|
||||||
if (Context::hasContext($coroutineName)) {
|
if (($redis = Context::getContext($coroutineName)) instanceof \Redis) {
|
||||||
return Context::getContext($coroutineName);
|
return $redis;
|
||||||
}
|
}
|
||||||
if (!$this->hasItem($coroutineName)) {
|
if (!$this->hasItem($coroutineName)) {
|
||||||
$this->newClient($config, $coroutineName);
|
$this->newClient($config, $coroutineName);
|
||||||
|
|||||||
Reference in New Issue
Block a user