Skip to content

Commit 6fe095a

Browse files
committed
Merge remote-tracking branch 'upstream/develop' into 4.3
2 parents b166875 + 98a4666 commit 6fe095a

File tree

2 files changed

+46
-37
lines changed

2 files changed

+46
-37
lines changed

phpstan-baseline.neon.dist

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,16 +70,6 @@ parameters:
7070
count: 1
7171
path: system/Database/BaseBuilder.php
7272

73-
-
74-
message: "#^Call to an undefined method CodeIgniter\\\\Database\\\\BaseConnection\\:\\:_disableForeignKeyChecks\\(\\)\\.$#"
75-
count: 1
76-
path: system/Database/BaseConnection.php
77-
78-
-
79-
message: "#^Call to an undefined method CodeIgniter\\\\Database\\\\BaseConnection\\:\\:_enableForeignKeyChecks\\(\\)\\.$#"
80-
count: 1
81-
path: system/Database/BaseConnection.php
82-
8373
-
8474
message: "#^Call to an undefined method CodeIgniter\\\\Database\\\\QueryInterface\\:\\:getOriginalQuery\\(\\)\\.$#"
8575
count: 1

system/Database/BaseConnection.php

Lines changed: 46 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -423,13 +423,6 @@ public function initialize()
423423
$this->connectDuration = microtime(true) - $this->connectTime;
424424
}
425425

426-
/**
427-
* Connect to the database.
428-
*
429-
* @return mixed
430-
*/
431-
abstract public function connect(bool $persistent = false);
432-
433426
/**
434427
* Close the database connection.
435428
*/
@@ -458,14 +451,6 @@ public function persistentConnect()
458451
return $this->connect(true);
459452
}
460453

461-
/**
462-
* Keep or establish the connection if no queries have been sent for
463-
* a length of time exceeding the server's idle timeout.
464-
*
465-
* @return mixed
466-
*/
467-
abstract public function reconnect();
468-
469454
/**
470455
* Returns the actual connection object. If both a 'read' and 'write'
471456
* connection has been specified, you can pass either term in to
@@ -480,13 +465,6 @@ public function getConnection(?string $alias = null)
480465
return $this->connID;
481466
}
482467

483-
/**
484-
* Select a specific database table to use.
485-
*
486-
* @return mixed
487-
*/
488-
abstract public function setDatabase(string $databaseName);
489-
490468
/**
491469
* Returns the name of the current database being used.
492470
*/
@@ -523,11 +501,6 @@ public function getPlatform(): string
523501
return $this->DBDriver;
524502
}
525503

526-
/**
527-
* Returns a string containing the version of the database being used.
528-
*/
529-
abstract public function getVersion(): string;
530-
531504
/**
532505
* Sets the Table Aliases to use. These are typically
533506
* collected during use of the Builder, and set here
@@ -1588,21 +1561,35 @@ protected function foreignKeyDataToObjects(array $data)
15881561

15891562
/**
15901563
* Disables foreign key checks temporarily.
1564+
*
1565+
* @return bool
15911566
*/
15921567
public function disableForeignKeyChecks()
15931568
{
15941569
$sql = $this->_disableForeignKeyChecks();
15951570

1571+
if ($sql === '') {
1572+
// The feature is not supported.
1573+
return false;
1574+
}
1575+
15961576
return $this->query($sql);
15971577
}
15981578

15991579
/**
16001580
* Enables foreign key checks temporarily.
1581+
*
1582+
* @return bool
16011583
*/
16021584
public function enableForeignKeyChecks()
16031585
{
16041586
$sql = $this->_enableForeignKeyChecks();
16051587

1588+
if ($sql === '') {
1589+
// The feature is not supported.
1590+
return false;
1591+
}
1592+
16061593
return $this->query($sql);
16071594
}
16081595

@@ -1697,6 +1684,38 @@ abstract protected function _indexData(string $table): array;
16971684
*/
16981685
abstract protected function _foreignKeyData(string $table): array;
16991686

1687+
/**
1688+
* Platform-specific SQL statement to disable foreign key checks.
1689+
*
1690+
* If this feature is not supported, return empty string.
1691+
*
1692+
* @TODO This method should be moved to an interface that represents foreign key support.
1693+
*
1694+
* @return string
1695+
*
1696+
* @see disableForeignKeyChecks()
1697+
*/
1698+
protected function _disableForeignKeyChecks()
1699+
{
1700+
return '';
1701+
}
1702+
1703+
/**
1704+
* Platform-specific SQL statement to enable foreign key checks.
1705+
*
1706+
* If this feature is not supported, return empty string.
1707+
*
1708+
* @TODO This method should be moved to an interface that represents foreign key support.
1709+
*
1710+
* @return string
1711+
*
1712+
* @see enableForeignKeyChecks()
1713+
*/
1714+
protected function _enableForeignKeyChecks()
1715+
{
1716+
return '';
1717+
}
1718+
17001719
/**
17011720
* Accessor for properties if they exist.
17021721
*

0 commit comments

Comments
 (0)