Added support for cloning a db connection

improved fix #14020
fixes #13890

https://github.com/yiisoft/yii2/pull/14020/files#r115185865

close #14121
This commit is contained in:
Carsten Brandt
2017-05-08 10:31:34 +02:00
parent 80d6f7323a
commit 5ed6910e1c
5 changed files with 67 additions and 17 deletions

View File

@ -1080,4 +1080,18 @@ class Connection extends Component
$this->close();
return array_keys((array) $this);
}
/**
* Reset the connection after cloning.
*/
public function __clone()
{
parent::__clone();
$this->_master = false;
$this->_slave = false;
$this->pdo = null;
$this->_schema = null;
$this->_transaction = null;
}
}