]> granicus.if.org Git - php/commitdiff
- Need to make PDO::__construct() final to prevent SEGV it isn't called 1st
authorMarcus Boerger <helly@php.net>
Thu, 26 May 2005 18:36:18 +0000 (18:36 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 26 May 2005 18:36:18 +0000 (18:36 +0000)
ext/pdo/pdo_dbh.c
ext/pdo/tests/pdo_023_def.inc
ext/pdo/tests/pdo_026.inc
ext/pdo_mysql/tests/pdo_023.phpt
ext/pdo_mysql/tests/pdo_026.phpt
ext/pdo_pgsql/tests/pdo_023.phpt
ext/pdo_pgsql/tests/pdo_026.phpt
ext/pdo_sqlite/tests/pdo_023.phpt
ext/pdo_sqlite/tests/pdo_026.phpt
ext/sqlite/tests/pdo/pdo_023.phpt
ext/sqlite/tests/pdo/pdo_026.phpt

index 29b0a716cd38269413d7e9f45aad488d87a26473..20579a10000047c26eec7a342f15f7a5b14fafc1 100755 (executable)
@@ -1075,6 +1075,7 @@ void pdo_dbh_init(TSRMLS_D)
        INIT_CLASS_ENTRY(ce, "PDO", pdo_dbh_functions);
        pdo_dbh_ce = zend_register_internal_class(&ce TSRMLS_CC);
        pdo_dbh_ce->create_object = pdo_dbh_new;
+       pdo_dbh_ce->constructor->common.fn_flags |= ZEND_ACC_FINAL;
 
        memcpy(&pdo_dbh_object_handlers, &std_object_handlers, sizeof(zend_object_handlers));
        pdo_dbh_object_handlers.get_method = dbh_method_get;
index 62a5d21313e99bc100364ad426573f70e820eecd..1fb19809957b8612a20c2822b8d0b35354491737 100755 (executable)
@@ -21,12 +21,6 @@ class PDODatabaseX extends PDO
 {
     public $test1 = 1;
     
-    function __construct($connect)
-    {
-       echo __METHOD__ . "()\n";
-       parent::__construct($connect);
-    }
-    
     function __destruct()
     {
        echo __METHOD__ . "()\n";
index c5f2ce565bd633d1e53f8e2ea56d9670e0a3c8f3..b94ea17c3a3e1ac910a8a2bfad560466d82b8a4e 100755 (executable)
@@ -30,12 +30,6 @@ class PDOStatementX extends PDOStatement
 
 class PDODatabase extends PDO
 {
-    function __construct($connect)
-    {
-       echo __METHOD__ . "()\n";
-       parent::__construct($connect);
-    }
-    
     function __destruct()
     {
        echo __METHOD__ . "()\n";
index 50db082a3b52a29f0f99de7e56071b0f31c5fb40..ba43758a3ecf79e13e819cf5ffd36b1a9fe8be00 100755 (executable)
@@ -22,7 +22,6 @@ require_once($PDO_TESTS . 'pdo_023.inc');
 ===DONE===
 <?php exit(0); ?>
 --EXPECTF--
-PDODatabaseX::__construct()
 int(1)
 int(2)
 object(PDODatabaseX)#%d (2) {
index e55b4578f93e192527fb11c3333837d83fcdc1d7..7e061d867191400e4be9200b52bf0b2da5ac801c 100755 (executable)
@@ -15,7 +15,6 @@ require_once($PDO_TESTS . 'pdo_026.inc');
 ===DONE===
 <?php exit(0); ?>
 --EXPECT--
-PDODatabase::__construct()
 string(11) "PDODatabase"
 string(12) "PDOStatement"
 PDODatabase::query()
index df6d8ed9886b557b6041282ab61d764fdce1328c..5aa86aa41a959dfed3355e55eea6ff58c5eaf7bf 100755 (executable)
@@ -22,7 +22,6 @@ require_once($PDO_TESTS . 'pdo_023.inc');
 ===DONE===
 <?php exit(0); ?>
 --EXPECTF--
-PDODatabaseX::__construct()
 int(1)
 int(2)
 object(PDODatabaseX)#%d (2) {
index 68aa14cf7d82b31cb407079c38bce872f5761b9e..12ac290c527e94c1bc3999ca8624f2234ec220f7 100755 (executable)
@@ -15,7 +15,6 @@ require_once($PDO_TESTS . 'pdo_026.inc');
 ===DONE===
 <?php exit(0); ?>
 --EXPECT--
-PDODatabase::__construct()
 string(11) "PDODatabase"
 string(12) "PDOStatement"
 PDODatabase::query()
index 2db35289cf131b97c3b8812e047cf396d3c21beb..6baffe80651ed904c6833d52139391cda4d6f971 100755 (executable)
@@ -22,7 +22,6 @@ require_once($PDO_TESTS . 'pdo_023.inc');
 ===DONE===
 <?php exit(0); ?>
 --EXPECTF--
-PDODatabaseX::__construct()
 int(1)
 int(2)
 object(PDODatabaseX)#%d (2) {
index 066648f453820d97bf8c3b4884e3fbd31600b5cb..cfeb0c26af89f1cce20cfe436e35c1db7f48cb58 100755 (executable)
@@ -15,7 +15,6 @@ require_once($PDO_TESTS . 'pdo_026.inc');
 ===DONE===
 <?php exit(0); ?>
 --EXPECT--
-PDODatabase::__construct()
 string(11) "PDODatabase"
 string(12) "PDOStatement"
 PDODatabase::query()
index 1bdc853e8f6175936e0b8c0b5717b5f533bfa217..a987c6bd033f8382d1034bef65c62259cc928bf7 100755 (executable)
@@ -22,7 +22,6 @@ require_once($PDO_TESTS . 'pdo_023.inc');
 ===DONE===
 <?php exit(0); ?>
 --EXPECTF--
-PDODatabaseX::__construct()
 int(1)
 int(2)
 object(PDODatabaseX)#%d (2) {
index d9bc504c57eaa52016d30ad47ac1a034ce207ee0..28d21bab2ae9638f7c56a6766c4b9ec0a6933150 100755 (executable)
@@ -15,7 +15,6 @@ require_once($PDO_TESTS . 'pdo_026.inc');
 ===DONE===
 <?php exit(0); ?>
 --EXPECT--
-PDODatabase::__construct()
 string(11) "PDODatabase"
 string(12) "PDOStatement"
 PDODatabase::query()