Skip to content

Commit 6ec4220

Browse files
authored
Amend PDO driver-specific class names (#14069)
As suggested in https://externals.io/message/123166
1 parent ec54edb commit 6ec4220

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+239
-225
lines changed

ext/pdo_dblib/pdo_dblib.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ PHP_MINIT_FUNCTION(pdo_dblib)
204204
return FAILURE;
205205
}
206206

207-
PdoDblib_ce = register_class_PdoDblib(pdo_dbh_ce);
207+
PdoDblib_ce = register_class_Pdo_Dblib(pdo_dbh_ce);
208208
PdoDblib_ce->create_object = pdo_dbh_new;
209209

210210
if (FAILURE == php_pdo_register_driver(&pdo_dblib_driver)) {

ext/pdo_dblib/pdo_dblib.stub.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
/** @generate-class-entries */
44

5+
namespace Pdo;
6+
57
/**
68
* @strict-properties
79
* @not-serializable
810
*/
9-
class PdoDblib extends PDO
11+
class Dblib extends PDO
1012
{
1113
/** @cvalue PDO_DBLIB_ATTR_CONNECTION_TIMEOUT */
1214
public const int ATTR_CONNECTION_TIMEOUT = UNKNOWN;

ext/pdo_dblib/pdo_dblib_arginfo.h

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/pdo_dblib/tests/pdodblib_001.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
PdoDblib basic
2+
Pdo\Dblib basic
33
--EXTENSIONS--
44
pdo_dblib
55
--SKIPIF--
@@ -11,7 +11,7 @@ getDbConnection();
1111
<?php
1212

1313
require __DIR__ . '/config.inc';
14-
$db = getDbConnection(PdoDblib::class);
14+
$db = getDbConnection(Pdo\Dblib::class);
1515

1616
$db->query("CREATE TABLE #pdo_dblib_001(name VARCHAR(32)); ");
1717
$db->query("INSERT INTO #pdo_dblib_001 VALUES('PHP'), ('PHP6');");

ext/pdo_dblib/tests/pdodblib_002.phpt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
PdoDblib create through PDO::connect
2+
Pdo\Dblib create through PDO::connect
33
--EXTENSIONS--
44
pdo_dblib
55
--SKIPIF--
@@ -13,8 +13,8 @@ getDbConnection();
1313
require __DIR__ . '/config.inc';
1414

1515
$db = connectToDb();
16-
if (!$db instanceof PdoDblib) {
17-
echo "Wrong class type. Should be PdoDblib but is " . get_class($db) . "\n";
16+
if (!$db instanceof Pdo\Dblib) {
17+
echo "Wrong class type. Should be Pdo\Dblib but is " . get_class($db) . "\n";
1818
}
1919

2020
$db->query("CREATE TABLE #pdo_dblib_002(name VARCHAR(32))");

ext/pdo_firebird/pdo_firebird.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ PHP_MINIT_FUNCTION(pdo_firebird) /* {{{ */
7070
return FAILURE;
7171
}
7272

73-
PdoFirebird_ce = register_class_PdoFirebird(pdo_dbh_ce);
73+
PdoFirebird_ce = register_class_Pdo_Firebird(pdo_dbh_ce);
7474
PdoFirebird_ce->create_object = pdo_dbh_new;
7575

7676
#ifdef ZEND_SIGNALS

ext/pdo_firebird/pdo_firebird.stub.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22

33
/** @generate-class-entries */
44

5+
namespace Pdo;
6+
57
/**
68
* @strict-properties
79
* @not-serializable
810
*/
9-
class PdoFirebird extends PDO
11+
class Firebird extends PDO
1012
{
1113
/** @cvalue PDO_FB_ATTR_DATE_FORMAT */
1214
public const int ATTR_DATE_FORMAT = UNKNOWN;

ext/pdo_firebird/pdo_firebird_arginfo.h

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ext/pdo_firebird/tests/pdofirebird_002.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ See https://github.com/FirebirdSQL/firebird/issues/7849
1313
require_once __DIR__ . "/testdb.inc";
1414

1515
$db = connectToDb();
16-
if (!$db instanceof PdoFirebird) {
17-
echo "Wrong class type. Should be PdoFirebird but is " . get_class($db) . "\n";
16+
if (!$db instanceof Pdo\Firebird) {
17+
echo "Wrong class type. Should be Pdo\Firebird but is " . get_class($db) . "\n";
1818
}
1919

2020
$db->query('CREATE TABLE pdofirebird_002 (idx INT NOT NULL PRIMARY KEY, name VARCHAR(20))');

ext/pdo_firebird/tests/testdb.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ function getDbConnection($class = PDO::class): PDO {
2121
return new $class(PDO_FIREBIRD_TEST_DSN, PDO_FIREBIRD_TEST_USER, PDO_FIREBIRD_TEST_PASS);
2222
}
2323

24-
function connectToDb(): PdoFirebird {
25-
return PdoFirebird::connect(PDO_FIREBIRD_TEST_DSN, PDO_FIREBIRD_TEST_USER, PDO_FIREBIRD_TEST_PASS);
24+
function connectToDb(): Pdo\Firebird {
25+
return Pdo\Firebird::connect(PDO_FIREBIRD_TEST_DSN, PDO_FIREBIRD_TEST_USER, PDO_FIREBIRD_TEST_PASS);
2626
}
2727

2828
?>

0 commit comments

Comments
 (0)