int phpinfo_as_text;
char *ini_entries;
+ zend_function_entry *additional_functions;
};
/* start Zend extensions */
zend_startup_extensions();
+ /* register additional functions */
+ if (sapi_module.additional_functions) {
+ zend_module_entry *module;
+
+ if (zend_hash_find(&module_registry, "standard", sizeof("standard"), (void**)&module)==SUCCESS) {
+ EG(current_module) = module;
+ zend_register_functions(NULL, sapi_module.additional_functions, NULL, MODULE_PERSISTENT TSRMLS_CC);
+ EG(current_module) = NULL;
+ }
+ }
+
UG(unicode) = orig_unicode;
zend_post_startup(TSRMLS_C);
}
/* }}} */
-/* {{{ php_enable_dl
- */
-int php_enable_dl()
-{
- zend_module_entry *module;
- static zend_function_entry dl_functions[] = {
- ZEND_FE(dl, NULL)
- { NULL, NULL, NULL }
- };
- int ret = FAILURE;
- TSRMLS_FETCH();
-
- if (zend_hash_find(&module_registry, "standard", sizeof("standard"), (void**)&module)==SUCCESS) {
- EG(current_module) = module;
- ret = zend_register_functions(NULL, dl_functions, NULL, MODULE_PERSISTENT TSRMLS_CC);
- EG(current_module) = NULL;
- }
- return ret;
-}
-/* }}} */
-
void php_module_shutdown_for_exec()
{
/* used to close fd's in the range 3.255 here, but it's problematic */
extern int php_init_environ(void);
extern int php_shutdown_environ(void);
-/* dl() support */
-PHPAPI int php_enable_dl(void);
-
END_EXTERN_C()
#endif
static int php_cgi_startup(sapi_module_struct *sapi_module)
{
- if (php_module_startup(sapi_module, NULL, 0) == FAILURE ||
- php_enable_dl() == FAILURE) {
+ if (php_module_startup(sapi_module, NULL, 0) == FAILURE) {
return FAILURE;
}
return SUCCESS;
};
/* }}} */
+static zend_function_entry additional_functions[] = {
+ ZEND_FE(dl, NULL)
+ {NULL, NULL, NULL}
+};
+
/* {{{ php_cgi_usage
*/
static void php_cgi_usage(char *argv0)
#endif
cgi_sapi_module.executable_location = argv[0];
+ cgi_sapi_module.additional_functions = additional_functions;
/* startup after we get the above ini override se we get things right */
- if (php_module_startup(&cgi_sapi_module, NULL, 0) == FAILURE ||
- php_enable_dl() == FAILURE) {
+ if (php_module_startup(&cgi_sapi_module, NULL, 0) == FAILURE) {
#ifdef ZTS
tsrm_shutdown();
#endif
static int php_cli_startup(sapi_module_struct *sapi_module)
{
- if (php_module_startup(sapi_module, NULL, 0)==FAILURE ||
- php_enable_dl()==FAILURE) {
+ if (php_module_startup(sapi_module, NULL, 0)==FAILURE) {
return FAILURE;
}
return SUCCESS;
};
/* }}} */
+static zend_function_entry additional_functions[] = {
+ ZEND_FE(dl, NULL)
+ {NULL, NULL, NULL}
+};
+
/* {{{ php_cli_usage
*/
static void php_cli_usage(char *argv0)
php_optarg = orig_optarg;
cli_sapi_module.executable_location = argv[0];
+ cli_sapi_module.additional_functions = additional_functions;
#ifdef ZTS
compiler_globals = ts_resource(compiler_globals_id);
#endif
/* startup after we get the above ini override se we get things right */
- if (php_module_startup(&cli_sapi_module, NULL, 0)==FAILURE ||
- php_enable_dl()==FAILURE) {
+ if (php_module_startup(&cli_sapi_module, NULL, 0)==FAILURE) {
/* there is no way to see if we must call zend_ini_deactivate()
* since we cannot check if EG(ini_directives) has been initialised
* because the executor's constructor does not set initialize it.
static int php_embed_startup(sapi_module_struct *sapi_module)
{
- if (php_module_startup(sapi_module, NULL, 0)==FAILURE ||
- php_enable_dl()==FAILURE) {
+ if (php_module_startup(sapi_module, NULL, 0)==FAILURE) {
return FAILURE;
}
return SUCCESS;
};
/* }}} */
+static zend_function_entry additional_functions[] = {
+ ZEND_FE(dl, NULL)
+ {NULL, NULL, NULL}
+};
+
int php_embed_init(int argc, char **argv PTSRMLS_DC)
{
zend_llist global_vars;
*ptsrm_ls = tsrm_ls;
#endif
+ php_embed_module.additional_functions = additional_functions;
sapi_startup(&php_embed_module);
if (php_embed_module.startup(&php_embed_module)==FAILURE) {