Skip to content

Commit 8607c5a

Browse files
committed
Only load PDO subclass polyfills when corresponding extension is loaded
1 parent 268fa4a commit 8607c5a

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/Php84/Resources/stubs/Pdo/Dblib.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use PDO;
1414
use PDOException;
1515

16-
if (\PHP_VERSION_ID < 80400) {
16+
if (\PHP_VERSION_ID < 80400 && extension_loaded('pdo_dblib')) {
1717
class Dblib extends PDO
1818
{
1919
public const ATTR_CONNECTION_TIMEOUT = PDO::DBLIB_ATTR_CONNECTION_TIMEOUT;

src/Php84/Resources/stubs/Pdo/Firebird.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use PDO;
1414
use PDOException;
1515

16-
if (\PHP_VERSION_ID < 80400) {
16+
if (\PHP_VERSION_ID < 80400 && extension_loaded('pdo_firebird')) {
1717
class Firebird extends PDO
1818
{
1919
public const ATTR_DATE_FORMAT = PDO::FB_ATTR_DATE_FORMAT;

src/Php84/Resources/stubs/Pdo/Mysql.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use PDO;
1414
use PDOException;
1515

16-
if (\PHP_VERSION_ID < 80400) {
16+
if (\PHP_VERSION_ID < 80400 && extension_loaded('pdo_mysql')) {
1717
// Feature detection for non-mysqlnd; see also https://www.php.net/manual/en/class.pdo-mysql.php#pdo-mysql.constants.attr-max-buffer-size
1818
if (defined('PDO::MYSQL_ATTR_MAX_BUFFER_SIZE') && defined('PDO::MYSQL_ATTR_READ_DEFAULT_FILE') && defined('PDO::MYSQL_ATTR_READ_DEFAULT_GROUP'))
1919
{

src/Php84/Resources/stubs/Pdo/Odbc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use PDO;
1414
use PDOException;
1515

16-
if (\PHP_VERSION_ID < 80400) {
16+
if (\PHP_VERSION_ID < 80400 && extension_loaded('pdo_odbc')) {
1717
class Odbc extends PDO
1818
{
1919
public const ATTR_USE_CURSOR_LIBRARY = PDO::ODBC_ATTR_USE_CURSOR_LIBRARY;

src/Php84/Resources/stubs/Pdo/Pgsql.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use PDO;
1414
use PDOException;
1515

16-
if (\PHP_VERSION_ID < 80400) {
16+
if (\PHP_VERSION_ID < 80400 && extension_loaded('pdo_pgsql')) {
1717
class Pgsql extends PDO
1818
{
1919
public const ATTR_DISABLE_PREPARES = PDO::PGSQL_ATTR_DISABLE_PREPARES;

src/Php84/Resources/stubs/Pdo/Sqlite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
use PDO;
1414
use PDOException;
1515

16-
if (\PHP_VERSION_ID < 80400) {
16+
if (\PHP_VERSION_ID < 80400 && extension_loaded('pdo_sqlite')) {
1717
class Sqlite extends PDO
1818
{
1919
public const ATTR_EXTENDED_RESULT_CODES = \PHP_VERSION_ID >= 70400 ? \PDO::SQLITE_ATTR_EXTENDED_RESULT_CODES : 1002;

0 commit comments

Comments
 (0)