]> granicus.if.org Git - php/commitdiff
MFH: ws fixes (sync!)
authorJani Taskinen <jani@php.net>
Sun, 15 Jul 2007 15:21:12 +0000 (15:21 +0000)
committerJani Taskinen <jani@php.net>
Sun, 15 Jul 2007 15:21:12 +0000 (15:21 +0000)
main/main.c

index 5b0ccf6729fa5e240ad933a45e01ad10307aaf31..049078ccfd993f3dd954bdf34d63c5e409e207b9 100644 (file)
@@ -1,4 +1,4 @@
-/* 
+/*
    +----------------------------------------------------------------------+
    | PHP Version 5                                                        |
    +----------------------------------------------------------------------+
@@ -236,7 +236,7 @@ static PHP_INI_MH(OnUpdateTimeout)
 /* {{{ PHP_INI
  */
 PHP_INI_BEGIN()
-       PHP_INI_ENTRY_EX("define_syslog_variables",     "0",                            PHP_INI_ALL,    NULL,                   php_ini_boolean_displayer_cb)                   
+       PHP_INI_ENTRY_EX("define_syslog_variables",     "0",                            PHP_INI_ALL,    NULL,                   php_ini_boolean_displayer_cb)
        PHP_INI_ENTRY_EX("highlight.bg",                        HL_BG_COLOR,            PHP_INI_ALL,    NULL,                   php_ini_color_displayer_cb)
        PHP_INI_ENTRY_EX("highlight.comment",           HL_COMMENT_COLOR,       PHP_INI_ALL,    NULL,                   php_ini_color_displayer_cb)
        PHP_INI_ENTRY_EX("highlight.default",           HL_DEFAULT_COLOR,       PHP_INI_ALL,    NULL,                   php_ini_color_displayer_cb)
@@ -363,7 +363,7 @@ PHPAPI void php_log_err(char *log_message TSRMLS_DC)
                if (PG(open_basedir) && php_check_open_basedir_ex(PG(error_log), 0 TSRMLS_CC)) {
                        return;
                }
-               
+
                fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644);
                if (fd != -1) {
                        char *tmp;
@@ -412,7 +412,7 @@ PHPAPI int php_printf(const char *format, ...)
        ret = PHPWRITE(buffer, size);
        efree(buffer);
        va_end(args);
-       
+
        return ret;
 }
 /* }}} */
@@ -471,8 +471,9 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
        } else if (php_during_module_shutdown()) {
                function = "PHP Shutdown";
        } else if (EG(current_execute_data) &&
-                  EG(current_execute_data)->opline &&
-                  EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL) {
+                               EG(current_execute_data)->opline &&
+                               EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL
+       ) {
                switch (EG(current_execute_data)->opline->op2.u.constant.value.lval) {
                        case ZEND_EVAL:
                                function = "eval";
@@ -508,9 +509,9 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
 
        /* if we still have memory then format the origin */
        if (is_function) {
-               origin_len = spprintf(&origin, 0, "%s%s%s(%s)", class_name, space, function, params);   
+               origin_len = spprintf(&origin, 0, "%s%s%s(%s)", class_name, space, function, params);
        } else {
-               origin_len = spprintf(&origin, 0, "%s", function);      
+               origin_len = spprintf(&origin, 0, "%s", function);
        }
 
        if (PG(html_errors)) {
@@ -608,7 +609,7 @@ PHPAPI void php_verror(const char *docref, const char *params, int type, const c
 PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...)
 {
        va_list args;
-       
+
        va_start(args, format);
        php_verror(docref, "", type, format, args TSRMLS_CC);
        va_end(args);
@@ -620,7 +621,7 @@ PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char
 PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...)
 {
        va_list args;
-       
+
        va_start(args, format);
        php_verror(docref, param1, type, format, args TSRMLS_CC);
        va_end(args);
@@ -633,7 +634,7 @@ PHPAPI void php_error_docref2(const char *docref TSRMLS_DC, const char *param1,
 {
        char *params;
        va_list args;
-       
+
        spprintf(&params, 0, "%s,%s", param1, param2);
        va_start(args, format);
        php_verror(docref, params ? params : "...", type, format, args TSRMLS_CC);
@@ -848,9 +849,10 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
                        EG(exit_status) = 255;
                        if (module_initialized) {
                                if (!SG(headers_sent) &&
-                                   SG(sapi_headers).http_response_code == 200) {
+                                       SG(sapi_headers).http_response_code == 200
+                               ) {
                                        sapi_header_line ctr = {0};
-       
+
                                        ctr.line = "HTTP/1.0 500 Internal Server Error";
                                        ctr.line_len = strlen(ctr.line);
                                        sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
@@ -919,6 +921,7 @@ static FILE *php_fopen_wrapper_for_zend(const char *filename, char **opened_path
 }
 /* }}} */
 
+
 static void stream_closer_for_zend(void *handle TSRMLS_DC)
 {
        php_stream_close((php_stream*)handle);
@@ -1122,7 +1125,7 @@ int php_request_startup(TSRMLS_D)
 
        zend_try {
                PG(during_request_startup) = 1;
-               
+
                php_output_activate(TSRMLS_C);
 
                /* initialize global variables */
@@ -1130,7 +1133,7 @@ int php_request_startup(TSRMLS_D)
                PG(header_is_being_sent) = 0;
                PG(connection_status) = PHP_CONNECTION_NORMAL;
                PG(in_user_include) = 0;
-               
+
                zend_activate(TSRMLS_C);
                sapi_activate(TSRMLS_C);
 
@@ -1175,7 +1178,7 @@ int php_request_startup(TSRMLS_D)
 }
 # else
 int php_request_startup(TSRMLS_D)
-{   
+{
        int retval = SUCCESS;
 
 #if PHP_SIGCHILD
@@ -1185,7 +1188,7 @@ int php_request_startup(TSRMLS_D)
        if (php_start_sapi() == FAILURE) {
                return FAILURE;
        }
-       
+
        php_output_activate(TSRMLS_C);
        sapi_activate(TSRMLS_C);
        php_hash_environment(TSRMLS_C);
@@ -1218,7 +1221,7 @@ int php_request_startup_for_hook(TSRMLS_D)
        if (php_start_sapi(TSRMLS_C) == FAILURE) {
                return FAILURE;
        }
-       
+
        php_output_activate(TSRMLS_C);
        sapi_activate_headers_only(TSRMLS_C);
        php_hash_environment(TSRMLS_C);
@@ -1293,7 +1296,7 @@ void php_request_shutdown(void *dummy)
        TSRMLS_FETCH();
 
        report_memleaks = PG(report_memleaks);
-       
+
        /* EG(opline_ptr) points into nirvana and therefore cannot be safely accessed
         * inside zend_executor callback functions.
         */
@@ -1304,7 +1307,7 @@ void php_request_shutdown(void *dummy)
        if (PG(modules_activated)) zend_try {
                php_call_shutdown_functions(TSRMLS_C);
        } zend_end_try();
-       
+
        /* 2. Call all possible __destruct() functions */
        zend_try {
                zend_call_destructors(TSRMLS_C);
@@ -1371,7 +1374,7 @@ void php_request_shutdown(void *dummy)
        } zend_end_try();
 
        /* 12. Reset max_execution_time */
-       zend_try { 
+       zend_try {
                zend_unset_timeout(TSRMLS_C);
        } zend_end_try();
 
@@ -1567,7 +1570,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
 #endif
        EG(bailout) = NULL;
        EG(error_reporting) = E_ALL & ~E_NOTICE;
-       
+
        PG(header_is_being_sent) = 0;
        SG(request_info).headers_only = 0;
        SG(request_info).argv0 = NULL;
@@ -1626,7 +1629,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
                php_printf("PHP:  Unable to initialize stream url wrappers.\n");
                return FAILURE;
        }
-       
+
        /* initialize registry for images to be used in phpinfo() 
           (this uses configuration parameters from php.ini)
         */
@@ -1768,7 +1771,7 @@ void php_module_shutdown(TSRMLS_D)
        core_globals_dtor(&core_globals TSRMLS_CC);
 #else
        zend_ini_global_shutdown(TSRMLS_C);
-       ts_free_id(core_globals_id);    
+       ts_free_id(core_globals_id);
 #endif
 
        php_shutdown_temporary_directory();
@@ -1831,8 +1834,9 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
                 *   otherwise it will get opened and added to the included_files list in zend_execute_scripts
                 */
                if (primary_file->filename &&
-                   primary_file->opened_path == NULL &&
-                   primary_file->type != ZEND_HANDLE_FILENAME) {                       
+                       primary_file->opened_path == NULL &&
+                       primary_file->type != ZEND_HANDLE_FILENAME
+               ) {
                        int realfile_len;
                        int dummy = 1;
 
@@ -1869,7 +1873,6 @@ PHPAPI int php_execute_script(zend_file_handle *primary_file TSRMLS_DC)
                        zend_set_timeout(INI_INT("max_execution_time"));
                }
                retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS);
-               
        } zend_end_try();
 
 #if HAVE_BROKEN_GETCWD
@@ -1897,7 +1900,7 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret
 #define OLD_CWD_SIZE 4096
        old_cwd = do_alloca(OLD_CWD_SIZE);
        old_cwd[0] = '\0';
-       
+
        zend_try {
 #ifdef PHP_WIN32
                UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
@@ -1911,7 +1914,7 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval **ret
                }
                zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, ret, 1, primary_file);
        } zend_end_try();
-       
+
        if (old_cwd[0] != '\0') {
                VCWD_CHDIR(old_cwd);
        }
@@ -1965,7 +1968,7 @@ PHPAPI int php_handle_auth_data(const char *auth TSRMLS_DC)
        } else {
                SG(request_info).auth_digest = NULL;
        }
-       
+
        if (ret == -1 && auth && auth[0] != '\0' && strncmp(auth, "Digest ", 7) == 0) {
                SG(request_info).auth_digest = estrdup(auth + 7);
                ret = 0;