From aad9460e4d903b9dbabb6e3626988edcc399a145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Sun, 28 Apr 2024 20:02:06 +0200 Subject: [PATCH 1/2] Amend PDO driver-specific class names --- ext/pdo_dblib/pdo_dblib.c | 2 +- ext/pdo_dblib/pdo_dblib.stub.php | 4 +- ext/pdo_dblib/pdo_dblib_arginfo.h | 10 +-- ext/pdo_dblib/tests/pdodblib_001.phpt | 4 +- ext/pdo_dblib/tests/pdodblib_002.phpt | 6 +- ext/pdo_firebird/pdo_firebird.c | 2 +- ext/pdo_firebird/pdo_firebird.stub.php | 4 +- ext/pdo_firebird/pdo_firebird_arginfo.h | 10 +-- ext/pdo_firebird/tests/pdofirebird_002.phpt | 4 +- ext/pdo_firebird/tests/testdb.inc | 4 +- ext/pdo_mysql/pdo_mysql.c | 8 +-- ext/pdo_mysql/pdo_mysql.stub.php | 4 +- ext/pdo_mysql/pdo_mysql_arginfo.h | 16 ++--- ext/pdo_mysql/tests/pdomysql_001.phpt | 2 +- ext/pdo_mysql/tests/pdomysql_002.phpt | 4 +- ext/pdo_mysql/tests/pdomysql_003.phpt | 4 +- ext/pdo_odbc/pdo_odbc.c | 2 +- ext/pdo_odbc/pdo_odbc.stub.php | 46 ++++++------ ext/pdo_odbc/pdo_odbc_arginfo.h | 10 +-- ext/pdo_odbc/tests/pdoodbc_001.phpt | 2 +- ext/pdo_odbc/tests/pdoodbc_002.phpt | 6 +- ext/pdo_pgsql/pdo_pgsql.c | 22 +++--- ext/pdo_pgsql/pdo_pgsql.stub.php | 14 ++-- ext/pdo_pgsql/pdo_pgsql_arginfo.h | 72 +++++++++---------- ext/pdo_pgsql/tests/pdopgsql_001.phpt | 4 +- ext/pdo_pgsql/tests/pdopgsql_002.phpt | 6 +- ext/pdo_pgsql/tests/pdopgsql_003.phpt | 6 +- ext/pdo_sqlite/pdo_sqlite.c | 12 ++-- ext/pdo_sqlite/pdo_sqlite.stub.php | 6 +- ext/pdo_sqlite/pdo_sqlite_arginfo.h | 42 +++++------ ext/pdo_sqlite/tests/subclasses/gc.phpt | 4 +- .../subclasses/pdo_sqlite_constants.phpt | 14 ++-- ...pdo_sqlite_createafunction_trampoline.phpt | 4 +- .../pdo_sqlite_createaggregate.phpt | 2 +- .../pdo_sqlite_createaggregate_002.phpt | 6 +- ...pdo_sqlite_createaggregate_trampoline.phpt | 4 +- .../pdo_sqlite_createcollation.phpt | 2 +- ...pdo_sqlite_createcollation_trampoline.phpt | 4 +- .../pdo_sqlite_createfunction_with_flags.phpt | 4 +- .../tests/subclasses/pdosqlite_001.phpt | 6 +- .../tests/subclasses/pdosqlite_002.phpt | 8 +-- .../tests/subclasses/pdosqlite_003.phpt | 8 +-- .../subclasses/pdosqlite_004_blobopen.phpt | 6 +- .../tests/subclasses/pdosqlite_005.phpt | 4 +- .../tests/subclasses/pdosqlite_006.phpt | 2 +- .../tests/subclasses/pdosqlite_007.phpt | 2 +- .../pdosqlite_load_extension_failure.phpt | 10 +-- 47 files changed, 221 insertions(+), 207 deletions(-) diff --git a/ext/pdo_dblib/pdo_dblib.c b/ext/pdo_dblib/pdo_dblib.c index f4299cf517351..7a1586f8a5f2c 100644 --- a/ext/pdo_dblib/pdo_dblib.c +++ b/ext/pdo_dblib/pdo_dblib.c @@ -204,7 +204,7 @@ PHP_MINIT_FUNCTION(pdo_dblib) return FAILURE; } - PdoDblib_ce = register_class_PdoDblib(pdo_dbh_ce); + PdoDblib_ce = register_class_Pdo_Dblib(pdo_dbh_ce); PdoDblib_ce->create_object = pdo_dbh_new; if (FAILURE == php_pdo_register_driver(&pdo_dblib_driver)) { diff --git a/ext/pdo_dblib/pdo_dblib.stub.php b/ext/pdo_dblib/pdo_dblib.stub.php index 569a1b47b0166..b55b40e2e86b8 100644 --- a/ext/pdo_dblib/pdo_dblib.stub.php +++ b/ext/pdo_dblib/pdo_dblib.stub.php @@ -2,11 +2,13 @@ /** @generate-class-entries */ +namespace Pdo; + /** * @strict-properties * @not-serializable */ -class PdoDblib extends PDO +class Dblib extends PDO { /** @cvalue PDO_DBLIB_ATTR_CONNECTION_TIMEOUT */ public const int ATTR_CONNECTION_TIMEOUT = UNKNOWN; diff --git a/ext/pdo_dblib/pdo_dblib_arginfo.h b/ext/pdo_dblib/pdo_dblib_arginfo.h index 0ef182d8ebd2a..6cfb7af4247b7 100644 --- a/ext/pdo_dblib/pdo_dblib_arginfo.h +++ b/ext/pdo_dblib/pdo_dblib_arginfo.h @@ -1,16 +1,16 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: d2a7022c8e6e259b452786e00867b4a167d58277 */ + * Stub hash: 7589c5d95f17513e35fa7884cd0ac4c6df253d09 */ -static const zend_function_entry class_PdoDblib_methods[] = { +static const zend_function_entry class_Pdo_Dblib_methods[] = { ZEND_FE_END }; -static zend_class_entry *register_class_PdoDblib(zend_class_entry *class_entry_PDO) +static zend_class_entry *register_class_Pdo_Dblib(zend_class_entry *class_entry_Pdo_PDO) { zend_class_entry ce, *class_entry; - INIT_CLASS_ENTRY(ce, "PdoDblib", class_PdoDblib_methods); - class_entry = zend_register_internal_class_ex(&ce, class_entry_PDO); + INIT_NS_CLASS_ENTRY(ce, "Pdo", "Dblib", class_Pdo_Dblib_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Pdo_PDO); class_entry->ce_flags |= ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; zval const_ATTR_CONNECTION_TIMEOUT_value; diff --git a/ext/pdo_dblib/tests/pdodblib_001.phpt b/ext/pdo_dblib/tests/pdodblib_001.phpt index 63f8e40be45b7..e00b988562f6b 100644 --- a/ext/pdo_dblib/tests/pdodblib_001.phpt +++ b/ext/pdo_dblib/tests/pdodblib_001.phpt @@ -1,5 +1,5 @@ --TEST-- -PdoDblib basic +Pdo\Dblib basic --EXTENSIONS-- pdo_dblib --SKIPIF-- @@ -11,7 +11,7 @@ getDbConnection(); query("CREATE TABLE #pdo_dblib_001(name VARCHAR(32)); "); $db->query("INSERT INTO #pdo_dblib_001 VALUES('PHP'), ('PHP6');"); diff --git a/ext/pdo_dblib/tests/pdodblib_002.phpt b/ext/pdo_dblib/tests/pdodblib_002.phpt index 16e0444c11096..1a0b921c8bab8 100644 --- a/ext/pdo_dblib/tests/pdodblib_002.phpt +++ b/ext/pdo_dblib/tests/pdodblib_002.phpt @@ -1,5 +1,5 @@ --TEST-- -PdoDblib create through PDO::connect +Pdo\Dblib create through PDO::connect --EXTENSIONS-- pdo_dblib --SKIPIF-- @@ -13,8 +13,8 @@ getDbConnection(); require __DIR__ . '/config.inc'; $db = connectToDb(); -if (!$db instanceof PdoDblib) { - echo "Wrong class type. Should be PdoDblib but is " . get_class($db) . "\n"; +if (!$db instanceof Pdo\Dblib) { + echo "Wrong class type. Should be Pdo\Dblib but is " . get_class($db) . "\n"; } $db->query("CREATE TABLE #pdo_dblib_002(name VARCHAR(32))"); diff --git a/ext/pdo_firebird/pdo_firebird.c b/ext/pdo_firebird/pdo_firebird.c index 99fe6b57a1002..9f62e75eacc53 100644 --- a/ext/pdo_firebird/pdo_firebird.c +++ b/ext/pdo_firebird/pdo_firebird.c @@ -70,7 +70,7 @@ PHP_MINIT_FUNCTION(pdo_firebird) /* {{{ */ return FAILURE; } - PdoFirebird_ce = register_class_PdoFirebird(pdo_dbh_ce); + PdoFirebird_ce = register_class_Pdo_Firebird(pdo_dbh_ce); PdoFirebird_ce->create_object = pdo_dbh_new; #ifdef ZEND_SIGNALS diff --git a/ext/pdo_firebird/pdo_firebird.stub.php b/ext/pdo_firebird/pdo_firebird.stub.php index 85c4ab83433c3..080d566bed8aa 100644 --- a/ext/pdo_firebird/pdo_firebird.stub.php +++ b/ext/pdo_firebird/pdo_firebird.stub.php @@ -2,11 +2,13 @@ /** @generate-class-entries */ +namespace Pdo; + /** * @strict-properties * @not-serializable */ -class PdoFirebird extends PDO +class Firebird extends PDO { /** @cvalue PDO_FB_ATTR_DATE_FORMAT */ public const int ATTR_DATE_FORMAT = UNKNOWN; diff --git a/ext/pdo_firebird/pdo_firebird_arginfo.h b/ext/pdo_firebird/pdo_firebird_arginfo.h index 67d4d9a9b68ba..02e7dac15a5f7 100644 --- a/ext/pdo_firebird/pdo_firebird_arginfo.h +++ b/ext/pdo_firebird/pdo_firebird_arginfo.h @@ -1,16 +1,16 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 037c073de9e3e3593c62cb7da8ee7202c38c2723 */ + * Stub hash: 584b20b65c1ebccf82f894cb9e16ea76a2b1aa1e */ -static const zend_function_entry class_PdoFirebird_methods[] = { +static const zend_function_entry class_Pdo_Firebird_methods[] = { ZEND_FE_END }; -static zend_class_entry *register_class_PdoFirebird(zend_class_entry *class_entry_PDO) +static zend_class_entry *register_class_Pdo_Firebird(zend_class_entry *class_entry_Pdo_PDO) { zend_class_entry ce, *class_entry; - INIT_CLASS_ENTRY(ce, "PdoFirebird", class_PdoFirebird_methods); - class_entry = zend_register_internal_class_ex(&ce, class_entry_PDO); + INIT_NS_CLASS_ENTRY(ce, "Pdo", "Firebird", class_Pdo_Firebird_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Pdo_PDO); class_entry->ce_flags |= ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; zval const_ATTR_DATE_FORMAT_value; diff --git a/ext/pdo_firebird/tests/pdofirebird_002.phpt b/ext/pdo_firebird/tests/pdofirebird_002.phpt index 40f381f087d5d..09c8efa6aff27 100644 --- a/ext/pdo_firebird/tests/pdofirebird_002.phpt +++ b/ext/pdo_firebird/tests/pdofirebird_002.phpt @@ -13,8 +13,8 @@ See https://github.com/FirebirdSQL/firebird/issues/7849 require_once __DIR__ . "/testdb.inc"; $db = connectToDb(); -if (!$db instanceof PdoFirebird) { - echo "Wrong class type. Should be PdoFirebird but is " . get_class($db) . "\n"; +if (!$db instanceof Pdo\Firebird) { + echo "Wrong class type. Should be Pdo\Firebird but is " . get_class($db) . "\n"; } $db->query('CREATE TABLE pdofirebird_002 (idx INT NOT NULL PRIMARY KEY, name VARCHAR(20))'); diff --git a/ext/pdo_firebird/tests/testdb.inc b/ext/pdo_firebird/tests/testdb.inc index 0ccf9ab81d372..6be882297188b 100644 --- a/ext/pdo_firebird/tests/testdb.inc +++ b/ext/pdo_firebird/tests/testdb.inc @@ -21,8 +21,8 @@ function getDbConnection($class = PDO::class): PDO { return new $class(PDO_FIREBIRD_TEST_DSN, PDO_FIREBIRD_TEST_USER, PDO_FIREBIRD_TEST_PASS); } -function connectToDb(): PdoFirebird { - return PdoFirebird::connect(PDO_FIREBIRD_TEST_DSN, PDO_FIREBIRD_TEST_USER, PDO_FIREBIRD_TEST_PASS); +function connectToDb(): Pdo\Firebird { + return Pdo\Firebird::connect(PDO_FIREBIRD_TEST_DSN, PDO_FIREBIRD_TEST_USER, PDO_FIREBIRD_TEST_PASS); } ?> diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c index 291b60c59daba..469761abd92e0 100644 --- a/ext/pdo_mysql/pdo_mysql.c +++ b/ext/pdo_mysql/pdo_mysql.c @@ -84,10 +84,8 @@ static const MYSQLND_REVERSE_API pdo_mysql_reverse_api = { }; #endif -/* proto string PDO::mysqlGetWarningCount() - * Returns the number of SQL warnings during the execution of the last statement - */ -PHP_METHOD(PdoMysql, getWarningCount) +/* Returns the number of SQL warnings during the execution of the last statement */ +PHP_METHOD(Pdo_Mysql, getWarningCount) { pdo_dbh_t *dbh; pdo_mysql_db_handle *H; @@ -151,7 +149,7 @@ static PHP_MINIT_FUNCTION(pdo_mysql) mysqlnd_reverse_api_register_api(&pdo_mysql_reverse_api); #endif - pdo_mysql_ce = register_class_PdoMysql(pdo_dbh_ce); + pdo_mysql_ce = register_class_Pdo_Mysql(pdo_dbh_ce); pdo_mysql_ce->create_object = pdo_dbh_new; if (php_pdo_register_driver(&pdo_mysql_driver) == FAILURE) { diff --git a/ext/pdo_mysql/pdo_mysql.stub.php b/ext/pdo_mysql/pdo_mysql.stub.php index 39d07dccb1564..f658cf167f918 100644 --- a/ext/pdo_mysql/pdo_mysql.stub.php +++ b/ext/pdo_mysql/pdo_mysql.stub.php @@ -2,11 +2,13 @@ /** @generate-class-entries */ +namespace Pdo; + /** * @strict-properties * @not-serializable */ -class PdoMysql extends PDO +class Mysql extends PDO { /** @cvalue PDO_MYSQL_ATTR_USE_BUFFERED_QUERY */ public const int ATTR_USE_BUFFERED_QUERY = UNKNOWN; diff --git a/ext/pdo_mysql/pdo_mysql_arginfo.h b/ext/pdo_mysql/pdo_mysql_arginfo.h index dfecf642dc46b..24b020dbfe748 100644 --- a/ext/pdo_mysql/pdo_mysql_arginfo.h +++ b/ext/pdo_mysql/pdo_mysql_arginfo.h @@ -1,22 +1,22 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 015ebac642032d22ee5a8793993f84092bb6bf86 */ + * Stub hash: 065388b9ae5ffe9feb14fc4738ea5df66e0cf755 */ -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoMysql_getWarningCount, 0, 0, IS_LONG, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Mysql_getWarningCount, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_METHOD(PdoMysql, getWarningCount); +ZEND_METHOD(Pdo_Mysql, getWarningCount); -static const zend_function_entry class_PdoMysql_methods[] = { - ZEND_ME(PdoMysql, getWarningCount, arginfo_class_PdoMysql_getWarningCount, ZEND_ACC_PUBLIC) +static const zend_function_entry class_Pdo_Mysql_methods[] = { + ZEND_ME(Pdo_Mysql, getWarningCount, arginfo_class_Pdo_Mysql_getWarningCount, ZEND_ACC_PUBLIC) ZEND_FE_END }; -static zend_class_entry *register_class_PdoMysql(zend_class_entry *class_entry_PDO) +static zend_class_entry *register_class_Pdo_Mysql(zend_class_entry *class_entry_Pdo_PDO) { zend_class_entry ce, *class_entry; - INIT_CLASS_ENTRY(ce, "PdoMysql", class_PdoMysql_methods); - class_entry = zend_register_internal_class_ex(&ce, class_entry_PDO); + INIT_NS_CLASS_ENTRY(ce, "Pdo", "Mysql", class_Pdo_Mysql_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Pdo_PDO); class_entry->ce_flags |= ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; zval const_ATTR_USE_BUFFERED_QUERY_value; diff --git a/ext/pdo_mysql/tests/pdomysql_001.phpt b/ext/pdo_mysql/tests/pdomysql_001.phpt index 8f87760e5d42a..5cdf27c552359 100644 --- a/ext/pdo_mysql/tests/pdomysql_001.phpt +++ b/ext/pdo_mysql/tests/pdomysql_001.phpt @@ -12,7 +12,7 @@ MySQLPDOTest::skip(); require_once __DIR__ . '/inc/mysql_pdo_test.inc'; -$db = MySQLPDOTest::factory(PdoMysql::class); +$db = MySQLPDOTest::factory(Pdo\Mysql::class); $db->query('CREATE TABLE pdomysql_001 (id INT, name TEXT)'); diff --git a/ext/pdo_mysql/tests/pdomysql_002.phpt b/ext/pdo_mysql/tests/pdomysql_002.phpt index faa1c2d1712c8..2ede0eefaa116 100644 --- a/ext/pdo_mysql/tests/pdomysql_002.phpt +++ b/ext/pdo_mysql/tests/pdomysql_002.phpt @@ -13,8 +13,8 @@ MySQLPDOTest::skip(); require_once __DIR__ . '/inc/mysql_pdo_test.inc'; $db = Pdo::connect(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS); -if (!$db instanceof PdoMysql) { - echo "Wrong class type. Should be PdoMysql but is " . get_class($db) . "\n"; +if (!$db instanceof Pdo\Mysql) { + echo "Wrong class type. Should be Pdo\Mysql but is " . get_class($db) . "\n"; } $db->exec('CREATE TABLE pdomysql_002(id INT NOT NULL PRIMARY KEY, name VARCHAR(10))'); diff --git a/ext/pdo_mysql/tests/pdomysql_003.phpt b/ext/pdo_mysql/tests/pdomysql_003.phpt index 4ba538b969dd4..24d86b335c1ff 100644 --- a/ext/pdo_mysql/tests/pdomysql_003.phpt +++ b/ext/pdo_mysql/tests/pdomysql_003.phpt @@ -13,8 +13,8 @@ MySQLPDOTest::skip(); require_once __DIR__ . '/inc/mysql_pdo_test.inc'; $db = Pdo::connect(PDO_MYSQL_TEST_DSN, PDO_MYSQL_TEST_USER, PDO_MYSQL_TEST_PASS); -if (!$db instanceof PdoMysql) { - echo "Wrong class type. Should be PdoMysql but is " . get_class($db) . "\n"; +if (!$db instanceof Pdo\Mysql) { + echo "Wrong class type. Should be Pdo\Mysql but is " . get_class($db) . "\n"; } $assertWarnings = function ($db, $q, $count) { diff --git a/ext/pdo_odbc/pdo_odbc.c b/ext/pdo_odbc/pdo_odbc.c index b7081d5b693a1..675776fb90837 100644 --- a/ext/pdo_odbc/pdo_odbc.c +++ b/ext/pdo_odbc/pdo_odbc.c @@ -107,7 +107,7 @@ PHP_MINIT_FUNCTION(pdo_odbc) REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_DRIVER", SQL_CUR_USE_DRIVER); REGISTER_PDO_CLASS_CONST_LONG("ODBC_SQL_USE_ODBC", SQL_CUR_USE_ODBC); - pdo_odbc_ce = register_class_PdoOdbc(pdo_dbh_ce); + pdo_odbc_ce = register_class_Pdo_Odbc(pdo_dbh_ce); pdo_odbc_ce->create_object = pdo_dbh_new; return php_pdo_register_driver_specific_ce(&pdo_odbc_driver, pdo_odbc_ce); diff --git a/ext/pdo_odbc/pdo_odbc.stub.php b/ext/pdo_odbc/pdo_odbc.stub.php index c83d6f29f06f2..e49d353022e44 100644 --- a/ext/pdo_odbc/pdo_odbc.stub.php +++ b/ext/pdo_odbc/pdo_odbc.stub.php @@ -2,30 +2,34 @@ /** @generate-class-entries */ -/** - * @var string - * @cvalue PDO_ODBC_TYPE - */ -const PDO_ODBC_TYPE = UNKNOWN; +namespace { + /** + * @var string + * @cvalue PDO_ODBC_TYPE + */ + const PDO_ODBC_TYPE = UNKNOWN; +} -/** - * @strict-properties - * @not-serializable - */ -class PdoOdbc extends PDO -{ - /** @cvalue PDO_ODBC_ATTR_USE_CURSOR_LIBRARY */ - public const int ATTR_USE_CURSOR_LIBRARY = UNKNOWN; +namespace Pdo { + /** + * @strict-properties + * @not-serializable + */ + class Odbc extends PDO + { + /** @cvalue PDO_ODBC_ATTR_USE_CURSOR_LIBRARY */ + public const int ATTR_USE_CURSOR_LIBRARY = UNKNOWN; - /** @cvalue PDO_ODBC_ATTR_ASSUME_UTF8 */ - public const int ATTR_ASSUME_UTF8 = UNKNOWN; + /** @cvalue PDO_ODBC_ATTR_ASSUME_UTF8 */ + public const int ATTR_ASSUME_UTF8 = UNKNOWN; - /** @cvalue SQL_CUR_USE_IF_NEEDED */ - public const int SQL_USE_IF_NEEDED = UNKNOWN; + /** @cvalue SQL_CUR_USE_IF_NEEDED */ + public const int SQL_USE_IF_NEEDED = UNKNOWN; - /** @cvalue SQL_CUR_USE_DRIVER */ - public const int SQL_USE_DRIVER = UNKNOWN; + /** @cvalue SQL_CUR_USE_DRIVER */ + public const int SQL_USE_DRIVER = UNKNOWN; - /** @cvalue SQL_CUR_USE_ODBC */ - public const int SQL_USE_ODBC = UNKNOWN; + /** @cvalue SQL_CUR_USE_ODBC */ + public const int SQL_USE_ODBC = UNKNOWN; + } } diff --git a/ext/pdo_odbc/pdo_odbc_arginfo.h b/ext/pdo_odbc/pdo_odbc_arginfo.h index 15f581b2df02c..8882684b7293e 100644 --- a/ext/pdo_odbc/pdo_odbc_arginfo.h +++ b/ext/pdo_odbc/pdo_odbc_arginfo.h @@ -1,7 +1,7 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 3cc19acf5943c09a011f15d9ef6d0f443d4b8a71 */ + * Stub hash: 03226d99e04ac7db352bc8a9561826fa534c1fc7 */ -static const zend_function_entry class_PdoOdbc_methods[] = { +static const zend_function_entry class_Pdo_Odbc_methods[] = { ZEND_FE_END }; @@ -10,12 +10,12 @@ static void register_pdo_odbc_symbols(int module_number) REGISTER_STRING_CONSTANT("PDO_ODBC_TYPE", PDO_ODBC_TYPE, CONST_PERSISTENT); } -static zend_class_entry *register_class_PdoOdbc(zend_class_entry *class_entry_PDO) +static zend_class_entry *register_class_Pdo_Odbc(zend_class_entry *class_entry_Pdo_PDO) { zend_class_entry ce, *class_entry; - INIT_CLASS_ENTRY(ce, "PdoOdbc", class_PdoOdbc_methods); - class_entry = zend_register_internal_class_ex(&ce, class_entry_PDO); + INIT_NS_CLASS_ENTRY(ce, "Pdo", "Odbc", class_Pdo_Odbc_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Pdo_PDO); class_entry->ce_flags |= ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; zval const_ATTR_USE_CURSOR_LIBRARY_value; diff --git a/ext/pdo_odbc/tests/pdoodbc_001.phpt b/ext/pdo_odbc/tests/pdoodbc_001.phpt index 70985dcb6d3a3..a35db27b54f7e 100644 --- a/ext/pdo_odbc/tests/pdoodbc_001.phpt +++ b/ext/pdo_odbc/tests/pdoodbc_001.phpt @@ -12,7 +12,7 @@ PDOTest::skip(); require 'ext/pdo/tests/pdo_test.inc'; $config = PDOTest::get_config(__DIR__ . "/common.phpt"); -$db = new PdoOdbc($config['ENV']['PDOTEST_DSN'], $config['ENV']['PDOTEST_USER'], $config['ENV']['PDOTEST_PASS']); +$db = new Pdo\Odbc($config['ENV']['PDOTEST_DSN'], $config['ENV']['PDOTEST_USER'], $config['ENV']['PDOTEST_PASS']); $db->query("CREATE TABLE pdoodbc_001 (id INT, name TEXT)"); $db->query("INSERT INTO pdoodbc_001 VALUES (NULL, 'PHP'), (NULL, 'PHP6')"); diff --git a/ext/pdo_odbc/tests/pdoodbc_002.phpt b/ext/pdo_odbc/tests/pdoodbc_002.phpt index 02be07c560d7e..0731baef7bbcb 100644 --- a/ext/pdo_odbc/tests/pdoodbc_002.phpt +++ b/ext/pdo_odbc/tests/pdoodbc_002.phpt @@ -12,9 +12,9 @@ PDOTest::skip(); require 'ext/pdo/tests/pdo_test.inc'; $config = PDOTest::get_config(__DIR__ . "/common.phpt"); -$db = PdoOdbc::connect($config['ENV']['PDOTEST_DSN'], $config['ENV']['PDOTEST_USER'], $config['ENV']['PDOTEST_PASS']); -if (!$db instanceof PdoOdbc) { - echo "Wrong class type. Should be PdoOdbc but is " . get_class($db) . "\n"; +$db = Pdo\Odbc::connect($config['ENV']['PDOTEST_DSN'], $config['ENV']['PDOTEST_USER'], $config['ENV']['PDOTEST_PASS']); +if (!$db instanceof Pdo\Odbc) { + echo "Wrong class type. Should be Pdo\Odbc but is " . get_class($db) . "\n"; } $db->exec('CREATE TABLE pdoodbc_002(id INT NOT NULL PRIMARY KEY, name VARCHAR(10))'); diff --git a/ext/pdo_pgsql/pdo_pgsql.c b/ext/pdo_pgsql/pdo_pgsql.c index 9dd9b868554fd..d9858d7bebcea 100644 --- a/ext/pdo_pgsql/pdo_pgsql.c +++ b/ext/pdo_pgsql/pdo_pgsql.c @@ -58,7 +58,7 @@ ZEND_GET_MODULE(pdo_pgsql) #endif /* Escape an identifier for insertion into a text field */ -PHP_METHOD(PdoPgsql, escapeIdentifier) +PHP_METHOD(Pdo_Pgsql, escapeIdentifier) { zend_string *from = NULL; char *tmp; @@ -92,55 +92,55 @@ PHP_METHOD(PdoPgsql, escapeIdentifier) } /* Returns true if the copy worked fine or false if error */ -PHP_METHOD(PdoPgsql, copyFromArray) +PHP_METHOD(Pdo_Pgsql, copyFromArray) { pgsqlCopyFromArray_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Returns true if the copy worked fine or false if error */ -PHP_METHOD(PdoPgsql, copyFromFile) +PHP_METHOD(Pdo_Pgsql, copyFromFile) { pgsqlCopyFromFile_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Returns true if the copy worked fine or false if error */ -PHP_METHOD(PdoPgsql, copyToFile) +PHP_METHOD(Pdo_Pgsql, copyToFile) { pgsqlCopyToFile_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Returns true if the copy worked fine or false if error */ -PHP_METHOD(PdoPgsql, copyToArray) +PHP_METHOD(Pdo_Pgsql, copyToArray) { pgsqlCopyToArray_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Creates a new large object, returning its identifier. Must be called inside a transaction. */ -PHP_METHOD(PdoPgsql, lobCreate) +PHP_METHOD(Pdo_Pgsql, lobCreate) { pgsqlLOBCreate_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Opens an existing large object stream. Must be called inside a transaction. */ -PHP_METHOD(PdoPgsql, lobOpen) +PHP_METHOD(Pdo_Pgsql, lobOpen) { pgsqlLOBOpen_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Deletes the large object identified by oid. Must be called inside a transaction. */ -PHP_METHOD(PdoPgsql, lobUnlink) +PHP_METHOD(Pdo_Pgsql, lobUnlink) { pgsqlLOBUnlink_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Get asynchronous notification */ -PHP_METHOD(PdoPgsql, getNotify) +PHP_METHOD(Pdo_Pgsql, getNotify) { pgsqlGetNotify_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } /* Get backend(server) pid */ -PHP_METHOD(PdoPgsql, getPid) +PHP_METHOD(Pdo_Pgsql, getPid) { pgsqlGetPid_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } @@ -160,7 +160,7 @@ PHP_MINIT_FUNCTION(pdo_pgsql) REGISTER_PDO_CLASS_CONST_LONG("PGSQL_ATTR_RESULT_MEMORY_SIZE", (zend_long)PDO_PGSQL_ATTR_RESULT_MEMORY_SIZE); #endif - PdoPgsql_ce = register_class_PdoPgsql(pdo_dbh_ce); + PdoPgsql_ce = register_class_Pdo_Pgsql(pdo_dbh_ce); PdoPgsql_ce->create_object = pdo_dbh_new; if (php_pdo_register_driver(&pdo_pgsql_driver) == FAILURE) { diff --git a/ext/pdo_pgsql/pdo_pgsql.stub.php b/ext/pdo_pgsql/pdo_pgsql.stub.php index eb0e3d6efd685..f203d3e82c3e4 100644 --- a/ext/pdo_pgsql/pdo_pgsql.stub.php +++ b/ext/pdo_pgsql/pdo_pgsql.stub.php @@ -2,11 +2,13 @@ /** @generate-class-entries */ +namespace Pdo; + /** * @strict-properties * @not-serializable */ -class PdoPgsql extends PDO +class Pgsql extends PDO { /** @cvalue PDO_PGSQL_ATTR_DISABLE_PREPARES */ public const int ATTR_DISABLE_PREPARES = UNKNOWN; @@ -43,13 +45,15 @@ public function copyToFile(string $tableName, string $filename, string $separato public function lobCreate(): string|false {} - // Opens an existing large object stream. Must be called inside a transaction. - /** @return resource|false */ - public function lobOpen(string $oid, string $mode = "rb"){} + /** + * Opens an existing large object stream. Must be called inside a transaction. + * @return resource|false + */ + public function lobOpen(string $oid, string $mode = "rb") {} public function lobUnlink(string $oid): bool {} - public function getNotify(int $fetchMode = PDO::FETCH_DEFAULT, int $timeoutMilliseconds = 0): array|false {} + public function getNotify(int $fetchMode = \PDO::FETCH_DEFAULT, int $timeoutMilliseconds = 0): array|false {} public function getPid(): int {} } diff --git a/ext/pdo_pgsql/pdo_pgsql_arginfo.h b/ext/pdo_pgsql/pdo_pgsql_arginfo.h index 04e1441b4b6d3..8b2abce3f75e2 100644 --- a/ext/pdo_pgsql/pdo_pgsql_arginfo.h +++ b/ext/pdo_pgsql/pdo_pgsql_arginfo.h @@ -1,11 +1,11 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 57eb44ac4546230b33165b7226b05d006b651e46 */ + * Stub hash: 519530b2da60dbd7a70af6d7c566d93930cfbb24 */ -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoPgsql_escapeIdentifier, 0, 1, IS_STRING, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Pgsql_escapeIdentifier, 0, 1, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, input, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoPgsql_copyFromArray, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Pgsql_copyFromArray, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, rows, IS_ARRAY, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\t\"") @@ -13,7 +13,7 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoPgsql_copyFromArray, 0, ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fields, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoPgsql_copyFromFile, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Pgsql_copyFromFile, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, filename, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\t\"") @@ -21,66 +21,66 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoPgsql_copyFromFile, 0, ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fields, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_PdoPgsql_copyToArray, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Pdo_Pgsql_copyToArray, 0, 1, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO(0, tableName, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, separator, IS_STRING, 0, "\"\\t\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, nullAs, IS_STRING, 0, "\"\\\\\\\\N\"") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fields, IS_STRING, 1, "null") ZEND_END_ARG_INFO() -#define arginfo_class_PdoPgsql_copyToFile arginfo_class_PdoPgsql_copyFromFile +#define arginfo_class_Pdo_Pgsql_copyToFile arginfo_class_Pdo_Pgsql_copyFromFile -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_PdoPgsql_lobCreate, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Pdo_Pgsql_lobCreate, 0, 0, MAY_BE_STRING|MAY_BE_FALSE) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PdoPgsql_lobOpen, 0, 0, 1) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Pdo_Pgsql_lobOpen, 0, 0, 1) ZEND_ARG_TYPE_INFO(0, oid, IS_STRING, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, mode, IS_STRING, 0, "\"rb\"") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoPgsql_lobUnlink, 0, 1, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Pgsql_lobUnlink, 0, 1, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, oid, IS_STRING, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_PdoPgsql_getNotify, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_MASK_EX(arginfo_class_Pdo_Pgsql_getNotify, 0, 0, MAY_BE_ARRAY|MAY_BE_FALSE) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, fetchMode, IS_LONG, 0, "PDO::FETCH_DEFAULT") ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, timeoutMilliseconds, IS_LONG, 0, "0") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoPgsql_getPid, 0, 0, IS_LONG, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Pgsql_getPid, 0, 0, IS_LONG, 0) ZEND_END_ARG_INFO() -ZEND_METHOD(PdoPgsql, escapeIdentifier); -ZEND_METHOD(PdoPgsql, copyFromArray); -ZEND_METHOD(PdoPgsql, copyFromFile); -ZEND_METHOD(PdoPgsql, copyToArray); -ZEND_METHOD(PdoPgsql, copyToFile); -ZEND_METHOD(PdoPgsql, lobCreate); -ZEND_METHOD(PdoPgsql, lobOpen); -ZEND_METHOD(PdoPgsql, lobUnlink); -ZEND_METHOD(PdoPgsql, getNotify); -ZEND_METHOD(PdoPgsql, getPid); - -static const zend_function_entry class_PdoPgsql_methods[] = { - ZEND_ME(PdoPgsql, escapeIdentifier, arginfo_class_PdoPgsql_escapeIdentifier, ZEND_ACC_PUBLIC) - ZEND_ME(PdoPgsql, copyFromArray, arginfo_class_PdoPgsql_copyFromArray, ZEND_ACC_PUBLIC) - ZEND_ME(PdoPgsql, copyFromFile, arginfo_class_PdoPgsql_copyFromFile, ZEND_ACC_PUBLIC) - ZEND_ME(PdoPgsql, copyToArray, arginfo_class_PdoPgsql_copyToArray, ZEND_ACC_PUBLIC) - ZEND_ME(PdoPgsql, copyToFile, arginfo_class_PdoPgsql_copyToFile, ZEND_ACC_PUBLIC) - ZEND_ME(PdoPgsql, lobCreate, arginfo_class_PdoPgsql_lobCreate, ZEND_ACC_PUBLIC) - ZEND_ME(PdoPgsql, lobOpen, arginfo_class_PdoPgsql_lobOpen, ZEND_ACC_PUBLIC) - ZEND_ME(PdoPgsql, lobUnlink, arginfo_class_PdoPgsql_lobUnlink, ZEND_ACC_PUBLIC) - ZEND_ME(PdoPgsql, getNotify, arginfo_class_PdoPgsql_getNotify, ZEND_ACC_PUBLIC) - ZEND_ME(PdoPgsql, getPid, arginfo_class_PdoPgsql_getPid, ZEND_ACC_PUBLIC) +ZEND_METHOD(Pdo_Pgsql, escapeIdentifier); +ZEND_METHOD(Pdo_Pgsql, copyFromArray); +ZEND_METHOD(Pdo_Pgsql, copyFromFile); +ZEND_METHOD(Pdo_Pgsql, copyToArray); +ZEND_METHOD(Pdo_Pgsql, copyToFile); +ZEND_METHOD(Pdo_Pgsql, lobCreate); +ZEND_METHOD(Pdo_Pgsql, lobOpen); +ZEND_METHOD(Pdo_Pgsql, lobUnlink); +ZEND_METHOD(Pdo_Pgsql, getNotify); +ZEND_METHOD(Pdo_Pgsql, getPid); + +static const zend_function_entry class_Pdo_Pgsql_methods[] = { + ZEND_ME(Pdo_Pgsql, escapeIdentifier, arginfo_class_Pdo_Pgsql_escapeIdentifier, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Pgsql, copyFromArray, arginfo_class_Pdo_Pgsql_copyFromArray, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Pgsql, copyFromFile, arginfo_class_Pdo_Pgsql_copyFromFile, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Pgsql, copyToArray, arginfo_class_Pdo_Pgsql_copyToArray, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Pgsql, copyToFile, arginfo_class_Pdo_Pgsql_copyToFile, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Pgsql, lobCreate, arginfo_class_Pdo_Pgsql_lobCreate, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Pgsql, lobOpen, arginfo_class_Pdo_Pgsql_lobOpen, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Pgsql, lobUnlink, arginfo_class_Pdo_Pgsql_lobUnlink, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Pgsql, getNotify, arginfo_class_Pdo_Pgsql_getNotify, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Pgsql, getPid, arginfo_class_Pdo_Pgsql_getPid, ZEND_ACC_PUBLIC) ZEND_FE_END }; -static zend_class_entry *register_class_PdoPgsql(zend_class_entry *class_entry_PDO) +static zend_class_entry *register_class_Pdo_Pgsql(zend_class_entry *class_entry_Pdo_PDO) { zend_class_entry ce, *class_entry; - INIT_CLASS_ENTRY(ce, "PdoPgsql", class_PdoPgsql_methods); - class_entry = zend_register_internal_class_ex(&ce, class_entry_PDO); + INIT_NS_CLASS_ENTRY(ce, "Pdo", "Pgsql", class_Pdo_Pgsql_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Pdo_PDO); class_entry->ce_flags |= ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; zval const_ATTR_DISABLE_PREPARES_value; diff --git a/ext/pdo_pgsql/tests/pdopgsql_001.phpt b/ext/pdo_pgsql/tests/pdopgsql_001.phpt index 524b4ad093e08..7e6971238152e 100644 --- a/ext/pdo_pgsql/tests/pdopgsql_001.phpt +++ b/ext/pdo_pgsql/tests/pdopgsql_001.phpt @@ -1,5 +1,5 @@ --TEST-- -PdoPgsql subclass basic +Pdo\Pgsql subclass basic --EXTENSIONS-- pdo pdo_pgsql @@ -14,7 +14,7 @@ PDOTest::skip(); require_once __DIR__ . "/config.inc"; -$db = new PdoPgsql($config['ENV']['PDOTEST_DSN']); +$db = new Pdo\Pgsql($config['ENV']['PDOTEST_DSN']); $db->query('CREATE TABLE pdopgsql_001 (id INT, name TEXT)'); $db->query("INSERT INTO pdopgsql_001 VALUES (NULL, 'PHP'), (NULL, 'PHP6')"); diff --git a/ext/pdo_pgsql/tests/pdopgsql_002.phpt b/ext/pdo_pgsql/tests/pdopgsql_002.phpt index 036b4649d202f..9280f18d1c0ab 100644 --- a/ext/pdo_pgsql/tests/pdopgsql_002.phpt +++ b/ext/pdo_pgsql/tests/pdopgsql_002.phpt @@ -1,5 +1,5 @@ --TEST-- -PdoPgsql connect through PDO::connect +Pdo\Pgsql connect through PDO::connect --EXTENSIONS-- pdo pdo_pgsql @@ -15,8 +15,8 @@ PDOTest::skip(); require_once __DIR__ . "/config.inc"; $db = Pdo::connect($config['ENV']['PDOTEST_DSN']); -if (!$db instanceof PdoPgsql) { - echo "Wrong class type. Should be PdoPgsql but is " . get_class($db) . "\n"; +if (!$db instanceof Pdo\Pgsql) { + echo "Wrong class type. Should be Pdo\Pgsql but is " . get_class($db) . "\n"; } $db->exec('CREATE TABLE pdopgsql_002(id INT NOT NULL PRIMARY KEY, name VARCHAR(10))'); diff --git a/ext/pdo_pgsql/tests/pdopgsql_003.phpt b/ext/pdo_pgsql/tests/pdopgsql_003.phpt index 15b922dd3c0be..378a15c86da99 100644 --- a/ext/pdo_pgsql/tests/pdopgsql_003.phpt +++ b/ext/pdo_pgsql/tests/pdopgsql_003.phpt @@ -1,5 +1,5 @@ --TEST-- -PdoPgsql getWarningCount +Pdo\Pgsql getWarningCount --EXTENSIONS-- pdo pdo_pgsql @@ -15,8 +15,8 @@ PDOTest::skip(); require_once __DIR__ . "/config.inc"; $db = Pdo::connect($config['ENV']['PDOTEST_DSN']); -if (!$db instanceof PdoPgsql) { - echo "Wrong class type. Should be PdoPgsql but is " . get_class($db) . "\n"; +if (!$db instanceof Pdo\Pgsql) { + echo "Wrong class type. Should be Pdo\Pgsql but is " . get_class($db) . "\n"; } echo $db->escapeIdentifier("This is a quote\"") . "\n"; diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c index 487fa6b4c35d6..852f0310f7501 100644 --- a/ext/pdo_sqlite/pdo_sqlite.c +++ b/ext/pdo_sqlite/pdo_sqlite.c @@ -61,14 +61,14 @@ ZEND_GET_MODULE(pdo_sqlite) /* proto bool PdoSqlite::createFunction(string $function_name, callable $callback, int $num_args = -1, int $flags = 0) Creates a function that can be used in a query */ -PHP_METHOD(PdoSqlite, createFunction) +PHP_METHOD(Pdo_Sqlite, createFunction) { pdo_sqlite_create_function_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } #ifndef PDO_SQLITE_OMIT_LOAD_EXTENSION /* Attempts to load an SQLite extension library. */ -PHP_METHOD(PdoSqlite, loadExtension) +PHP_METHOD(Pdo_Sqlite, loadExtension) { char *extension, *errtext = NULL; char fullpath[MAXPATHLEN]; @@ -284,7 +284,7 @@ static const php_stream_ops php_stream_pdosqlite3_ops = { }; /* Open a blob as a stream which we can read / write to. */ -PHP_METHOD(PdoSqlite, openBlob) +PHP_METHOD(Pdo_Sqlite, openBlob) { char *table, *column, *dbname = "main", *mode = "rb"; size_t table_len, column_len, dbname_len; @@ -368,12 +368,12 @@ static int php_sqlite_collation_callback(void *context, int string1_len, const v return ret; } -PHP_METHOD(PdoSqlite, createAggregate) +PHP_METHOD(Pdo_Sqlite, createAggregate) { pdo_sqlite_create_aggregate_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU); } -PHP_METHOD(PdoSqlite, createCollation) +PHP_METHOD(Pdo_Sqlite, createCollation) { pdo_sqlite_create_collation_internal(INTERNAL_FUNCTION_PARAM_PASSTHRU, php_sqlite_collation_callback); } @@ -392,7 +392,7 @@ PHP_MINIT_FUNCTION(pdo_sqlite) REGISTER_PDO_CLASS_CONST_LONG("SQLITE_ATTR_READONLY_STATEMENT", (zend_long)PDO_SQLITE_ATTR_READONLY_STATEMENT); REGISTER_PDO_CLASS_CONST_LONG("SQLITE_ATTR_EXTENDED_RESULT_CODES", (zend_long)PDO_SQLITE_ATTR_EXTENDED_RESULT_CODES); - pdosqlite_ce = register_class_PdoSqlite(pdo_dbh_ce); + pdosqlite_ce = register_class_Pdo_Sqlite(pdo_dbh_ce); pdosqlite_ce->create_object = pdo_dbh_new; if (php_pdo_register_driver(&pdo_sqlite_driver) == FAILURE) { diff --git a/ext/pdo_sqlite/pdo_sqlite.stub.php b/ext/pdo_sqlite/pdo_sqlite.stub.php index 5e46b393cca37..3eccde1678eba 100644 --- a/ext/pdo_sqlite/pdo_sqlite.stub.php +++ b/ext/pdo_sqlite/pdo_sqlite.stub.php @@ -2,11 +2,13 @@ /** @generate-class-entries */ +namespace Pdo; + /** * @strict-properties * @not-serializable */ -class PdoSqlite extends PDO +class Sqlite extends PDO { #ifdef SQLITE_DETERMINISTIC /** @cvalue SQLITE_DETERMINISTIC */ @@ -62,6 +64,6 @@ public function openBlob( string $column, int $rowid, ?string $dbname = "main", - int $flags = PdoSqlite::OPEN_READONLY + int $flags = \Pdo\Sqlite::OPEN_READONLY ) {} } diff --git a/ext/pdo_sqlite/pdo_sqlite_arginfo.h b/ext/pdo_sqlite/pdo_sqlite_arginfo.h index 0b9b3390ec55e..6569c58101b3c 100644 --- a/ext/pdo_sqlite/pdo_sqlite_arginfo.h +++ b/ext/pdo_sqlite/pdo_sqlite_arginfo.h @@ -1,19 +1,19 @@ /* This is a generated file, edit the .stub.php file instead. - * Stub hash: 167d0e30af99bd31c46ea1649c661b6aa38eaccb */ + * Stub hash: 89e215924e6e1041d1ddfca6717e4ad2219d0199 */ -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoSqlite_createAggregate, 0, 3, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Sqlite_createAggregate, 0, 3, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, step, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO(0, finalize, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, numArgs, IS_LONG, 0, "-1") ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoSqlite_createCollation, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Sqlite_createCollation, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_END_ARG_INFO() -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoSqlite_createFunction, 0, 2, _IS_BOOL, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Sqlite_createFunction, 0, 2, _IS_BOOL, 0) ZEND_ARG_TYPE_INFO(0, function_name, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, callback, IS_CALLABLE, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, num_args, IS_LONG, 0, "-1") @@ -21,44 +21,44 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoSqlite_createFunction, ZEND_END_ARG_INFO() #if !defined(PDO_SQLITE_OMIT_LOAD_EXTENSION) -ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_PdoSqlite_loadExtension, 0, 1, IS_VOID, 0) +ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_class_Pdo_Sqlite_loadExtension, 0, 1, IS_VOID, 0) ZEND_ARG_TYPE_INFO(0, name, IS_STRING, 0) ZEND_END_ARG_INFO() #endif -ZEND_BEGIN_ARG_INFO_EX(arginfo_class_PdoSqlite_openBlob, 0, 0, 3) +ZEND_BEGIN_ARG_INFO_EX(arginfo_class_Pdo_Sqlite_openBlob, 0, 0, 3) ZEND_ARG_TYPE_INFO(0, table, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, column, IS_STRING, 0) ZEND_ARG_TYPE_INFO(0, rowid, IS_LONG, 0) ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, dbname, IS_STRING, 1, "\"main\"") - ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "PdoSqlite::OPEN_READONLY") + ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, flags, IS_LONG, 0, "Pdo\\Sqlite::OPEN_READONLY") ZEND_END_ARG_INFO() -ZEND_METHOD(PdoSqlite, createAggregate); -ZEND_METHOD(PdoSqlite, createCollation); -ZEND_METHOD(PdoSqlite, createFunction); +ZEND_METHOD(Pdo_Sqlite, createAggregate); +ZEND_METHOD(Pdo_Sqlite, createCollation); +ZEND_METHOD(Pdo_Sqlite, createFunction); #if !defined(PDO_SQLITE_OMIT_LOAD_EXTENSION) -ZEND_METHOD(PdoSqlite, loadExtension); +ZEND_METHOD(Pdo_Sqlite, loadExtension); #endif -ZEND_METHOD(PdoSqlite, openBlob); +ZEND_METHOD(Pdo_Sqlite, openBlob); -static const zend_function_entry class_PdoSqlite_methods[] = { - ZEND_ME(PdoSqlite, createAggregate, arginfo_class_PdoSqlite_createAggregate, ZEND_ACC_PUBLIC) - ZEND_ME(PdoSqlite, createCollation, arginfo_class_PdoSqlite_createCollation, ZEND_ACC_PUBLIC) - ZEND_ME(PdoSqlite, createFunction, arginfo_class_PdoSqlite_createFunction, ZEND_ACC_PUBLIC) +static const zend_function_entry class_Pdo_Sqlite_methods[] = { + ZEND_ME(Pdo_Sqlite, createAggregate, arginfo_class_Pdo_Sqlite_createAggregate, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Sqlite, createCollation, arginfo_class_Pdo_Sqlite_createCollation, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Sqlite, createFunction, arginfo_class_Pdo_Sqlite_createFunction, ZEND_ACC_PUBLIC) #if !defined(PDO_SQLITE_OMIT_LOAD_EXTENSION) - ZEND_ME(PdoSqlite, loadExtension, arginfo_class_PdoSqlite_loadExtension, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Sqlite, loadExtension, arginfo_class_Pdo_Sqlite_loadExtension, ZEND_ACC_PUBLIC) #endif - ZEND_ME(PdoSqlite, openBlob, arginfo_class_PdoSqlite_openBlob, ZEND_ACC_PUBLIC) + ZEND_ME(Pdo_Sqlite, openBlob, arginfo_class_Pdo_Sqlite_openBlob, ZEND_ACC_PUBLIC) ZEND_FE_END }; -static zend_class_entry *register_class_PdoSqlite(zend_class_entry *class_entry_PDO) +static zend_class_entry *register_class_Pdo_Sqlite(zend_class_entry *class_entry_Pdo_PDO) { zend_class_entry ce, *class_entry; - INIT_CLASS_ENTRY(ce, "PdoSqlite", class_PdoSqlite_methods); - class_entry = zend_register_internal_class_ex(&ce, class_entry_PDO); + INIT_NS_CLASS_ENTRY(ce, "Pdo", "Sqlite", class_Pdo_Sqlite_methods); + class_entry = zend_register_internal_class_ex(&ce, class_entry_Pdo_PDO); class_entry->ce_flags |= ZEND_ACC_NO_DYNAMIC_PROPERTIES|ZEND_ACC_NOT_SERIALIZABLE; #if defined(SQLITE_DETERMINISTIC) diff --git a/ext/pdo_sqlite/tests/subclasses/gc.phpt b/ext/pdo_sqlite/tests/subclasses/gc.phpt index 493cdfc1c307a..5975dca32fd8f 100644 --- a/ext/pdo_sqlite/tests/subclasses/gc.phpt +++ b/ext/pdo_sqlite/tests/subclasses/gc.phpt @@ -14,8 +14,8 @@ class Obj { $obj = new Obj; $obj->a = Pdo::connect('sqlite::memory:'); -if (!$obj->a instanceof PdoSqlite) { - echo "Wrong class type. Should be PdoSqlite but is " . get_class($obj->a) . "]\n"; +if (!$obj->a instanceof Pdo\Sqlite) { + echo "Wrong class type. Should be Pdo\Sqlite but is " . get_class($obj->a) . "]\n"; } $obj->a->createFunction('func1', function() use ($obj) {}, 1); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_constants.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_constants.phpt index da48a02c7cfe8..243240bef4662 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_constants.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_constants.phpt @@ -6,13 +6,13 @@ pdo_sqlite --EXPECTF-- diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_trampoline.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_trampoline.phpt index 29eac9fae0ad6..adcb130e0b9c1 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_trampoline.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_trampoline.phpt @@ -1,11 +1,11 @@ --TEST-- -Test PdoSqlite::createFunction() trampoline callback +Test Pdo\Sqlite::createFunction() trampoline callback --EXTENSIONS-- pdo_sqlite --FILE-- query('CREATE TABLE test_pdo_sqlite_createaggregate_trampoline (a INTEGER, b INTEGER)'); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate.phpt index 67ae3660e0688..1f96da8e1fa32 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate.phpt @@ -6,7 +6,7 @@ pdo_sqlite query('CREATE TABLE test_pdo_sqlite_createaggregate (id INT AUTO INCREMENT, name TEXT)'); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_002.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_002.phpt index e4152c06e81e8..3419f55480572 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_002.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_002.phpt @@ -6,7 +6,7 @@ pdo_sqlite createAggregate('foo', 'a', ''); @@ -21,5 +21,5 @@ try { ?> --EXPECT-- -PdoSqlite::createAggregate(): Argument #2 ($step) must be a valid callback, function "a" not found or invalid function name -PdoSqlite::createAggregate(): Argument #3 ($finalize) must be a valid callback, function "" not found or invalid function name +Pdo\Sqlite::createAggregate(): Argument #2 ($step) must be a valid callback, function "a" not found or invalid function name +Pdo\Sqlite::createAggregate(): Argument #3 ($finalize) must be a valid callback, function "" not found or invalid function name diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_trampoline.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_trampoline.phpt index 0381f428e33c9..e0a8c99b7a406 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_trampoline.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_trampoline.phpt @@ -1,11 +1,11 @@ --TEST-- -Test PdoSqlite::createAggregate() trampoline callback +Test Pdo\Sqlite::createAggregate() trampoline callback --EXTENSIONS-- pdo_sqlite --FILE-- query('CREATE TABLE test_pdo_sqlite_createaggregate_trampoline (a INTEGER, b INTEGER)'); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation.phpt index e65afd4ad910c..d043dda7a526e 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation.phpt @@ -6,7 +6,7 @@ pdo_sqlite setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); $db->query('CREATE TABLE test_pdo_sqlite_createcollation (id INT AUTO INCREMENT, name TEXT)'); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_trampoline.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_trampoline.phpt index 257c2f788b5fd..1635fd7007711 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_trampoline.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_trampoline.phpt @@ -1,11 +1,11 @@ --TEST-- -Test PdoSqlite::createCollation() trampoline callback +Test Pdo\Sqlite::createCollation() trampoline callback --EXTENSIONS-- pdo_sqlite --FILE-- query('CREATE TABLE test_pdo_sqlite_createcollation_trampoline (s VARCHAR(4))'); diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createfunction_with_flags.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createfunction_with_flags.phpt index c25801deb5900..838e2b9bd49b0 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createfunction_with_flags.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createfunction_with_flags.phpt @@ -9,11 +9,11 @@ if (!defined('PDO::SQLITE_DETERMINISTIC')) die('skip system sqlite is too old'); --FILE-- query('CREATE TABLE test_pdo_sqlite_createfunction_with_flags (id INT AUTO INCREMENT, name TEXT)'); $db->query('INSERT INTO test_pdo_sqlite_createfunction_with_flags VALUES (NULL, "PHP"), (NULL, "PHP6")'); -$db->createFunction('testing', function($v) { return strtolower($v); }, 1, PdoSqlite::DETERMINISTIC); +$db->createFunction('testing', function($v) { return strtolower($v); }, 1, Pdo\Sqlite::DETERMINISTIC); foreach ($db->query('SELECT testing(name) FROM test_pdo_sqlite_createfunction_with_flags') as $row) { var_dump($row); diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_001.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_001.phpt index 26b234c4ee967..ea88a6316b645 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_001.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_001.phpt @@ -1,18 +1,18 @@ --TEST-- -PdoSqlite basic +Pdo\Sqlite basic --EXTENSIONS-- pdo_sqlite --FILE-- query('CREATE TABLE pdosqlite_001 (id INT AUTO INCREMENT, name TEXT)'); $db->query('INSERT INTO pdosqlite_001 VALUES (NULL, "PHP")'); $db->query('INSERT INTO pdosqlite_001 VALUES (NULL, "PHP6")'); -$db->createFunction('testing', function($v) { return strtolower($v); }, 1, PdoSqlite::DETERMINISTIC); +$db->createFunction('testing', function($v) { return strtolower($v); }, 1, Pdo\Sqlite::DETERMINISTIC); foreach ($db->query('SELECT testing(name) FROM pdosqlite_001') as $row) { var_dump($row); diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_002.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_002.phpt index 61c4dd6d31839..28534f4a2365c 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_002.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_002.phpt @@ -1,20 +1,20 @@ --TEST-- -PdoSqlite create through PDO::connect and function define. +Pdo\Sqlite create through PDO::connect and function define. --EXTENSIONS-- pdo_sqlite --FILE-- query('CREATE TABLE pdosqlite_002 (id INT AUTO INCREMENT, name TEXT)'); $db->query('INSERT INTO pdosqlite_002 VALUES (NULL, "PHP")'); $db->query('INSERT INTO pdosqlite_002 VALUES (NULL, "PHP6")'); -$db->createFunction('testing', function($v) { return strtolower($v); }, 1, PdoSqlite::DETERMINISTIC); +$db->createFunction('testing', function($v) { return strtolower($v); }, 1, Pdo\Sqlite::DETERMINISTIC); foreach ($db->query('SELECT testing(name) FROM pdosqlite_002') as $row) { var_dump($row); diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_003.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_003.phpt index 147999ae73bd4..87e160089a38d 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_003.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_003.phpt @@ -1,10 +1,10 @@ --TEST-- -PdoSqlite load extension +Pdo\Sqlite load extension --EXTENSIONS-- pdo_sqlite --SKIPIF-- loadExtension(getSpatialiteExtensionLocation()); diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_004_blobopen.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_004_blobopen.phpt index a2b0b7b4fb861..dd1fde3cffcfe 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_004_blobopen.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_004_blobopen.phpt @@ -1,11 +1,11 @@ --TEST-- -PdoSqlite::blobOpen stream test +Pdo\Sqlite::blobOpen stream test --EXTENSIONS-- pdo_sqlite --FILE-- openBlob('test', 'data', 1, 'main', PdoSqlite::OPEN_READWRITE); +$stream = $db->openBlob('test', 'data', 1, 'main', Pdo\Sqlite::OPEN_READWRITE); var_dump($stream); echo "Writing to blob\n"; var_dump(fwrite($stream, 'ABCD')); diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_005.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_005.phpt index 29cfc2e175035..3674c2b342239 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_005.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_005.phpt @@ -7,11 +7,11 @@ pdo_sqlite getMessage() . "\n"; } ?> --EXPECT-- -PdoPgsql::connect() cannot be called when connecting to the "sqlite" driver, either PdoSqlite::connect() or PDO::connect() must be called instead +Pdo\Pgsql::connect() cannot be called when connecting to the "sqlite" driver, either Pdo\Sqlite::connect() or PDO::connect() must be called instead diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_006.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_006.phpt index 1095b9a372d02..27ad6d1c35cea 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_006.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_006.phpt @@ -5,7 +5,7 @@ pdo_sqlite --FILE-- --EXPECT-- -MyPDO::connect() cannot be called when connecting to the "sqlite" driver, either PdoSqlite::connect() or PDO::connect() must be called instead +MyPDO::connect() cannot be called when connecting to the "sqlite" driver, either Pdo\Sqlite::connect() or PDO::connect() must be called instead diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_load_extension_failure.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_load_extension_failure.phpt index 8a3abf66dcf15..75f3de6b581a1 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_load_extension_failure.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_load_extension_failure.phpt @@ -1,19 +1,19 @@ --TEST-- -PdoSqlite load extension +Pdo\Sqlite load extension --EXTENSIONS-- pdo_sqlite --SKIPIF-- --FILE-- Date: Thu, 30 May 2024 19:17:38 +0200 Subject: [PATCH 2/2] Fix newly added tests --- .../pdo_sqlite_createafunction_arg_error.phpt | 12 ++++++------ .../pdo_sqlite_createaggregate_arg_error.phpt | 16 ++++++++-------- .../pdo_sqlite_createcollation_arg_error.phpt | 8 ++++---- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_arg_error.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_arg_error.phpt index 9cdd689f74aaa..dce8ecf287852 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_arg_error.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_arg_error.phpt @@ -1,5 +1,5 @@ --TEST-- -Test PdoSqlite::createFunction() arguments error +Test Pdo\Sqlite::createFunction() arguments error --EXTENSIONS-- pdo_sqlite --FILE-- @@ -7,7 +7,7 @@ pdo_sqlite declare(strict_types=1); -$db = new PdoSqlite('sqlite::memory:'); +$db = new Pdo\Sqlite('sqlite::memory:'); class TrampolineTest { public function __call(string $name, array $arguments) { @@ -42,8 +42,8 @@ try { echo 'done!'; ?> --EXPECT-- -PdoSqlite::createFunction(): Argument #1 ($function_name) must be of type string, null given -PdoSqlite::createFunction(): Argument #2 ($callback) must be a valid callback, no array or string given -PdoSqlite::createFunction(): Argument #3 ($num_args) must be of type int, null given -PdoSqlite::createFunction(): Argument #4 ($flags) must be of type int, null given +Pdo\Sqlite::createFunction(): Argument #1 ($function_name) must be of type string, null given +Pdo\Sqlite::createFunction(): Argument #2 ($callback) must be a valid callback, no array or string given +Pdo\Sqlite::createFunction(): Argument #3 ($num_args) must be of type int, null given +Pdo\Sqlite::createFunction(): Argument #4 ($flags) must be of type int, null given done! diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_arg_error.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_arg_error.phpt index 8c0f3fedd9635..7707f8cae978c 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_arg_error.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_arg_error.phpt @@ -1,5 +1,5 @@ --TEST-- -Test PdoSqlite::createAggregate() arguments error +Test Pdo\Sqlite::createAggregate() arguments error --EXTENSIONS-- pdo_sqlite --FILE-- @@ -7,7 +7,7 @@ pdo_sqlite declare(strict_types=1); -$db = new PdoSqlite('sqlite::memory:'); +$db = new Pdo\Sqlite('sqlite::memory:'); class TrampolineTest { public function __call(string $name, array $arguments) { @@ -54,10 +54,10 @@ try { echo 'done!'; ?> --EXPECT-- -PdoSqlite::createAggregate(): Argument #1 ($name) must be of type string, null given -PdoSqlite::createAggregate(): Argument #1 ($name) must be of type string, null given -PdoSqlite::createAggregate(): Argument #1 ($name) must be of type string, null given -PdoSqlite::createAggregate(): Argument #2 ($step) must be a valid callback, no array or string given -PdoSqlite::createAggregate(): Argument #3 ($finalize) must be a valid callback, no array or string given -PdoSqlite::createAggregate(): Argument #4 ($numArgs) must be of type int, null given +Pdo\Sqlite::createAggregate(): Argument #1 ($name) must be of type string, null given +Pdo\Sqlite::createAggregate(): Argument #1 ($name) must be of type string, null given +Pdo\Sqlite::createAggregate(): Argument #1 ($name) must be of type string, null given +Pdo\Sqlite::createAggregate(): Argument #2 ($step) must be a valid callback, no array or string given +Pdo\Sqlite::createAggregate(): Argument #3 ($finalize) must be a valid callback, no array or string given +Pdo\Sqlite::createAggregate(): Argument #4 ($numArgs) must be of type int, null given done! diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_arg_error.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_arg_error.phpt index c5be063efc7aa..16bb8b9333e4c 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_arg_error.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_arg_error.phpt @@ -1,5 +1,5 @@ --TEST-- -Test PdoSqlite::createCollation() arguments error +Test Pdo\Sqlite::createCollation() arguments error --EXTENSIONS-- pdo_sqlite --FILE-- @@ -7,7 +7,7 @@ pdo_sqlite declare(strict_types=1); -$db = new PdoSqlite('sqlite::memory:'); +$db = new Pdo\Sqlite('sqlite::memory:'); class TrampolineTest { public function __call(string $name, array $arguments) { @@ -30,6 +30,6 @@ try { echo 'done!'; ?> --EXPECT-- -PdoSqlite::createCollation(): Argument #1 ($name) must be of type string, null given -PdoSqlite::createCollation(): Argument #2 ($callback) must be a valid callback, no array or string given +Pdo\Sqlite::createCollation(): Argument #1 ($name) must be of type string, null given +Pdo\Sqlite::createCollation(): Argument #2 ($callback) must be a valid callback, no array or string given done!