Skip to content

Commit

Permalink
Implementing disconnection in DboMysql
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Oct 15, 2010
1 parent 7a7659d commit 21f5707
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cake/libs/model/datasources/dbo/dbo_mysql.php
Expand Up @@ -183,10 +183,11 @@ function enabled() {
* @return boolean True if the database could be disconnected, else false
*/
function disconnect() {
if (isset($this->results) && is_resource($this->results)) {
mysql_free_result($this->results);
if (is_a($this->_result, 'PDOStatement')) {
$this->_result->closeCursor();
}
$this->connected = !@mysql_close($this->connection);
unset($this->_connection);
$this->connected = false;
return !$this->connected;
}

Expand Down

0 comments on commit 21f5707

Please sign in to comment.