[PHP-CVS] cvs: php-src(PHP_5_3) /main php_ini.c

2008-12-30 Thread Marcus Boerger
helly   Tue Dec 30 19:08:54 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/main   php_ini.c 
  Log:
  - MFH Do not show empty ini directive tables for modules without ini entries.
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.136.2.4.2.15.2.11&r2=1.136.2.4.2.15.2.12&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.136.2.4.2.15.2.11 
php-src/main/php_ini.c:1.136.2.4.2.15.2.12
--- php-src/main/php_ini.c:1.136.2.4.2.15.2.11  Wed Aug 13 17:49:13 2008
+++ php-src/main/php_ini.c  Tue Dec 30 19:08:54 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_ini.c,v 1.136.2.4.2.15.2.11 2008/08/13 17:49:13 pajoye Exp $ */
+/* $Id: php_ini.c,v 1.136.2.4.2.15.2.12 2008/12/30 19:08:54 helly Exp $ */
 
 #include "php.h"
 #include "ext/standard/info.h"
@@ -132,11 +132,24 @@
 }
 /* }}} */
 
+/* {{{ php_ini_available
+ */
+static int php_ini_available(zend_ini_entry *ini_entry, int 
*module_number_available TSRMLS_DC)
+{
+   if (ini_entry->module_number == *module_number_available) {
+   *module_number_available = -1;
+   return ZEND_HASH_APPLY_STOP;
+   } else {
+   return ZEND_HASH_APPLY_KEEP;
+   }
+}
+/* }}} */
+
 /* {{{ display_ini_entries
  */
 PHPAPI void display_ini_entries(zend_module_entry *module)
 {
-   int module_number;
+   int module_number, module_number_available;
TSRMLS_FETCH();
 
if (module) {
@@ -144,10 +157,14 @@
} else {
module_number = 0;
}
-   php_info_print_table_start();
-   php_info_print_table_header(3, "Directive", "Local Value", "Master 
Value");
-   zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) 
php_ini_displayer, (void *) (zend_intptr_t) module_number TSRMLS_CC);
-   php_info_print_table_end();
+   module_number_available = module_number;
+   zend_hash_apply_with_argument(EG(ini_directives), (apply_func_arg_t) 
php_ini_available, &module_number_available TSRMLS_CC);
+   if (module_number_available == -1) {
+   php_info_print_table_start();
+   php_info_print_table_header(3, "Directive", "Local Value", 
"Master Value");
+   zend_hash_apply_with_argument(EG(ini_directives), 
(apply_func_arg_t) php_ini_displayer, (void *) (zend_intptr_t) module_number 
TSRMLS_CC);
+   php_info_print_table_end();
+   }
 }
 /* }}} */
 



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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /main php_ini.c

2008-08-13 Thread Pierre Joye
hi Jani,

On Wed, Aug 13, 2008 at 9:58 PM, Jani Taskinen <[EMAIL PROTECTED]> wrote:
> So the build was only broken for PHP_5_3 and not HEAD and PHP_5_2?

I admit that I did not check 5.2, but did not find this code in HEAD.
Checking again :)

Cheers,
-- 
Pierre

http://blog.thepimp.net | http://www.libgd.org

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



Re: [PHP-CVS] cvs: php-src(PHP_5_3) /main php_ini.c

2008-08-13 Thread Jani Taskinen

So the build was only broken for PHP_5_3 and not HEAD and PHP_5_2?

--Jani


Pierre-Alain Joye [EMAIL PROTECTED] kirjoitti: 

pajoye  Wed Aug 13 17:49:14 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/main	php_ini.c 
  Log:

  - move declaration on top and fix build error
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.136.2.4.2.15.2.10&r2=1.136.2.4.2.15.2.11&diff_format=u

Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.136.2.4.2.15.2.10 
php-src/main/php_ini.c:1.136.2.4.2.15.2.11
--- php-src/main/php_ini.c:1.136.2.4.2.15.2.10  Wed Aug 13 00:53:28 2008
+++ php-src/main/php_ini.c  Wed Aug 13 17:49:13 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_ini.c,v 1.136.2.4.2.15.2.10 2008/08/13 00:53:28 jani Exp $ */

+/* $Id: php_ini.c,v 1.136.2.4.2.15.2.11 2008/08/13 17:49:13 pajoye Exp $ */
 
 #include "php.h"

 #include "ext/standard/info.h"
@@ -340,6 +340,7 @@
 {
char *php_ini_file_name = NULL;
char *php_ini_search_path = NULL;
+   int php_ini_scanned_path_len;
int safe_mode_state;
char *open_basedir;
int free_ini_search_path = 0;
@@ -602,7 +603,7 @@
/* Or fall back using possible --with-config-file-scan-dir 
setting (defaults to empty string!) */
php_ini_scanned_path = PHP_CONFIG_FILE_SCAN_DIR;
}
-   int php_ini_scanned_path_len = strlen(php_ini_scanned_path);
+   php_ini_scanned_path_len = strlen(php_ini_scanned_path);
 
 	/* Scan and parse any .ini files found in scan path if path not empty. */

if (!sapi_module.php_ini_ignore && php_ini_scanned_path_len) {



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





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



[PHP-CVS] cvs: php-src(PHP_5_3) /main php_ini.c

2008-08-13 Thread Pierre-Alain Joye
pajoye  Wed Aug 13 17:49:14 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/main   php_ini.c 
  Log:
  - move declaration on top and fix build error
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.136.2.4.2.15.2.10&r2=1.136.2.4.2.15.2.11&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.136.2.4.2.15.2.10 
php-src/main/php_ini.c:1.136.2.4.2.15.2.11
--- php-src/main/php_ini.c:1.136.2.4.2.15.2.10  Wed Aug 13 00:53:28 2008
+++ php-src/main/php_ini.c  Wed Aug 13 17:49:13 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_ini.c,v 1.136.2.4.2.15.2.10 2008/08/13 00:53:28 jani Exp $ */
+/* $Id: php_ini.c,v 1.136.2.4.2.15.2.11 2008/08/13 17:49:13 pajoye Exp $ */
 
 #include "php.h"
 #include "ext/standard/info.h"
@@ -340,6 +340,7 @@
 {
char *php_ini_file_name = NULL;
char *php_ini_search_path = NULL;
+   int php_ini_scanned_path_len;
int safe_mode_state;
char *open_basedir;
int free_ini_search_path = 0;
@@ -602,7 +603,7 @@
/* Or fall back using possible --with-config-file-scan-dir 
setting (defaults to empty string!) */
php_ini_scanned_path = PHP_CONFIG_FILE_SCAN_DIR;
}
-   int php_ini_scanned_path_len = strlen(php_ini_scanned_path);
+   php_ini_scanned_path_len = strlen(php_ini_scanned_path);
 
/* Scan and parse any .ini files found in scan path if path not empty. 
*/
if (!sapi_module.php_ini_ignore && php_ini_scanned_path_len) {



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



[PHP-CVS] cvs: php-src(PHP_5_3) /main php_ini.c php_ini.h /sapi/cgi cgi_main.c

2008-04-15 Thread Dmitry Stogov
dmitry  Tue Apr 15 11:31:58 2008 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/main   php_ini.c php_ini.h 
/php-src/sapi/cgi   cgi_main.c 
  Log:
  Optimized request startup sequence for php.ini without per dir and per host 
configurations
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.136.2.4.2.15.2.7&r2=1.136.2.4.2.15.2.8&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.136.2.4.2.15.2.7 
php-src/main/php_ini.c:1.136.2.4.2.15.2.8
--- php-src/main/php_ini.c:1.136.2.4.2.15.2.7   Sun Feb  3 14:35:59 2008
+++ php-src/main/php_ini.c  Tue Apr 15 11:31:58 2008
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_ini.c,v 1.136.2.4.2.15.2.7 2008/02/03 14:35:59 helly Exp $ */
+/* $Id: php_ini.c,v 1.136.2.4.2.15.2.8 2008/04/15 11:31:58 dmitry Exp $ */
 
 #include "php.h"
 #include "ext/standard/info.h"
@@ -50,6 +50,8 @@
 static int is_special_section = 0;
 static HashTable *active_ini_hash;
 static HashTable configuration_hash;
+static int has_per_dir_config = 0;
+static int has_per_host_config = 0;
 PHPAPI char *php_ini_opened_path=NULL;
 static php_extension_lists extension_lists;
 PHPAPI char *php_ini_scanned_files=NULL;
@@ -264,6 +266,7 @@
key = key + sizeof("PATH") - 1;
key_len = Z_STRLEN_P(arg1) - 
sizeof("PATH") + 1;
is_special_section = 1;
+   has_per_dir_config = 1;
 
/* HOST sections */
} else if (!strncasecmp(Z_STRVAL_P(arg1), 
"HOST", sizeof("HOST") - 1)) {
@@ -271,6 +274,8 @@
key = key + sizeof("HOST") - 1;
key_len = Z_STRLEN_P(arg1) - 
sizeof("HOST") + 1;
is_special_section = 1;
+   has_per_host_config = 1;
+
} else {
is_special_section = 0;
}
@@ -737,6 +742,14 @@
 }
 /* }}} */
 
+/* {{{ php_ini_has_per_dir_config
+ */
+PHPAPI int php_ini_has_per_dir_config(void)
+{
+   return has_per_dir_config;
+}
+/* }}} */
+
 /* {{{ php_ini_activate_per_dir_config
  */
 PHPAPI void php_ini_activate_per_dir_config(char *path, uint path_len 
TSRMLS_DC)
@@ -745,7 +758,7 @@
char *ptr;
 
/* Walk through each directory in path and apply any found 
per-dir-system-configuration from configuration_hash */
-   if (path && path_len) {
+   if (has_per_dir_config && path && path_len) {
ptr = path + 1;
while ((ptr = strchr(ptr, DEFAULT_SLASH)) != NULL) {
*ptr = 0;
@@ -760,13 +773,21 @@
 }
 /* }}} */
 
+/* {{{ php_ini_has_per_host_config
+ */
+PHPAPI int php_ini_has_per_host_config(void)
+{
+   return has_per_host_config;
+}
+/* }}} */
+
 /* {{{ php_ini_activate_per_host_config
  */
 PHPAPI void php_ini_activate_per_host_config(char *host, uint host_len 
TSRMLS_DC)
 {
zval *tmp;
 
-   if (host && host_len) {
+   if (has_per_host_config && host && host_len) {
/* Search for source array matching the host from 
configuration_hash */
if (zend_hash_find(&configuration_hash, host, host_len, (void 
**) &tmp) == SUCCESS) {
php_ini_activate_config(Z_ARRVAL_P(tmp), 
PHP_INI_SYSTEM, PHP_INI_STAGE_ACTIVATE TSRMLS_CC);
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.h?r1=1.45.2.3.2.3.2.6&r2=1.45.2.3.2.3.2.7&diff_format=u
Index: php-src/main/php_ini.h
diff -u php-src/main/php_ini.h:1.45.2.3.2.3.2.6 
php-src/main/php_ini.h:1.45.2.3.2.3.2.7
--- php-src/main/php_ini.h:1.45.2.3.2.3.2.6 Sun Feb  3 14:48:38 2008
+++ php-src/main/php_ini.h  Tue Apr 15 11:31:58 2008
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_ini.h,v 1.45.2.3.2.3.2.6 2008/02/03 14:48:38 helly Exp $ */
+/* $Id: php_ini.h,v 1.45.2.3.2.3.2.7 2008/04/15 11:31:58 dmitry Exp $ */
 
 #ifndef PHP_INI_H
 #define PHP_INI_H
@@ -34,6 +34,8 @@
 PHPAPI int cfg_get_string(char *varname, char **result);
 PHPAPI int php_parse_user_ini_file(char *dirname, char *ini_filename, 
HashTable *target_hash TSRMLS_DC);
 PHPAPI void php_ini_activate_config(HashTable *source_hash, int modify_type, 
int stage TSRMLS_DC);
+PHPAPI int php_ini_has_per_dir_config(void);
+PHPAPI int php_ini_has_per_host_config(void);
 PHPAPI void php_ini_activate_per_dir_config(char *path, uint path_len 
TSRMLS_DC);
 PHPAPI void php_ini_activate_per_host_config(char *host, uint host_len 
TSRMLS_DC);
 PHPAPI HashTable* php_ini_get_configuration_hash(void);
http://cvs.php.net/viewvc.cgi/php-src/sapi/cgi/cgi_main.c?r1=1.267.2.15.2.50.2.17&r2=1.267.2.15.2.50.2.18&diff_format=u
Index: php

[PHP-CVS] cvs: php-src(PHP_5_3) /main php_ini.c

2007-11-26 Thread Jani Taskinen
janiMon Nov 26 16:34:30 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/main   php_ini.c 
  Log:
  MFH: No zval is stored here
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.136.2.4.2.15.2.4&r2=1.136.2.4.2.15.2.5&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.136.2.4.2.15.2.4 
php-src/main/php_ini.c:1.136.2.4.2.15.2.5
--- php-src/main/php_ini.c:1.136.2.4.2.15.2.4   Fri Nov  9 16:27:43 2007
+++ php-src/main/php_ini.c  Mon Nov 26 16:34:30 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_ini.c,v 1.136.2.4.2.15.2.4 2007/11/09 16:27:43 jani Exp $ */
+/* $Id: php_ini.c,v 1.136.2.4.2.15.2.5 2007/11/26 16:34:30 jani Exp $ */
 
 #include "php.h"
 #include "ext/standard/info.h"
@@ -348,7 +348,7 @@
}
 
zend_llist_init(&extension_lists.engine, sizeof(char *), 
(llist_dtor_func_t) free_estring, 1);
-   zend_llist_init(&extension_lists.functions, sizeof(zval), 
(llist_dtor_func_t) free_estring, 1);
+   zend_llist_init(&extension_lists.functions, sizeof(char *), 
(llist_dtor_func_t) free_estring, 1);
 
safe_mode_state = PG(safe_mode);
open_basedir = PG(open_basedir);

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



[PHP-CVS] cvs: php-src(PHP_5_3) /main php_ini.c php_ini.h

2007-09-28 Thread Jani Taskinen
janiFri Sep 28 10:23:38 2007 UTC

  Modified files:  (Branch: PHP_5_3)
/php-src/main   php_ini.c php_ini.h 
  Log:
  MFH: Fixed win32 build.
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.c?r1=1.136.2.4.2.15.2.1&r2=1.136.2.4.2.15.2.2&diff_format=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.136.2.4.2.15.2.1 
php-src/main/php_ini.c:1.136.2.4.2.15.2.2
--- php-src/main/php_ini.c:1.136.2.4.2.15.2.1   Fri Sep 28 02:05:09 2007
+++ php-src/main/php_ini.c  Fri Sep 28 10:23:38 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_ini.c,v 1.136.2.4.2.15.2.1 2007/09/28 02:05:09 jani Exp $ */
+/* $Id: php_ini.c,v 1.136.2.4.2.15.2.2 2007/09/28 10:23:38 jani Exp $ */
 
 #include "php.h"
 #include "ext/standard/info.h"
@@ -164,7 +164,7 @@
 
 /* {{{ config_zval_dtor
  */
-void config_zval_dtor(zval *zvalue)
+PHPAPI void config_zval_dtor(zval *zvalue)
 {
if (Z_TYPE_P(zvalue) == IS_ARRAY) {
zend_hash_destroy(Z_ARRVAL_P(zvalue));
http://cvs.php.net/viewvc.cgi/php-src/main/php_ini.h?r1=1.45.2.3.2.3.2.1&r2=1.45.2.3.2.3.2.2&diff_format=u
Index: php-src/main/php_ini.h
diff -u php-src/main/php_ini.h:1.45.2.3.2.3.2.1 
php-src/main/php_ini.h:1.45.2.3.2.3.2.2
--- php-src/main/php_ini.h:1.45.2.3.2.3.2.1 Fri Sep 28 02:05:09 2007
+++ php-src/main/php_ini.h  Fri Sep 28 10:23:38 2007
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_ini.h,v 1.45.2.3.2.3.2.1 2007/09/28 02:05:09 jani Exp $ */
+/* $Id: php_ini.h,v 1.45.2.3.2.3.2.2 2007/09/28 10:23:38 jani Exp $ */
 
 #ifndef PHP_INI_H
 #define PHP_INI_H
@@ -24,7 +24,7 @@
 #include "zend_ini.h"
 
 BEGIN_EXTERN_C()
-void config_zval_dtor(zval *zvalue);
+PHPAPI void config_zval_dtor(zval *zvalue);
 int php_init_config(TSRMLS_D);
 int php_shutdown_config(void);
 void php_ini_register_extensions(TSRMLS_D);

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