|
28 | 28 | #include "php_pdo_sqlite.h"
|
29 | 29 | #include "php_pdo_sqlite_int.h"
|
30 | 30 | #include "zend_exceptions.h"
|
| 31 | +#include "zend_interfaces.h" |
| 32 | + |
| 33 | +/* Class entry pointers */ |
| 34 | +PHPAPI zend_class_entry *pdo_dbh_sqlite_ptr; |
31 | 35 |
|
32 | 36 | /* {{{ pdo_sqlite_functions[] */
|
33 | 37 | static const zend_function_entry pdo_sqlite_functions[] = {
|
@@ -78,6 +82,16 @@ PHP_MINIT_FUNCTION(pdo_sqlite)
|
78 | 82 | REGISTER_PDO_CLASS_CONST_LONG("SQLITE_ATTR_READONLY_STATEMENT", (zend_long)PDO_SQLITE_ATTR_READONLY_STATEMENT);
|
79 | 83 | REGISTER_PDO_CLASS_CONST_LONG("SQLITE_ATTR_EXTENDED_RESULT_CODES", (zend_long)PDO_SQLITE_ATTR_EXTENDED_RESULT_CODES);
|
80 | 84 |
|
| 85 | + zend_class_entry ce_sqlite; |
| 86 | + INIT_CLASS_ENTRY(ce_sqlite, "PDOSQLite", pdo_sqlite_functions); |
| 87 | + // The Reflection extension manges to set serialize and unserialize *before* calling |
| 88 | + // zend_register_internal_class(). I couldn't make that work (something to do with |
| 89 | + // pointers/references?) so have had to put them after. |
| 90 | + pdo_dbh_sqlite_ptr = zend_register_internal_class(&ce_sqlite); // @TODO Add a second parameter with name of PDO ptr |
| 91 | + pdo_dbh_sqlite_ptr->serialize = zend_class_serialize_deny; |
| 92 | + pdo_dbh_sqlite_ptr->unserialize = zend_class_unserialize_deny; |
| 93 | + zend_declare_property_string(pdo_dbh_sqlite_ptr, "name", sizeof("name")-1, "", ZEND_ACC_PUBLIC); |
| 94 | + |
81 | 95 | return php_pdo_register_driver(&pdo_sqlite_driver);
|
82 | 96 | }
|
83 | 97 | /* }}} */
|
|
0 commit comments