1
0
mirror of https://github.com/dg/dibi.git synced 2025-08-06 14:16:39 +02:00

drivers: getResource() and getResultResource() checks if resource is alive

This commit is contained in:
David Grudl
2012-01-19 03:02:36 +01:00
parent c7b9a91fc2
commit 660a9db522
11 changed files with 30 additions and 28 deletions

View File

@@ -177,7 +177,7 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
*/
public function getResource()
{
return $this->connection;
return is_resource($this->connection) ? $this->connection : NULL;
}
@@ -307,7 +307,7 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
*/
public function __destruct()
{
$this->resultSet && @$this->free();
$this->getResultResource() && $this->free();
}
@@ -387,7 +387,7 @@ class DibiMsSqlDriver extends DibiObject implements IDibiDriver, IDibiResultDriv
*/
public function getResultResource()
{
return $this->resultSet;
return is_resource($this->resultSet) ? $this->resultSet : NULL;
}