mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 06:05:53 +00:00
MINOR Check for $this->mssql in MSSQLDatabase::__destruct()
MINOR Removed Debug from MSSQLQuery::__destruct() MINOR Code formatting fixes in MSSQLQuery
This commit is contained in:
parent
915457b86b
commit
f555c3518f
@ -95,12 +95,10 @@ class MSSQLDatabase extends Database {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function __destruct() {
|
public function __destruct() {
|
||||||
if(is_resource($this->dbConn)) {
|
if($this->mssql) {
|
||||||
if(function_exists('mssql_close')) {
|
mssql_close($this->dbConn);
|
||||||
mssql_close($this->dbConn);
|
} else {
|
||||||
} elseif(function_exists('sqlsrv_close')) {
|
sqlsrv_close($this->dbConn);
|
||||||
sqlsrv_close($this->dbConn);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1246,7 +1244,6 @@ class MSSQLQuery extends Query {
|
|||||||
* @param handle the internal mssql handle that is points to the resultset.
|
* @param handle the internal mssql handle that is points to the resultset.
|
||||||
*/
|
*/
|
||||||
public function __construct(MSSQLDatabase $database, $handle, $mssql) {
|
public function __construct(MSSQLDatabase $database, $handle, $mssql) {
|
||||||
|
|
||||||
$this->database = $database;
|
$this->database = $database;
|
||||||
$this->handle = $handle;
|
$this->handle = $handle;
|
||||||
$this->mssql = $mssql;
|
$this->mssql = $mssql;
|
||||||
@ -1255,7 +1252,6 @@ class MSSQLQuery extends Query {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function __destroy() {
|
public function __destroy() {
|
||||||
Debug::message("Destroying query");
|
|
||||||
if($this->mssql) {
|
if($this->mssql) {
|
||||||
mssql_free_result($this->handle);
|
mssql_free_result($this->handle);
|
||||||
} else {
|
} else {
|
||||||
@ -1263,9 +1259,8 @@ class MSSQLQuery extends Query {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/**
|
||||||
* Please see the comments below for numRecords
|
* Please see the comments below for numRecords
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function seek($row) {
|
public function seek($row) {
|
||||||
if($this->mssql) {
|
if($this->mssql) {
|
||||||
@ -1286,7 +1281,6 @@ class MSSQLQuery extends Query {
|
|||||||
* rowset, cache it, and then do the count on that. This is probably resource intensive.
|
* rowset, cache it, and then do the count on that. This is probably resource intensive.
|
||||||
*
|
*
|
||||||
* For this function, and seek() (above), we will be returning false.
|
* For this function, and seek() (above), we will be returning false.
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
public function numRecords() {
|
public function numRecords() {
|
||||||
if($this->mssql) {
|
if($this->mssql) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user