summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build/genif.sh6
-rw-r--r--ext/dom/php_dom.c12
-rwxr-xr-xext/pdo/pdo.c13
-rwxr-xr-xext/pdo_mysql/pdo_mysql.c10
-rw-r--r--ext/pdo_sqlite/pdo_sqlite.c11
-rw-r--r--ext/sqlite/sqlite.c19
-rw-r--r--ext/standard/dl.c14
-rw-r--r--ext/standard/dl.h3
-rw-r--r--main/internal_functions.c.in4
-rw-r--r--main/internal_functions_nw.c4
-rw-r--r--main/internal_functions_win32.c4
-rw-r--r--main/main.c15
-rw-r--r--main/php.h2
-rw-r--r--main/php_ini.c4
-rw-r--r--main/php_ini.h2
-rw-r--r--main/php_main.h2
16 files changed, 92 insertions, 33 deletions
diff --git a/build/genif.sh b/build/genif.sh
index 6fb8fc391f..f40ad57a83 100644
--- a/build/genif.sh
+++ b/build/genif.sh
@@ -1,6 +1,6 @@
#! /bin/sh
-# $Id: genif.sh,v 1.4 2004-07-18 12:03:51 wez Exp $
+# $Id: genif.sh,v 1.5 2005-06-17 09:39:20 dmitry Exp $
# replacement for genif.pl
infile=$1
@@ -17,13 +17,13 @@ if test -z "$infile" || test -z "$srcdir"; then
exit 1
fi
+module_ptrs=$extra_module_ptrs
header_list=
olddir=`pwd`
cd $srcdir
-module_ptrs="$extra_module_ptrs`echo $@ | $awk -f ./build/order_by_dep.awk`"
-
for ext in ${1+"$@"} ; do
+ module_ptrs=" phpext_${ext}_ptr,@NEWLINE@$module_ptrs"
header_list="$header_list ext/$ext/*.h"
done
diff --git a/ext/dom/php_dom.c b/ext/dom/php_dom.c
index 8253cab243..de5179f052 100644
--- a/ext/dom/php_dom.c
+++ b/ext/dom/php_dom.c
@@ -404,8 +404,18 @@ static zend_object_handlers* dom_get_obj_handlers(TSRMLS_D) {
}
}
+static zend_module_dep dom_deps[] = {
+ ZEND_MOD_REQUIRED("libxml")
+ ZEND_MOD_CONFLICTS("domxml")
+#ifdef HAVE_SIMPLEXML
+ ZEND_MOD_REQUIRED("simplexml")
+#endif
+ {NULL, NULL, NULL}
+};
+
zend_module_entry dom_module_entry = {
- STANDARD_MODULE_HEADER,
+ STANDARD_MODULE_HEADER_EX, NULL,
+ dom_deps,
"dom",
dom_functions,
PHP_MINIT(dom),
diff --git a/ext/pdo/pdo.c b/ext/pdo/pdo.c
index ddbc8478b7..27b05f24e4 100755
--- a/ext/pdo/pdo.c
+++ b/ext/pdo/pdo.c
@@ -86,9 +86,20 @@ function_entry pdo_functions[] = {
};
/* }}} */
+/* {{{ pdo_functions[] */
+static zend_module_dep pdo_deps[] = {
+#ifdef HAVE_SPL
+ ZEND_MOD_REQUIRED("spl")
+#endif
+ {NULL, NULL, NULL}
+};
+
+/* }}} */
+
/* {{{ pdo_module_entry */
zend_module_entry pdo_module_entry = {
- STANDARD_MODULE_HEADER,
+ STANDARD_MODULE_HEADER_EX, NULL,
+ pdo_deps,
"PDO",
pdo_functions,
PHP_MINIT(pdo),
diff --git a/ext/pdo_mysql/pdo_mysql.c b/ext/pdo_mysql/pdo_mysql.c
index 819c44f0d7..ff3321376d 100755
--- a/ext/pdo_mysql/pdo_mysql.c
+++ b/ext/pdo_mysql/pdo_mysql.c
@@ -36,9 +36,17 @@ function_entry pdo_mysql_functions[] = {
};
/* }}} */
+/* {{{ pdo_mysql_functions[] */
+static zend_module_dep pdo_mysql_deps[] = {
+ ZEND_MOD_REQUIRED("pdo")
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
/* {{{ pdo_mysql_module_entry */
zend_module_entry pdo_mysql_module_entry = {
- STANDARD_MODULE_HEADER,
+ STANDARD_MODULE_HEADER_EX, NULL,
+ pdo_mysql_deps,
"pdo_mysql",
pdo_mysql_functions,
PHP_MINIT(pdo_mysql),
diff --git a/ext/pdo_sqlite/pdo_sqlite.c b/ext/pdo_sqlite/pdo_sqlite.c
index 10ac1acb6f..d641f2d2f6 100644
--- a/ext/pdo_sqlite/pdo_sqlite.c
+++ b/ext/pdo_sqlite/pdo_sqlite.c
@@ -39,10 +39,19 @@ function_entry pdo_sqlite_functions[] = {
};
/* }}} */
+/* {{{ pdo_sqlite_deps
+ */
+static zend_module_dep pdo_sqlite_deps[] = {
+ ZEND_MOD_REQUIRED("pdo")
+ {NULL, NULL, NULL}
+};
+/* }}} */
+
/* {{{ pdo_sqlite_module_entry
*/
zend_module_entry pdo_sqlite_module_entry = {
- STANDARD_MODULE_HEADER,
+ STANDARD_MODULE_HEADER_EX, NULL,
+ pdo_sqlite_deps,
"pdo_sqlite",
pdo_sqlite_functions,
PHP_MINIT(pdo_sqlite),
diff --git a/ext/sqlite/sqlite.c b/ext/sqlite/sqlite.c
index f0cf248076..7673b428fb 100644
--- a/ext/sqlite/sqlite.c
+++ b/ext/sqlite/sqlite.c
@@ -267,8 +267,25 @@ function_entry sqlite_funcs_exception[] = {
{NULL, NULL, NULL}
};
+/* Dependancies */
+static zend_module_dep sqlite_deps[] = {
+#if defined(HAVE_SPL) && ((PHP_MAJOR_VERSION > 5) || (PHP_MAJOR_VERSION == 5 && PHP_MINOR_VERSION >= 1))
+ ZEND_MOD_REQUIRED("spl")
+#endif
+#if HAVE_PHP_SESSION && !defined(COMPILE_DL_SESSION)
+ ZEND_MOD_REQUIRED("session")
+#endif
+#if PHP_SQLITE2_HAVE_PDO
+ ZEND_MOD_REQUIRED("pdo")
+#endif
+ {NULL, NULL, NULL}
+};
+
zend_module_entry sqlite_module_entry = {
-#if ZEND_MODULE_API_NO >= 20010901
+#if ZEND_MODULE_API_NO >= 20050608
+ STANDARD_MODULE_HEADER_EX, NULL,
+ sqlite_deps,
+#elif ZEND_MODULE_API_NO >= 20010901
STANDARD_MODULE_HEADER,
#endif
"SQLite",
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index 8d311aa2df..5d83fc7451 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -54,7 +54,7 @@
Load a PHP extension at runtime */
PHP_FUNCTION(dl)
{
- pval **file;
+ zval **file;
/* obtain arguments */
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &file) == FAILURE) {
@@ -99,7 +99,7 @@ PHP_FUNCTION(dl)
/* {{{ php_dl
*/
-void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
+void php_dl(zval *file, int type, zval *return_value TSRMLS_DC)
{
void *handle;
char *libpath;
@@ -224,14 +224,18 @@ void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
RETURN_FALSE;
}
+ if (type == MODULE_TEMPORARY && zend_startup_module(module_entry TSRMLS_CC) == FAILURE) {
+ DL_UNLOAD(handle);
+ RETURN_FALSE;
+ }
+
if ((type == MODULE_TEMPORARY) && module_entry->request_startup_func) {
- if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC)) {
+ if (module_entry->request_startup_func(type, module_entry->module_number TSRMLS_CC) == FAILURE) {
php_error_docref(NULL TSRMLS_CC, error_type, "Unable to initialize module '%s'", module_entry->name);
DL_UNLOAD(handle);
RETURN_FALSE;
}
}
-
RETURN_TRUE;
}
/* }}} */
@@ -243,7 +247,7 @@ PHP_MINFO_FUNCTION(dl)
#else
-void php_dl(pval *file, int type, pval *return_value TSRMLS_DC)
+void php_dl(zval *file, int type, zval *return_value TSRMLS_DC)
{
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot dynamically load %s - dynamic modules are not supported", Z_STRVAL_P(file));
RETURN_FALSE;
diff --git a/ext/standard/dl.h b/ext/standard/dl.h
index 1f5c9b5ecf..81bb8697df 100644
--- a/ext/standard/dl.h
+++ b/ext/standard/dl.h
@@ -23,8 +23,7 @@
#ifndef DL_H
#define DL_H
-PHPAPI void php_dl(pval *file,int type,pval *return_value TSRMLS_DC);
-
+PHPAPI void php_dl(zval *file,int type, zval *return_value TSRMLS_DC);
/* dynamic loading functions */
PHP_FUNCTION(dl);
diff --git a/main/internal_functions.c.in b/main/internal_functions.c.in
index 8e2b7b8518..065807162b 100644
--- a/main/internal_functions.c.in
+++ b/main/internal_functions.c.in
@@ -36,9 +36,9 @@ zend_module_entry *php_builtin_extensions[] = {
#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *))
-int php_startup_internal_extensions(void)
+int php_register_internal_extensions(TSRMLS_D)
{
- return php_startup_extensions(php_builtin_extensions, EXTCOUNT);
+ return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC);
}
/*
diff --git a/main/internal_functions_nw.c b/main/internal_functions_nw.c
index 9500a6d95c..b3baf2a62c 100644
--- a/main/internal_functions_nw.c
+++ b/main/internal_functions_nw.c
@@ -85,9 +85,9 @@ zend_module_entry *php_builtin_extensions[] = {
#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *))
-int php_startup_internal_extensions(void)
+int php_register_internal_extensions(TSRMLS_D)
{
- return php_startup_extensions(php_builtin_extensions, EXTCOUNT);
+ return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC);
}
diff --git a/main/internal_functions_win32.c b/main/internal_functions_win32.c
index 75257a69fe..5254be4393 100644
--- a/main/internal_functions_win32.c
+++ b/main/internal_functions_win32.c
@@ -158,9 +158,9 @@ zend_module_entry *php_builtin_extensions[] = {
#define EXTCOUNT (sizeof(php_builtin_extensions)/sizeof(zend_module_entry *))
-int php_startup_internal_extensions(void)
+int php_register_internal_extensions(TSRMLS_D)
{
- return php_startup_extensions(php_builtin_extensions, EXTCOUNT);
+ return php_register_extensions(php_builtin_extensions, EXTCOUNT TSRMLS_CC);
}
/*
diff --git a/main/main.c b/main/main.c
index bffb89fb1c..ff632841d7 100644
--- a/main/main.c
+++ b/main/main.c
@@ -1287,15 +1287,15 @@ static void core_globals_ctor(php_core_globals *core_globals TSRMLS_DC)
/* }}} */
#endif
-/* {{{ php_startup_extensions
+/* {{{ php_register_extensions
*/
-int php_startup_extensions(zend_module_entry **ptr, int count)
+int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC)
{
- zend_module_entry **end = ptr+count;
+ zend_module_entry **end = ptr + count;
while (ptr < end) {
if (*ptr) {
- if (zend_startup_module(*ptr)==FAILURE) {
+ if (zend_register_internal_module(*ptr TSRMLS_CC)==FAILURE) {
return FAILURE;
}
}
@@ -1480,13 +1480,13 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
zend_register_default_classes(TSRMLS_C);
/* startup extensions staticly compiled in */
- if (php_startup_internal_extensions() == FAILURE) {
+ if (php_register_internal_extensions(TSRMLS_C) == FAILURE) {
php_printf("Unable to start builtin modules\n");
return FAILURE;
}
/* start additional PHP extensions */
- php_startup_extensions(&additional_modules, num_additional_modules);
+ php_register_extensions(&additional_modules, num_additional_modules TSRMLS_CC);
/* load and startup extensions compiled as shared objects (aka DLLs)
@@ -1496,7 +1496,8 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
which is always an internal extension and to be initialized
ahead of all other internals
*/
- php_ini_delayed_modules_startup(TSRMLS_C);
+ php_ini_register_extensions(TSRMLS_C);
+ zend_startup_modules(TSRMLS_C);
/* disable certain classes and functions as requested by php.ini */
php_disable_functions(TSRMLS_C);
diff --git a/main/php.h b/main/php.h
index 60977dc59c..25869aaa42 100644
--- a/main/php.h
+++ b/main/php.h
@@ -319,7 +319,7 @@ END_EXTERN_C()
/* functions */
BEGIN_EXTERN_C()
-int php_startup_internal_extensions(void);
+int php_register_internal_extensions(TSRMLS_D);
int php_mergesort(void *base, size_t nmemb, register size_t size, int (*cmp)(const void *, const void * TSRMLS_DC) TSRMLS_DC);
diff --git a/main/php_ini.c b/main/php_ini.c
index a8c1129dbb..e6dd1b8a34 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -544,9 +544,9 @@ int php_shutdown_config(void)
}
/* }}} */
-/* {{{ php_ini_delayed_modules_startup
+/* {{{ php_ini_register_extensions
*/
-void php_ini_delayed_modules_startup(TSRMLS_D)
+void php_ini_register_extensions(TSRMLS_D)
{
zend_llist_apply(&extension_lists.engine, php_load_zend_extension_cb TSRMLS_CC);
zend_llist_apply(&extension_lists.functions, php_load_function_extension_cb TSRMLS_CC);
diff --git a/main/php_ini.h b/main/php_ini.h
index 94b5d3271f..4a733b522a 100644
--- a/main/php_ini.h
+++ b/main/php_ini.h
@@ -26,7 +26,7 @@
BEGIN_EXTERN_C()
int php_init_config();
int php_shutdown_config(void);
-void php_ini_delayed_modules_startup(TSRMLS_D);
+void php_ini_register_extensions(TSRMLS_D);
zval *cfg_get_entry(char *name, uint name_length);
END_EXTERN_C()
diff --git a/main/php_main.h b/main/php_main.h
index 883953643f..e22ffd6ef3 100644
--- a/main/php_main.h
+++ b/main/php_main.h
@@ -36,7 +36,7 @@ PHPAPI void php_module_shutdown_for_exec(void);
PHPAPI int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals);
PHPAPI int php_request_startup_for_hook(TSRMLS_D);
-PHPAPI int php_startup_extensions(zend_module_entry **ptr, int count);
+PHPAPI int php_register_extensions(zend_module_entry **ptr, int count TSRMLS_DC);
PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC);
PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret TSRMLS_DC);