dmitry          Fri Mar 17 13:45:43 2006 UTC

  Modified files:              
    /php-src/main       SAPI.h main.c php_main.h 
    /php-src/sapi/cgi   cgi_main.c 
    /php-src/sapi/cli   php_cli.c 
    /php-src/sapi/embed php_embed.c 
  Log:
  Unicode support for dl() patch.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/main/SAPI.h?r1=1.117&r2=1.118&diff_format=u
Index: php-src/main/SAPI.h
diff -u php-src/main/SAPI.h:1.117 php-src/main/SAPI.h:1.118
--- php-src/main/SAPI.h:1.117   Mon Feb 13 10:23:58 2006
+++ php-src/main/SAPI.h Fri Mar 17 13:45:43 2006
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: SAPI.h,v 1.117 2006/02/13 10:23:58 dmitry Exp $ */
+/* $Id: SAPI.h,v 1.118 2006/03/17 13:45:43 dmitry Exp $ */
 
 #ifndef SAPI_H
 #define SAPI_H
@@ -260,6 +260,7 @@
        int phpinfo_as_text;
 
        char *ini_entries;
+       zend_function_entry *additional_functions;
 };
 
 
http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.678&r2=1.679&diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.678 php-src/main/main.c:1.679
--- php-src/main/main.c:1.678   Thu Mar 16 16:53:09 2006
+++ php-src/main/main.c Fri Mar 17 13:45:43 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: main.c,v 1.678 2006/03/16 16:53:09 dmitry Exp $ */
+/* $Id: main.c,v 1.679 2006/03/17 13:45:43 dmitry Exp $ */
 
 /* {{{ includes
  */
@@ -1680,6 +1680,17 @@
        /* 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);
 
@@ -1692,27 +1703,6 @@
 }
 /* }}} */
 
-/* {{{ 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 */
http://cvs.php.net/viewcvs.cgi/php-src/main/php_main.h?r1=1.36&r2=1.37&diff_format=u
Index: php-src/main/php_main.h
diff -u php-src/main/php_main.h:1.36 php-src/main/php_main.h:1.37
--- php-src/main/php_main.h:1.36        Thu Mar 16 16:53:09 2006
+++ php-src/main/php_main.h     Fri Mar 17 13:45:43 2006
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: php_main.h,v 1.36 2006/03/16 16:53:09 dmitry Exp $ */
+/* $Id: php_main.h,v 1.37 2006/03/17 13:45:43 dmitry Exp $ */
 
 #ifndef PHP_MAIN_H
 #define PHP_MAIN_H
@@ -55,9 +55,6 @@
 extern int php_init_environ(void);
 extern int php_shutdown_environ(void);
 
-/* dl() support */
-PHPAPI int php_enable_dl(void);
-
 END_EXTERN_C()
 
 #endif
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.280&r2=1.281&diff_format=u
Index: php-src/sapi/cgi/cgi_main.c
diff -u php-src/sapi/cgi/cgi_main.c:1.280 php-src/sapi/cgi/cgi_main.c:1.281
--- php-src/sapi/cgi/cgi_main.c:1.280   Fri Mar 17 09:32:47 2006
+++ php-src/sapi/cgi/cgi_main.c Fri Mar 17 13:45:43 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: cgi_main.c,v 1.280 2006/03/17 09:32:47 dmitry Exp $ */
+/* $Id: cgi_main.c,v 1.281 2006/03/17 13:45:43 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -468,8 +468,7 @@
 
 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;
@@ -510,6 +509,11 @@
 };
 /* }}} */
 
+static zend_function_entry additional_functions[] = {
+       ZEND_FE(dl, NULL)
+       {NULL, NULL, NULL}
+};
+
 /* {{{ php_cgi_usage
  */
 static void php_cgi_usage(char *argv0)
@@ -1003,10 +1007,10 @@
 #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
http://cvs.php.net/viewcvs.cgi/php-src/sapi/cli/php_cli.c?r1=1.148&r2=1.149&diff_format=u
Index: php-src/sapi/cli/php_cli.c
diff -u php-src/sapi/cli/php_cli.c:1.148 php-src/sapi/cli/php_cli.c:1.149
--- php-src/sapi/cli/php_cli.c:1.148    Thu Mar 16 16:53:10 2006
+++ php-src/sapi/cli/php_cli.c  Fri Mar 17 13:45:43 2006
@@ -20,7 +20,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: php_cli.c,v 1.148 2006/03/16 16:53:10 dmitry Exp $ */
+/* $Id: php_cli.c,v 1.149 2006/03/17 13:45:43 dmitry Exp $ */
 
 #include "php.h"
 #include "php_globals.h"
@@ -328,8 +328,7 @@
 
 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;
@@ -391,6 +390,11 @@
 };
 /* }}} */
 
+static zend_function_entry additional_functions[] = {
+       ZEND_FE(dl, NULL)
+       {NULL, NULL, NULL}
+};
+
 /* {{{ php_cli_usage
  */
 static void php_cli_usage(char *argv0)
@@ -672,6 +676,7 @@
        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);
@@ -682,8 +687,7 @@
 #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.
http://cvs.php.net/viewcvs.cgi/php-src/sapi/embed/php_embed.c?r1=1.13&r2=1.14&diff_format=u
Index: php-src/sapi/embed/php_embed.c
diff -u php-src/sapi/embed/php_embed.c:1.13 php-src/sapi/embed/php_embed.c:1.14
--- php-src/sapi/embed/php_embed.c:1.13 Thu Mar 16 16:53:10 2006
+++ php-src/sapi/embed/php_embed.c      Fri Mar 17 13:45:43 2006
@@ -15,7 +15,7 @@
    | Author: Edin Kadribasic <[EMAIL PROTECTED]>                              |
    +----------------------------------------------------------------------+
 */
-/* $Id: php_embed.c,v 1.13 2006/03/16 16:53:10 dmitry Exp $ */
+/* $Id: php_embed.c,v 1.14 2006/03/17 13:45:43 dmitry Exp $ */
 
 #include "php_embed.h"
 
@@ -93,8 +93,7 @@
 
 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;
@@ -132,6 +131,11 @@
 };
 /* }}} */
 
+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;
@@ -174,6 +178,7 @@
   *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) {

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to