From 66f869749a3bca6bbd2901e0984f6e5c541e9aa2 Mon Sep 17 00:00:00 2001 From: David Grudl Date: Sat, 5 Aug 2023 20:22:48 +0200 Subject: [PATCH] drivers: removed auto-free feature --- src/Dibi/Drivers/FirebirdResult.php | 15 --------------- src/Dibi/Drivers/MySqliResult.php | 15 --------------- src/Dibi/Drivers/OdbcResult.php | 15 --------------- src/Dibi/Drivers/OracleResult.php | 15 --------------- src/Dibi/Drivers/PostgreResult.php | 15 --------------- src/Dibi/Drivers/SqliteResult.php | 15 --------------- src/Dibi/Drivers/SqlsrvResult.php | 15 --------------- 7 files changed, 105 deletions(-) diff --git a/src/Dibi/Drivers/FirebirdResult.php b/src/Dibi/Drivers/FirebirdResult.php index a597f741..840f60d9 100644 --- a/src/Dibi/Drivers/FirebirdResult.php +++ b/src/Dibi/Drivers/FirebirdResult.php @@ -23,9 +23,6 @@ class FirebirdResult implements Dibi\ResultDriver /** @var resource */ private $resultSet; - /** @var bool */ - private $autoFree = true; - /** * @param resource $resultSet @@ -36,17 +33,6 @@ public function __construct($resultSet) } - /** - * Automatically frees the resources allocated for this result set. - */ - public function __destruct() - { - if ($this->autoFree && $this->getResultResource()) { - $this->free(); - } - } - - /** * Returns the number of rows in a result set. */ @@ -105,7 +91,6 @@ public function free(): void */ public function getResultResource() { - $this->autoFree = false; return is_resource($this->resultSet) ? $this->resultSet : null; } diff --git a/src/Dibi/Drivers/MySqliResult.php b/src/Dibi/Drivers/MySqliResult.php index fde57880..369ccd03 100644 --- a/src/Dibi/Drivers/MySqliResult.php +++ b/src/Dibi/Drivers/MySqliResult.php @@ -22,9 +22,6 @@ class MySqliResult implements Dibi\ResultDriver /** @var \mysqli_result */ private $resultSet; - /** @var bool */ - private $autoFree = true; - /** @var bool Is buffered (seekable and countable)? */ private $buffered; @@ -36,17 +33,6 @@ public function __construct(\mysqli_result $resultSet, bool $buffered) } - /** - * Automatically frees the resources allocated for this result set. - */ - public function __destruct() - { - if ($this->autoFree && $this->getResultResource()) { - @$this->free(); - } - } - - /** * Returns the number of rows in a result set. */ @@ -136,7 +122,6 @@ public function getResultColumns(): array */ public function getResultResource(): \mysqli_result { - $this->autoFree = false; return $this->resultSet; } diff --git a/src/Dibi/Drivers/OdbcResult.php b/src/Dibi/Drivers/OdbcResult.php index 57657405..cfae6efc 100644 --- a/src/Dibi/Drivers/OdbcResult.php +++ b/src/Dibi/Drivers/OdbcResult.php @@ -22,9 +22,6 @@ class OdbcResult implements Dibi\ResultDriver /** @var resource */ private $resultSet; - /** @var bool */ - private $autoFree = true; - /** @var int Cursor */ private $row = 0; @@ -38,17 +35,6 @@ public function __construct($resultSet) } - /** - * Automatically frees the resources allocated for this result set. - */ - public function __destruct() - { - if ($this->autoFree && $this->getResultResource()) { - $this->free(); - } - } - - /** * Returns the number of rows in a result set. */ @@ -129,7 +115,6 @@ public function getResultColumns(): array */ public function getResultResource() { - $this->autoFree = false; return is_resource($this->resultSet) ? $this->resultSet : null; } diff --git a/src/Dibi/Drivers/OracleResult.php b/src/Dibi/Drivers/OracleResult.php index 78a3028b..2d05b289 100644 --- a/src/Dibi/Drivers/OracleResult.php +++ b/src/Dibi/Drivers/OracleResult.php @@ -22,9 +22,6 @@ class OracleResult implements Dibi\ResultDriver /** @var resource */ private $resultSet; - /** @var bool */ - private $autoFree = true; - /** * @param resource $resultSet @@ -35,17 +32,6 @@ public function __construct($resultSet) } - /** - * Automatically frees the resources allocated for this result set. - */ - public function __destruct() - { - if ($this->autoFree && $this->getResultResource()) { - $this->free(); - } - } - - /** * Returns the number of rows in a result set. */ @@ -111,7 +97,6 @@ public function getResultColumns(): array */ public function getResultResource() { - $this->autoFree = false; return is_resource($this->resultSet) ? $this->resultSet : null; } diff --git a/src/Dibi/Drivers/PostgreResult.php b/src/Dibi/Drivers/PostgreResult.php index cc0358ef..29d0be3d 100644 --- a/src/Dibi/Drivers/PostgreResult.php +++ b/src/Dibi/Drivers/PostgreResult.php @@ -24,9 +24,6 @@ class PostgreResult implements Dibi\ResultDriver /** @var resource|PgSql\Result */ private $resultSet; - /** @var bool */ - private $autoFree = true; - /** * @param resource|PgSql\Result $resultSet @@ -37,17 +34,6 @@ public function __construct($resultSet) } - /** - * Automatically frees the resources allocated for this result set. - */ - public function __destruct() - { - if ($this->autoFree && $this->getResultResource()) { - $this->free(); - } - } - - /** * Returns the number of rows in a result set. */ @@ -114,7 +100,6 @@ public function getResultColumns(): array */ public function getResultResource() { - $this->autoFree = false; return is_resource($this->resultSet) || $this->resultSet instanceof PgSql\Result ? $this->resultSet : null; diff --git a/src/Dibi/Drivers/SqliteResult.php b/src/Dibi/Drivers/SqliteResult.php index 686d8b00..2eb65983 100644 --- a/src/Dibi/Drivers/SqliteResult.php +++ b/src/Dibi/Drivers/SqliteResult.php @@ -23,9 +23,6 @@ class SqliteResult implements Dibi\ResultDriver /** @var \SQLite3Result */ private $resultSet; - /** @var bool */ - private $autoFree = true; - public function __construct(\SQLite3Result $resultSet) { @@ -33,17 +30,6 @@ public function __construct(\SQLite3Result $resultSet) } - /** - * Automatically frees the resources allocated for this result set. - */ - public function __destruct() - { - if ($this->autoFree && $this->getResultResource()) { - @$this->free(); - } - } - - /** * Returns the number of rows in a result set. * @throws Dibi\NotSupportedException @@ -109,7 +95,6 @@ public function getResultColumns(): array */ public function getResultResource(): \SQLite3Result { - $this->autoFree = false; return $this->resultSet; } diff --git a/src/Dibi/Drivers/SqlsrvResult.php b/src/Dibi/Drivers/SqlsrvResult.php index ef6ffcf8..d9fabe88 100644 --- a/src/Dibi/Drivers/SqlsrvResult.php +++ b/src/Dibi/Drivers/SqlsrvResult.php @@ -22,9 +22,6 @@ class SqlsrvResult implements Dibi\ResultDriver /** @var resource */ private $resultSet; - /** @var bool */ - private $autoFree = true; - /** * @param resource $resultSet @@ -35,17 +32,6 @@ public function __construct($resultSet) } - /** - * Automatically frees the resources allocated for this result set. - */ - public function __destruct() - { - if ($this->autoFree && $this->getResultResource()) { - $this->free(); - } - } - - /** * Returns the number of rows in a result set. */ @@ -107,7 +93,6 @@ public function getResultColumns(): array */ public function getResultResource() { - $this->autoFree = false; return is_resource($this->resultSet) ? $this->resultSet : null; }