]> granicus.if.org Git - php/commitdiff
- Make the INI entries sorted in phpinfo()
authorZeev Suraski <zeev@php.net>
Sat, 3 Jun 2000 03:05:29 +0000 (03:05 +0000)
committerZeev Suraski <zeev@php.net>
Sat, 3 Jun 2000 03:05:29 +0000 (03:05 +0000)
TODO
ext/standard/info.c
main/main.c
main/php_ini.c
main/php_ini.h

diff --git a/TODO b/TODO
index 32c7d5d46f0255182d6cf49aaaed166ebb6e2896..f4a13c50b61a07fb5640160e8fd52159fe9e78d8 100644 (file)
--- a/TODO
+++ b/TODO
@@ -9,7 +9,6 @@ Zend
 
 global
 ------
-    * sort ini entries so that phpinfo() show them in some nice order.
     * make everything on the language-level independent of your locale setings.
     * allow methods to be called as callbacks. eg: array_walk($myarray,"this->print()");
     * always build the standalone executable as well as the chosen SAPI 
index 58637bbcb40fe2ea56e3667680479c7e6c99d0f2..4b44feff2acc7480c0acf7b0a408dbd03484565d 100644 (file)
@@ -228,6 +228,7 @@ PHPAPI void php_print_info(int flag)
                PUTS("</a>\n");
        }
 
+       php_ini_sort_entries();
 
        if (flag & PHP_INFO_CONFIGURATION) {
                php_info_print_hr();
index 2aee2042d0e38dc39094b5dd6ba85d438b02bb78..c02a34c8433a7a5e7b8ed80f3dd774b89b4baf53 100644 (file)
@@ -384,6 +384,24 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
                                        PUTS(append_string);
                                }               
                        }
+#if ZEND_DEBUG
+                       {
+                               zend_bool trigger_break;
+
+                               switch (type) {
+                                       case E_ERROR:
+                                       case E_CORE_ERROR:
+                                       case E_COMPILE_ERROR:
+                                       case E_USER_ERROR:
+                                               trigger_break=1;
+                                               break;
+                                       default:
+                                               trigger_break=0;
+                                               break;
+                               }
+                               zend_output_debug_string(trigger_break, "%s(%d) : %s - %s", error_filename, error_lineno, error_type_str, buffer);
+                       }
+#endif
                }
        }
 
@@ -668,6 +686,10 @@ void php_request_shutdown(void *dummy)
        SLS_FETCH();
        PLS_FETCH();
 
+       if (setjmp(EG(bailout))!=0) {
+               return;
+       }
+
        sapi_send_headers();
        php_end_ob_buffering(SG(request_info).headers_only?0:1);
 
index b6be054bcc3a117ccfbc5234e3a95a74a40072a0..44e7347bb3bb055e3a4a368beadf34633b02175a 100644 (file)
@@ -82,6 +82,32 @@ int php_ini_rshutdown()
        return SUCCESS;
 }
 
+
+static int ini_key_compare(const void *a, const void *b)
+{
+       Bucket *f;
+       Bucket *s;
+       f = *((Bucket **) a);
+       s = *((Bucket **) b);
+
+       if (f->nKeyLength==0 && s->nKeyLength==0) { /* both numeric */
+               return ZEND_NORMALIZE_BOOL(f->nKeyLength - s->nKeyLength);
+       } else if (f->nKeyLength==0) { /* f is numeric, s is not */
+               return -1;
+       } else if (s->nKeyLength==0) { /* s is numeric, f is not */
+               return 1;
+       } else { /* both strings */
+               return zend_binary_strcasecmp(f->arKey, f->nKeyLength, s->arKey, s->nKeyLength);
+       }
+}
+
+
+void php_ini_sort_entries()
+{
+       zend_hash_sort(&known_directives, qsort, ini_key_compare, 0);
+}
+
 /*
  * Registration / unregistration
  */
index 09669624bfc7647c9bf9716fcdcd9dc2b96ff524..47965baaa51bfe27049ddc5ed7f5a4c08b59e6a3 100644 (file)
@@ -55,6 +55,8 @@ int php_ini_mstartup(void);
 int php_ini_mshutdown(void);
 int php_ini_rshutdown(void);
 
+void php_ini_sort_entries();
+
 PHPAPI int php_register_ini_entries(php_ini_entry *ini_entry, int module_number);
 PHPAPI void php_unregister_ini_entries(int module_number);
 PHPAPI void php_ini_refresh_caches(int stage);