summaryrefslogtreecommitdiff
path: root/ext/sqlite/sqlite.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@php.net>2006-06-13 13:12:20 +0000
committerDmitry Stogov <dmitry@php.net>2006-06-13 13:12:20 +0000
commit943960c324597281c02c42ae2ead2c2d7ef01be7 (patch)
tree52a64885afab0efae220d8bd3eb2867b1022f8e7 /ext/sqlite/sqlite.c
parent2cbde06400d2caf58d7f789b828f8d663980c8d2 (diff)
downloadphp-git-943960c324597281c02c42ae2ead2c2d7ef01be7.tar.gz
Added automatic module globals management
Diffstat (limited to 'ext/sqlite/sqlite.c')
-rw-r--r--ext/sqlite/sqlite.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index 66e3a9fc7f..daf20de019 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -62,6 +62,7 @@ extern pdo_driver_t pdo_sqlite2_driver;
#endif
ZEND_DECLARE_MODULE_GLOBALS(sqlite)
+static PHP_GINIT_FUNCTION(sqlite);
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
extern ps_module ps_mod_sqlite;
@@ -300,7 +301,15 @@ zend_module_entry sqlite_module_entry = {
#if ZEND_MODULE_API_NO >= 20010901
PHP_SQLITE_MODULE_VERSION,
#endif
+#if ZEND_MODULE_API_NO >= 20060613
+ PHP_MODULE_GLOBALS(sqlite),
+ PHP_GINIT(sqlite),
+ NULL,
+ NULL,
+ STANDARD_MODULE_PROPERTIES_EX
+#else
STANDARD_MODULE_PROPERTIES
+#endif
};
@@ -1012,10 +1021,9 @@ zend_object_iterator *sqlite_get_iterator(zend_class_entry *ce, zval *object, in
}
/* }}} */
-static int init_sqlite_globals(zend_sqlite_globals *g)
+static PHP_GINIT_FUNCTION(sqlite)
{
- g->assoc_case = 0;
- return SUCCESS;
+ sqlite_globals->assoc_case = 0;
}
PHP_MINIT_FUNCTION(sqlite)
@@ -1047,8 +1055,6 @@ PHP_MINIT_FUNCTION(sqlite)
sqlite_ce_query->get_iterator = sqlite_get_iterator;
sqlite_ce_query->iterator_funcs.funcs = &sqlite_query_iterator_funcs;
- ZEND_INIT_MODULE_GLOBALS(sqlite, init_sqlite_globals, NULL);
-
REGISTER_INI_ENTRIES();
#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)