Skip to content

Commit 66f8697

Browse files
committed
drivers: removed auto-free feature
1 parent 9e2a936 commit 66f8697

7 files changed

Lines changed: 0 additions & 105 deletions

File tree

src/Dibi/Drivers/FirebirdResult.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,6 @@ class FirebirdResult implements Dibi\ResultDriver
2323
/** @var resource */
2424
private $resultSet;
2525

26-
/** @var bool */
27-
private $autoFree = true;
28-
2926

3027
/**
3128
* @param resource $resultSet
@@ -36,17 +33,6 @@ public function __construct($resultSet)
3633
}
3734

3835

39-
/**
40-
* Automatically frees the resources allocated for this result set.
41-
*/
42-
public function __destruct()
43-
{
44-
if ($this->autoFree && $this->getResultResource()) {
45-
$this->free();
46-
}
47-
}
48-
49-
5036
/**
5137
* Returns the number of rows in a result set.
5238
*/
@@ -105,7 +91,6 @@ public function free(): void
10591
*/
10692
public function getResultResource()
10793
{
108-
$this->autoFree = false;
10994
return is_resource($this->resultSet) ? $this->resultSet : null;
11095
}
11196

src/Dibi/Drivers/MySqliResult.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ class MySqliResult implements Dibi\ResultDriver
2222
/** @var \mysqli_result */
2323
private $resultSet;
2424

25-
/** @var bool */
26-
private $autoFree = true;
27-
2825
/** @var bool Is buffered (seekable and countable)? */
2926
private $buffered;
3027

@@ -36,17 +33,6 @@ public function __construct(\mysqli_result $resultSet, bool $buffered)
3633
}
3734

3835

39-
/**
40-
* Automatically frees the resources allocated for this result set.
41-
*/
42-
public function __destruct()
43-
{
44-
if ($this->autoFree && $this->getResultResource()) {
45-
@$this->free();
46-
}
47-
}
48-
49-
5036
/**
5137
* Returns the number of rows in a result set.
5238
*/
@@ -136,7 +122,6 @@ public function getResultColumns(): array
136122
*/
137123
public function getResultResource(): \mysqli_result
138124
{
139-
$this->autoFree = false;
140125
return $this->resultSet;
141126
}
142127

src/Dibi/Drivers/OdbcResult.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ class OdbcResult implements Dibi\ResultDriver
2222
/** @var resource */
2323
private $resultSet;
2424

25-
/** @var bool */
26-
private $autoFree = true;
27-
2825
/** @var int Cursor */
2926
private $row = 0;
3027

@@ -38,17 +35,6 @@ public function __construct($resultSet)
3835
}
3936

4037

41-
/**
42-
* Automatically frees the resources allocated for this result set.
43-
*/
44-
public function __destruct()
45-
{
46-
if ($this->autoFree && $this->getResultResource()) {
47-
$this->free();
48-
}
49-
}
50-
51-
5238
/**
5339
* Returns the number of rows in a result set.
5440
*/
@@ -129,7 +115,6 @@ public function getResultColumns(): array
129115
*/
130116
public function getResultResource()
131117
{
132-
$this->autoFree = false;
133118
return is_resource($this->resultSet) ? $this->resultSet : null;
134119
}
135120

src/Dibi/Drivers/OracleResult.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ class OracleResult implements Dibi\ResultDriver
2222
/** @var resource */
2323
private $resultSet;
2424

25-
/** @var bool */
26-
private $autoFree = true;
27-
2825

2926
/**
3027
* @param resource $resultSet
@@ -35,17 +32,6 @@ public function __construct($resultSet)
3532
}
3633

3734

38-
/**
39-
* Automatically frees the resources allocated for this result set.
40-
*/
41-
public function __destruct()
42-
{
43-
if ($this->autoFree && $this->getResultResource()) {
44-
$this->free();
45-
}
46-
}
47-
48-
4935
/**
5036
* Returns the number of rows in a result set.
5137
*/
@@ -111,7 +97,6 @@ public function getResultColumns(): array
11197
*/
11298
public function getResultResource()
11399
{
114-
$this->autoFree = false;
115100
return is_resource($this->resultSet) ? $this->resultSet : null;
116101
}
117102

src/Dibi/Drivers/PostgreResult.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ class PostgreResult implements Dibi\ResultDriver
2424
/** @var resource|PgSql\Result */
2525
private $resultSet;
2626

27-
/** @var bool */
28-
private $autoFree = true;
29-
3027

3128
/**
3229
* @param resource|PgSql\Result $resultSet
@@ -37,17 +34,6 @@ public function __construct($resultSet)
3734
}
3835

3936

40-
/**
41-
* Automatically frees the resources allocated for this result set.
42-
*/
43-
public function __destruct()
44-
{
45-
if ($this->autoFree && $this->getResultResource()) {
46-
$this->free();
47-
}
48-
}
49-
50-
5137
/**
5238
* Returns the number of rows in a result set.
5339
*/
@@ -114,7 +100,6 @@ public function getResultColumns(): array
114100
*/
115101
public function getResultResource()
116102
{
117-
$this->autoFree = false;
118103
return is_resource($this->resultSet) || $this->resultSet instanceof PgSql\Result
119104
? $this->resultSet
120105
: null;

src/Dibi/Drivers/SqliteResult.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,13 @@ class SqliteResult implements Dibi\ResultDriver
2323
/** @var \SQLite3Result */
2424
private $resultSet;
2525

26-
/** @var bool */
27-
private $autoFree = true;
28-
2926

3027
public function __construct(\SQLite3Result $resultSet)
3128
{
3229
$this->resultSet = $resultSet;
3330
}
3431

3532

36-
/**
37-
* Automatically frees the resources allocated for this result set.
38-
*/
39-
public function __destruct()
40-
{
41-
if ($this->autoFree && $this->getResultResource()) {
42-
@$this->free();
43-
}
44-
}
45-
46-
4733
/**
4834
* Returns the number of rows in a result set.
4935
* @throws Dibi\NotSupportedException
@@ -109,7 +95,6 @@ public function getResultColumns(): array
10995
*/
11096
public function getResultResource(): \SQLite3Result
11197
{
112-
$this->autoFree = false;
11398
return $this->resultSet;
11499
}
115100

src/Dibi/Drivers/SqlsrvResult.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ class SqlsrvResult implements Dibi\ResultDriver
2222
/** @var resource */
2323
private $resultSet;
2424

25-
/** @var bool */
26-
private $autoFree = true;
27-
2825

2926
/**
3027
* @param resource $resultSet
@@ -35,17 +32,6 @@ public function __construct($resultSet)
3532
}
3633

3734

38-
/**
39-
* Automatically frees the resources allocated for this result set.
40-
*/
41-
public function __destruct()
42-
{
43-
if ($this->autoFree && $this->getResultResource()) {
44-
$this->free();
45-
}
46-
}
47-
48-
4935
/**
5036
* Returns the number of rows in a result set.
5137
*/
@@ -107,7 +93,6 @@ public function getResultColumns(): array
10793
*/
10894
public function getResultResource()
10995
{
110-
$this->autoFree = false;
11196
return is_resource($this->resultSet) ? $this->resultSet : null;
11297
}
11398

0 commit comments

Comments
 (0)