mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 08:05:53 +02: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() {
|
||||
if(is_resource($this->dbConn)) {
|
||||
if(function_exists('mssql_close')) {
|
||||
mssql_close($this->dbConn);
|
||||
} elseif(function_exists('sqlsrv_close')) {
|
||||
sqlsrv_close($this->dbConn);
|
||||
}
|
||||
if($this->mssql) {
|
||||
mssql_close($this->dbConn);
|
||||
} else {
|
||||
sqlsrv_close($this->dbConn);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1246,7 +1244,6 @@ class MSSQLQuery extends Query {
|
||||
* @param handle the internal mssql handle that is points to the resultset.
|
||||
*/
|
||||
public function __construct(MSSQLDatabase $database, $handle, $mssql) {
|
||||
|
||||
$this->database = $database;
|
||||
$this->handle = $handle;
|
||||
$this->mssql = $mssql;
|
||||
@ -1255,7 +1252,6 @@ class MSSQLQuery extends Query {
|
||||
}
|
||||
|
||||
public function __destroy() {
|
||||
Debug::message("Destroying query");
|
||||
if($this->mssql) {
|
||||
mssql_free_result($this->handle);
|
||||
} else {
|
||||
@ -1263,9 +1259,8 @@ class MSSQLQuery extends Query {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
/**
|
||||
* Please see the comments below for numRecords
|
||||
*
|
||||
*/
|
||||
public function seek($row) {
|
||||
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.
|
||||
*
|
||||
* For this function, and seek() (above), we will be returning false.
|
||||
*
|
||||
*/
|
||||
public function numRecords() {
|
||||
if($this->mssql) {
|
||||
|
Loading…
Reference in New Issue
Block a user