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

2006-08-10 Thread Ilia Alshanetsky
iliaa   Thu Aug 10 21:49:57 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c 
  Log:
  disable realpath cache for safe_mode  open_basedir
  
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.24r2=1.640.2.25diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.24 php-src/main/main.c:1.640.2.25
--- php-src/main/main.c:1.640.2.24  Thu May 11 22:11:17 2006
+++ php-src/main/main.c Thu Aug 10 21:49:56 2006
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.24 2006/05/11 22:11:17 dmitry Exp $ */
+/* $Id: main.c,v 1.640.2.25 2006/08/10 21:49:56 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -1091,6 +1091,11 @@
zend_set_timeout(PG(max_input_time));
}
 
+   /* Disable realpath cache if safe_mode or open_basedir are set 
*/
+   if (PG(safe_mode) || (PG(open_basedir)  *PG(open_basedir))) {
+   CWDG(realpath_cache_size_limit) = 0;
+   }
+
if (PG(expose_php)) {
sapi_add_header(SAPI_PHP_VERSION_HEADER, 
sizeof(SAPI_PHP_VERSION_HEADER)-1, 1);
}

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



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

2006-04-07 Thread Dmitry Stogov
dmitry  Fri Apr  7 11:44:03 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c 
  Log:
  We don't need setup the same time-out two times.
  
  
http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.640.2.21r2=1.640.2.22diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.21 php-src/main/main.c:1.640.2.22
--- php-src/main/main.c:1.640.2.21  Tue Mar 21 08:49:42 2006
+++ php-src/main/main.c Fri Apr  7 11:44:03 2006
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.21 2006/03/21 08:49:42 dmitry Exp $ */
+/* $Id: main.c,v 1.640.2.22 2006/04/07 11:44:03 dmitry Exp $ */
 
 /* {{{ includes
  */
@@ -1719,10 +1719,12 @@
} else {
append_file_p = NULL;
}
+   if (PG(max_input_time) == -1) {
 #ifdef PHP_WIN32
-   zend_unset_timeout(TSRMLS_C);
+   zend_unset_timeout(TSRMLS_C);
 #endif
-   zend_set_timeout(INI_INT(max_execution_time));
+   zend_set_timeout(EG(timeout_seconds));
+   }
retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, 
prepend_file_p, primary_file, append_file_p) == SUCCESS);

} zend_end_try();

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



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

2006-03-13 Thread Dmitry Stogov
dmitry  Mon Mar 13 09:35:45 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c 
  Log:
  Fixed realpath() cache for main script with FastCGI SAPI
  
  
http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.640.2.18r2=1.640.2.19diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.18 php-src/main/main.c:1.640.2.19
--- php-src/main/main.c:1.640.2.18  Fri Mar 10 18:19:29 2006
+++ php-src/main/main.c Mon Mar 13 09:35:45 2006
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.18 2006/03/10 18:19:29 bfrance Exp $ */
+/* $Id: main.c,v 1.640.2.19 2006/03/13 09:35:45 dmitry Exp $ */
 
 /* {{{ includes
  */
@@ -1647,7 +1647,6 @@
 #else
char *old_cwd;
 #endif
-   char *old_primary_file_path = NULL;
int retval = 0;
 
EG(exit_status) = 0;
@@ -1684,16 +1683,15 @@
/* Only lookup the real file path and add it to the 
included_files list if already opened
 *   otherwise it will get opened and added to the 
included_files list in zend_execute_scripts
 */
-   if (primary_file-filename  primary_file-type != 
ZEND_HANDLE_FILENAME) { 
+   if (primary_file-filename 
+   primary_file-opened_path == NULL 
+   primary_file-type != ZEND_HANDLE_FILENAME) {   

int realfile_len;
int dummy = 1;
-   if (VCWD_REALPATH(primary_file-filename, realfile)) {
+
+   if (expand_filepath(primary_file-filename, realfile 
TSRMLS_CC)) {
realfile_len =  strlen(realfile);
zend_hash_add(EG(included_files), realfile, 
realfile_len+1, (void *)dummy, sizeof(int), NULL);
-   if (strncmp(realfile, primary_file-filename, 
realfile_len)) {
-   old_primary_file_path = 
primary_file-filename;
-   primary_file-filename = realfile;
-   }   
}
}
 
@@ -1722,10 +1720,6 @@
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);

-   if (old_primary_file_path) {
-   primary_file-filename = old_primary_file_path;
-   }
-   
} zend_end_try();
 
 #if HAVE_BROKEN_GETCWD

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



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

2006-03-10 Thread Brian France
bfrance Fri Mar 10 18:19:29 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c 
  Log:
  
MFH:
  for the primary file only lookup the real file path and
  add it to the included_files list if already opened
  otherwise it will get opened and added to the included_files list in 
zend_execute_scripts
  
  
  
http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.640.2.17r2=1.640.2.18diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.17 php-src/main/main.c:1.640.2.18
--- php-src/main/main.c:1.640.2.17  Thu Mar  9 20:32:22 2006
+++ php-src/main/main.c Fri Mar 10 18:19:29 2006
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.17 2006/03/09 20:32:22 pollita Exp $ */
+/* $Id: main.c,v 1.640.2.18 2006/03/10 18:19:29 bfrance Exp $ */
 
 /* {{{ includes
  */
@@ -1681,7 +1681,10 @@
VCWD_CHDIR_FILE(primary_file-filename);
}
 
-   if (primary_file-filename) {   
+   /* Only lookup the real file path and add it to the 
included_files list if already opened
+*   otherwise it will get opened and added to the 
included_files list in zend_execute_scripts
+*/
+   if (primary_file-filename  primary_file-type != 
ZEND_HANDLE_FILENAME) { 
int realfile_len;
int dummy = 1;
if (VCWD_REALPATH(primary_file-filename, realfile)) {

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



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

2006-03-09 Thread Sara Golemon
pollita Thu Mar  9 20:32:23 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c 
  Log:
  MFH: Move temporary local storage of primary file's realpath up one block to 
ensure it stays on the stack.
  
http://cvs.php.net/viewcvs.cgi/php-src/main/main.c?r1=1.640.2.16r2=1.640.2.17diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.16 php-src/main/main.c:1.640.2.17
--- php-src/main/main.c:1.640.2.16  Sun Feb 26 10:49:51 2006
+++ php-src/main/main.c Thu Mar  9 20:32:22 2006
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.16 2006/02/26 10:49:51 helly Exp $ */
+/* $Id: main.c,v 1.640.2.17 2006/03/09 20:32:22 pollita Exp $ */
 
 /* {{{ includes
  */
@@ -1662,6 +1662,8 @@
 #endif
 
zend_try {
+   char realfile[MAXPATHLEN];
+
 #ifdef PHP_WIN32
UpdateIniFromRegistry(primary_file-filename TSRMLS_CC);
 #endif
@@ -1680,7 +1682,6 @@
}
 
if (primary_file-filename) {   
-   char realfile[MAXPATHLEN];
int realfile_len;
int dummy = 1;
if (VCWD_REALPATH(primary_file-filename, realfile)) {

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



[PHP-CVS] cvs: php-src(PHP_5_1) /main main.c TSRM tsrm_virtual_cwd.c tsrm_virtual_cwd.h

2006-01-16 Thread Dmitry Stogov
dmitry  Mon Jan 16 09:09:37 2006 UTC

  Modified files:  (Branch: PHP_5_1)
/TSRM   tsrm_virtual_cwd.c tsrm_virtual_cwd.h 
/php-src/main   main.c 
  Log:
  Fixed bug #36016 (realpath cache memleaks)
  
  
http://cvs.php.net/viewcvs.cgi/TSRM/tsrm_virtual_cwd.c?r1=1.74.2.4r2=1.74.2.5diff_format=u
Index: TSRM/tsrm_virtual_cwd.c
diff -u TSRM/tsrm_virtual_cwd.c:1.74.2.4 TSRM/tsrm_virtual_cwd.c:1.74.2.5
--- TSRM/tsrm_virtual_cwd.c:1.74.2.4Sun Jan  1 12:50:00 2006
+++ TSRM/tsrm_virtual_cwd.c Mon Jan 16 09:09:37 2006
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: tsrm_virtual_cwd.c,v 1.74.2.4 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: tsrm_virtual_cwd.c,v 1.74.2.5 2006/01/16 09:09:37 dmitry Exp $ */
 
 #include sys/types.h
 #include sys/stat.h
@@ -163,18 +163,15 @@
 static void cwd_globals_ctor(virtual_cwd_globals *cwd_globals TSRMLS_DC)
 {
CWD_STATE_COPY(cwd_globals-cwd, main_cwd_state);
-#ifdef REALPATH_CACHE
cwd_globals-realpath_cache_size = 0;
cwd_globals-realpath_cache_size_limit = REALPATH_CACHE_SIZE;
cwd_globals-realpath_cache_ttl = REALPATH_CACHE_TTL;
memset(cwd_globals-realpath_cache, 0, 
sizeof(cwd_globals-realpath_cache));
-#endif
 }
 
 static void cwd_globals_dtor(virtual_cwd_globals *cwd_globals TSRMLS_DC)
 {
CWD_STATE_FREE(cwd_globals-cwd);
-#ifdef REALPATH_CACHE
{
int i;
 
@@ -187,7 +184,6 @@
}
}
}
-#endif
 }
 
 static char *tsrm_strndup(const char *s, size_t length)
@@ -308,7 +304,6 @@
return buf;
 }
 
-#ifdef REALPATH_CACHE
 static inline unsigned long realpath_cache_key(const char *path, int path_len)
 {
   register unsigned long h;
@@ -343,7 +338,8 @@
}
 }
 
-static inline realpath_cache_bucket* realpath_cache_find(const char *path, int 
path_len, time_t t TSRMLS_DC)
+//static inline 
+realpath_cache_bucket* realpath_cache_find(const char *path, int path_len, 
time_t t TSRMLS_DC)
 {
unsigned long key = realpath_cache_key(path, path_len);
unsigned long n = key % (sizeof(CWDG(realpath_cache)) / 
sizeof(CWDG(realpath_cache)[0]));
@@ -352,19 +348,18 @@
while (*bucket != NULL) {
if (CWDG(realpath_cache_ttl)  (*bucket)-expires  t) {
realpath_cache_bucket *r = *bucket;
- *bucket = (*bucket)-next;
- CWDG(realpath_cache_size) -= sizeof(realpath_cache_bucket) + 
r-path_len + 1 + r-realpath_len + 1;
- free(r);
+   *bucket = (*bucket)-next;
+   CWDG(realpath_cache_size) -= 
sizeof(realpath_cache_bucket) + r-path_len + 1 + r-realpath_len + 1;
+   free(r);
} else if (key == (*bucket)-key  path_len == 
(*bucket)-path_len 
   memcmp(path, (*bucket)-path, path_len) == 0) {
return *bucket;
} else {
-   *bucket = (*bucket)-next;
+   bucket = (*bucket)-next;
}
}
return NULL;
 }
-#endif
 
 
 /* Resolve path relatively to state and put the real path into state */
@@ -385,20 +380,17 @@
 #else
char *new_path;
 #endif
-#ifdef REALPATH_CACHE
char orig_path[MAXPATHLEN];
int orig_path_len;
realpath_cache_bucket *bucket;
time_t t;
TSRMLS_FETCH();
-#endif
 
if (path_length == 0) 
return (0);
if (path_length = MAXPATHLEN)
return (1);
 
-#ifdef REALPATH_CACHE
if (use_realpath  CWDG(realpath_cache_size_limit)) {
if (IS_ABSOLUTE_PATH(path, path_length) || (state-cwd_length  
1)) {
memcpy(orig_path, path, path_length+1);
@@ -430,7 +422,6 @@
}
}
}
-#endif
 #if !defined(TSRM_WIN32)  !defined(NETWARE)
/* cwd_length can be 0 when getcwd() fails.
 * This can happen under solaris when a dir does not have read 
permissions
@@ -609,11 +600,9 @@
 #endif
free(free_path);
 
-#ifdef REALPATH_CACHE
if (use_realpath  CWDG(realpath_cache_size_limit)) {
realpath_cache_add(orig_path, orig_path_len, state-cwd, 
state-cwd_length, t TSRMLS_CC);
}
-#endif
 
if (verify_path  verify_path(state)) {
CWD_STATE_FREE(state);
http://cvs.php.net/viewcvs.cgi/TSRM/tsrm_virtual_cwd.h?r1=1.48.2.1r2=1.48.2.2diff_format=u
Index: TSRM/tsrm_virtual_cwd.h
diff -u TSRM/tsrm_virtual_cwd.h:1.48.2.1 TSRM/tsrm_virtual_cwd.h:1.48.2.2
--- TSRM/tsrm_virtual_cwd.h:1.48.2.1Sun Jan  1 12:50:00 2006
+++ TSRM/tsrm_virtual_cwd.h Mon Jan 16 09:09:37 2006
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: tsrm_virtual_cwd.h,v 1.48.2.1 2006/01/01 12:50:00 sniper Exp $ */
+/* $Id: 

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

2005-12-06 Thread Ilia Alshanetsky
iliaa   Tue Dec  6 21:37:09 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c 
  Log:
  Better critical error handling (fix for previous html encoding patch).
  
  
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.640.2.11r2=1.640.2.12ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.11 php-src/main/main.c:1.640.2.12
--- php-src/main/main.c:1.640.2.11  Tue Dec  6 18:32:06 2005
+++ php-src/main/main.c Tue Dec  6 21:37:05 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.11 2005/12/06 23:32:06 iliaa Exp $ */
+/* $Id: main.c,v 1.640.2.12 2005/12/07 02:37:05 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -770,12 +770,14 @@
char *append_string = 
INI_STR(error_append_string);
 
if (PG(html_errors)) {
-   char *buf, *buf2;
-   int len2, len = spprintf(buf, 0, 
%sbr /\nb%s/b:  %s in b%s/b on line b%d/bbr /\n%s, 
STR_PRINT(prepend_string), error_type_str, buffer, error_filename, 
error_lineno, STR_PRINT(append_string));
-   buf2 = php_escape_html_entities(buf, 
len, len2, 0, ENT_COMPAT, NULL TSRMLS_CC);
-   php_printf(%s, buf2);
-   efree(buf);
-   efree(buf2);
+   if (type == E_ERROR) {
+   int len;
+   char *buf = 
php_escape_html_entities(buffer, buffer_len, len, 0, ENT_COMPAT, NULL 
TSRMLS_CC);
+   php_printf(%sbr 
/\nb%s/b:  %s in b%s/b on line b%d/bbr /\n%s, 
STR_PRINT(prepend_string), error_type_str, buf, error_filename, error_lineno, 
STR_PRINT(append_string));
+   efree(buf);
+   } else {
+   php_printf(%sbr 
/\nb%s/b:  %s in b%s/b on line b%d/bbr /\n%s, 
STR_PRINT(prepend_string), error_type_str, buffer, error_filename, 
error_lineno, STR_PRINT(append_string));
+   }
} else {
php_printf(%s\n%s: %s in %s on line 
%d\n%s, STR_PRINT(prepend_string), error_type_str, buffer, error_filename, 
error_lineno, STR_PRINT(append_string));
}

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



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

2005-12-05 Thread Jani Taskinen
sniper  Mon Dec  5 20:05:57 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c php_variables.h 
  Log:
  MFH
  
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.640.2.8r2=1.640.2.9ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.8 php-src/main/main.c:1.640.2.9
--- php-src/main/main.c:1.640.2.8   Thu Nov 24 19:02:11 2005
+++ php-src/main/main.c Mon Dec  5 20:05:55 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.8 2005/11/25 00:02:11 iliaa Exp $ */
+/* $Id: main.c,v 1.640.2.9 2005/12/06 01:05:55 sniper Exp $ */
 
 /* {{{ includes
  */
@@ -566,7 +566,7 @@
zval *tmp;
ALLOC_INIT_ZVAL(tmp);
ZVAL_STRINGL(tmp, buffer, buffer_len, 1);
-   zend_hash_update(EG(active_symbol_table), php_errormsg, 
sizeof(php_errormsg), (void **) tmp, sizeof(pval *), NULL);
+   zend_hash_update(EG(active_symbol_table), php_errormsg, 
sizeof(php_errormsg), (void **) tmp, sizeof(zval *), NULL);
}
efree(buffer);
 }
@@ -818,14 +818,14 @@
return;
}
if (PG(track_errors)  module_initialized  EG(active_symbol_table)) {
-   pval *tmp;
+   zval *tmp;
 
ALLOC_ZVAL(tmp);
INIT_PZVAL(tmp);
Z_STRVAL_P(tmp) = (char *) estrndup(buffer, buffer_len);
Z_STRLEN_P(tmp) = buffer_len;
Z_TYPE_P(tmp) = IS_STRING;
-   zend_hash_update(EG(active_symbol_table), php_errormsg, 
sizeof(php_errormsg), (void **)  tmp, sizeof(pval *), NULL);
+   zend_hash_update(EG(active_symbol_table), php_errormsg, 
sizeof(php_errormsg), (void **)  tmp, sizeof(zval *), NULL);
}
efree(buffer);
 }
http://cvs.php.net/diff.php/php-src/main/php_variables.h?r1=1.22r2=1.22.2.1ty=u
Index: php-src/main/php_variables.h
diff -u php-src/main/php_variables.h:1.22 php-src/main/php_variables.h:1.22.2.1
--- php-src/main/php_variables.h:1.22   Wed Aug  3 10:08:38 2005
+++ php-src/main/php_variables.hMon Dec  5 20:05:56 2005
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: php_variables.h,v 1.22 2005/08/03 14:08:38 sniper Exp $ */
+/* $Id: php_variables.h,v 1.22.2.1 2005/12/06 01:05:56 sniper Exp $ */
 
 #ifndef PHP_VARIABLES_H
 #define PHP_VARIABLES_H
@@ -34,10 +34,10 @@
 void php_treat_data(int arg, char *str, zval* destArray TSRMLS_DC);
 void php_startup_auto_globals(TSRMLS_D);
 extern PHPAPI void (*php_import_environment_variables)(zval *array_ptr 
TSRMLS_DC);
-PHPAPI void php_register_variable(char *var, char *val, pval *track_vars_array 
TSRMLS_DC);
+PHPAPI void php_register_variable(char *var, char *val, zval *track_vars_array 
TSRMLS_DC);
 /* binary-safe version */
-PHPAPI void php_register_variable_safe(char *var, char *val, int val_len, pval 
*track_vars_array TSRMLS_DC);
-PHPAPI void php_register_variable_ex(char *var, zval *val, pval 
*track_vars_array TSRMLS_DC);
+PHPAPI void php_register_variable_safe(char *var, char *val, int val_len, zval 
*track_vars_array TSRMLS_DC);
+PHPAPI void php_register_variable_ex(char *var, zval *val, zval 
*track_vars_array TSRMLS_DC);
 
 int php_hash_environment(TSRMLS_D);
 END_EXTERN_C()

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



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

2005-10-09 Thread Rob Richards
rrichards   Sun Oct  9 22:26:57 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c 
  Log:
  MFH: PHP_CONFIG_FILE_PATH needs to use strlen() due to Win build
  
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.640.2.5r2=1.640.2.6ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.5 php-src/main/main.c:1.640.2.6
--- php-src/main/main.c:1.640.2.5   Wed Sep 14 16:08:31 2005
+++ php-src/main/main.c Sun Oct  9 22:26:56 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.5 2005/09/14 20:08:31 derick Exp $ */
+/* $Id: main.c,v 1.640.2.6 2005/10/10 02:26:56 rrichards Exp $ */
 
 /* {{{ includes
  */
@@ -1468,7 +1468,7 @@
REGISTER_MAIN_STRINGL_CONSTANT(PHP_DATADIR, PHP_DATADIR, 
sizeof(PHP_DATADIR)-1, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_STRINGL_CONSTANT(PHP_SYSCONFDIR, PHP_SYSCONFDIR, 
sizeof(PHP_SYSCONFDIR)-1, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_STRINGL_CONSTANT(PHP_LOCALSTATEDIR, PHP_LOCALSTATEDIR, 
sizeof(PHP_LOCALSTATEDIR)-1, CONST_PERSISTENT | CONST_CS);
-   REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_PATH, 
PHP_CONFIG_FILE_PATH, sizeof(PHP_CONFIG_FILE_PATH)-1, CONST_PERSISTENT | 
CONST_CS);
+   REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_PATH, 
PHP_CONFIG_FILE_PATH, strlen(PHP_CONFIG_FILE_PATH), CONST_PERSISTENT | 
CONST_CS);
REGISTER_MAIN_STRINGL_CONSTANT(PHP_CONFIG_FILE_SCAN_DIR, 
PHP_CONFIG_FILE_SCAN_DIR, sizeof(PHP_CONFIG_FILE_SCAN_DIR)-1, CONST_PERSISTENT 
| CONST_CS);
REGISTER_MAIN_STRINGL_CONSTANT(PHP_SHLIB_SUFFIX, PHP_SHLIB_SUFFIX, 
sizeof(PHP_SHLIB_SUFFIX)-1, CONST_PERSISTENT | CONST_CS);
REGISTER_MAIN_STRINGL_CONSTANT(PHP_EOL, PHP_EOL, sizeof(PHP_EOL)-1, 
CONST_PERSISTENT | CONST_CS);

-- 
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_1) /main main.c

2005-09-14 Thread Jani Taskinen


 You forgot HEAD. And documentatation. And NEWS.

 --Jani

On Wed, 14 Sep 2005, Derick Rethans wrote:



derick  Wed Sep 14 16:08:35 2005 EDT

 Modified files:  (Branch: PHP_5_1)
   /php-src/mainmain.c
 Log:
 - Fixed shutdown order before RC2.


http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.640.2.4r2=1.640.2.5ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.4 php-src/main/main.c:1.640.2.5
--- php-src/main/main.c:1.640.2.4   Fri Sep  2 10:05:45 2005
+++ php-src/main/main.c Wed Sep 14 16:08:31 2005
@@ -18,7 +18,7 @@
   +--+
*/

-/* $Id: main.c,v 1.640.2.4 2005/09/02 14:05:45 sniper Exp $ */
+/* $Id: main.c,v 1.640.2.5 2005/09/14 20:08:31 derick Exp $ */

/* {{{ includes
 */
@@ -1200,16 +1200,16 @@
EG(opline_ptr) = NULL;
EG(active_op_array) = NULL;

-   /* 1. Call all possible __destruct() functions */
-   zend_try {
-   zend_call_destructors(TSRMLS_C);
-   } zend_end_try();
-
-   /* 2. Call all possible shutdown functions registered with 
register_shutdown_function() */
+   /* 1. Call all possible shutdown functions registered with 
register_shutdown_function() */
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);
+   } zend_end_try();
+
/* 3. Flush all output buffers */
zend_try {

php_end_ob_buffers((zend_bool)(SG(request_info).headers_only?0:1) TSRMLS_CC);




--
Donate @ http://pecl.php.net/wishlist.php/sniper

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



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

2005-09-02 Thread Jani Taskinen
sniper  Fri Sep  2 10:05:47 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c php_ini.c php_ini.h 
  Log:
  Revert
  
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.640.2.3r2=1.640.2.4ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.3 php-src/main/main.c:1.640.2.4
--- php-src/main/main.c:1.640.2.3   Thu Sep  1 10:44:14 2005
+++ php-src/main/main.c Fri Sep  2 10:05:45 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.3 2005/09/01 14:44:14 sniper Exp $ */
+/* $Id: main.c,v 1.640.2.4 2005/09/02 14:05:45 sniper Exp $ */
 
 /* {{{ includes
  */
@@ -1415,17 +1415,6 @@
 
le_index_ptr = zend_register_list_destructors_ex(NULL, NULL, index 
pointer, 0);
 
-   /* Initialize configuration_hash */
-   if (php_init_config_hash() == FAILURE) {
-   return FAILURE;
-   }
-   
-   /* Register PHP core ini entries */
-   REGISTER_INI_ENTRIES();
-   
-   /* Register Zend ini entries */
-   zend_register_standard_ini_entries(TSRMLS_C);
-
/* this will read in php.ini, set up the configuration parameters,
   load zend extensions and register php function extensions 
   to be loaded later */
@@ -1433,6 +1422,12 @@
return FAILURE;
}
 
+   /* Register PHP core ini entries */
+   REGISTER_INI_ENTRIES();
+
+   /* Register Zend ini entries */
+   zend_register_standard_ini_entries(TSRMLS_C);
+
/* Disable realpath cache if safe_mode or open_basedir are set */
if (PG(safe_mode) || (PG(open_basedir)  *PG(open_basedir))) {
CWDG(realpath_cache_size_limit) = 0;
http://cvs.php.net/diff.php/php-src/main/php_ini.c?r1=1.136.2.2r2=1.136.2.3ty=u
Index: php-src/main/php_ini.c
diff -u php-src/main/php_ini.c:1.136.2.2 php-src/main/php_ini.c:1.136.2.3
--- php-src/main/php_ini.c:1.136.2.2Fri Sep  2 04:24:14 2005
+++ php-src/main/php_ini.c  Fri Sep  2 10:05:45 2005
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_ini.c,v 1.136.2.2 2005/09/02 08:24:14 sniper Exp $ */
+/* $Id: php_ini.c,v 1.136.2.3 2005/09/02 14:05:45 sniper Exp $ */
 
 #include php.h
 #include ext/standard/info.h
@@ -254,14 +254,6 @@
 }
 /* }}} */
 
-/* {{{ php_init_config_hash
- */
-int php_init_config_hash(void)
-{
-   return zend_hash_init(configuration_hash, 0, NULL, (dtor_func_t) 
pvalue_config_destructor, 1);
-}
-/* }}} */
-
 /* {{{ php_init_config
  */
 int php_init_config(TSRMLS_D)
@@ -278,6 +270,10 @@
int l, total_l=0;
zend_llist_element *element;
 
+   if (zend_hash_init(configuration_hash, 0, NULL, (dtor_func_t) 
pvalue_config_destructor, 1) == FAILURE) {
+   return FAILURE;
+   }
+
if (sapi_module.ini_defaults) {
sapi_module.ini_defaults(configuration_hash);
}
http://cvs.php.net/diff.php/php-src/main/php_ini.h?r1=1.45.2.1r2=1.45.2.2ty=u
Index: php-src/main/php_ini.h
diff -u php-src/main/php_ini.h:1.45.2.1 php-src/main/php_ini.h:1.45.2.2
--- php-src/main/php_ini.h:1.45.2.1 Thu Sep  1 10:44:15 2005
+++ php-src/main/php_ini.h  Fri Sep  2 10:05:46 2005
@@ -16,7 +16,7 @@
+--+
 */
 
-/* $Id: php_ini.h,v 1.45.2.1 2005/09/01 14:44:15 sniper Exp $ */
+/* $Id: php_ini.h,v 1.45.2.2 2005/09/02 14:05:46 sniper Exp $ */
 
 #ifndef PHP_INI_H
 #define PHP_INI_H
@@ -24,7 +24,6 @@
 #include zend_ini.h
 
 BEGIN_EXTERN_C()
-int php_init_config_hash(void);
 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



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

2005-08-17 Thread Jani Taskinen
sniper  Wed Aug 17 03:54:08 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c 
  Log:
  MFH
  
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.640.2.1r2=1.640.2.2ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.1 php-src/main/main.c:1.640.2.2
--- php-src/main/main.c:1.640.2.1   Tue Aug 16 14:10:34 2005
+++ php-src/main/main.c Wed Aug 17 03:54:07 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.1 2005/08/16 18:10:34 helly Exp $ */
+/* $Id: main.c,v 1.640.2.2 2005/08/17 07:54:07 sniper Exp $ */
 
 /* {{{ includes
  */
@@ -352,7 +352,7 @@
return;
}
 #endif
-   log_file = VCWD_FOPEN(PG(error_log), a);
+   log_file = VCWD_FOPEN(PG(error_log), ab);
if (log_file != NULL) {
time(error_time);
strftime(error_time_str, sizeof(error_time_str), 
%d-%b-%Y %H:%M:%S, php_localtime_r(error_time, tmbuf)); 

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



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

2005-08-16 Thread Marcus Boerger
helly   Tue Aug 16 14:10:35 2005 EDT

  Modified files:  (Branch: PHP_5_1)
/php-src/main   main.c 
  Log:
  - Prevent E_STRICT from ending up as exception
  
http://cvs.php.net/diff.php/php-src/main/main.c?r1=1.640r2=1.640.2.1ty=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640 php-src/main/main.c:1.640.2.1
--- php-src/main/main.c:1.640   Fri Aug  5 17:44:26 2005
+++ php-src/main/main.c Tue Aug 16 14:10:34 2005
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640 2005/08/05 21:44:26 sniper Exp $ */
+/* $Id: main.c,v 1.640.2.1 2005/08/16 18:10:34 helly Exp $ */
 
 /* {{{ includes
  */
@@ -657,6 +657,9 @@
case E_PARSE:
/* fatal errors are real errors and cannot be 
made exceptions */
break;
+   case E_STRICT:
+   /* for the sake of BC to old damaged code */
+   break;
case E_NOTICE:
case E_USER_NOTICE:
/* notices are no errors and are not treated as 
such like E_WARNINGS */

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