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

2007-04-06 Thread Ilia Alshanetsky
iliaa   Fri Apr  6 13:58:48 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main   main.c 
  Log:
  Avoid locks when appening to the error log file
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.32r2=1.640.2.23.2.33diff_format=u
Index: php-src/main/main.c
diff -u php-src/main/main.c:1.640.2.23.2.32 php-src/main/main.c:1.640.2.23.2.33
--- php-src/main/main.c:1.640.2.23.2.32 Sun Apr  1 19:29:42 2007
+++ php-src/main/main.c Fri Apr  6 13:58:48 2007
@@ -18,7 +18,7 @@
+--+
 */
 
-/* $Id: main.c,v 1.640.2.23.2.32 2007/04/01 19:29:42 iliaa Exp $ */
+/* $Id: main.c,v 1.640.2.23.2.33 2007/04/06 13:58:48 iliaa Exp $ */
 
 /* {{{ includes
  */
@@ -27,6 +27,7 @@
 
 #include php.h
 #include stdio.h
+#include fcntl.h
 #ifdef PHP_WIN32
 #include win32/time.h
 #include win32/signal.h
@@ -59,10 +60,8 @@
 #include ext/standard/php_standard.h
 #include php_variables.h
 #include ext/standard/credits.h
-#include ext/standard/flock_compat.h
 #ifdef PHP_WIN32
 #include io.h
-#include fcntl.h
 #include win32/php_registry.h
 #endif
 #include php_syslog.h
@@ -343,7 +342,7 @@
  */
 PHPAPI void php_log_err(char *log_message TSRMLS_DC)
 {
-   FILE *log_file;
+   int fd = -1;
char error_time_str[128];
struct tm tmbuf;
time_t error_time;
@@ -356,13 +355,16 @@
return;
}
 #endif
-   log_file = VCWD_FOPEN(PG(error_log), ab);
-   if (log_file != NULL) {
+   fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | 
O_WRONLY, 0644);
+   if (fd != -1) {
+   char *tmp;
+   int len;
time(error_time);
strftime(error_time_str, sizeof(error_time_str), 
%d-%b-%Y %H:%M:%S, php_localtime_r(error_time, tmbuf));
-   php_flock(fileno(log_file), 2);
-   fprintf(log_file, [%s] %s%s, error_time_str, 
log_message, PHP_EOL);
-   fclose(log_file);
+   len = spprintf(tmp, 0, [%s] %s%s, error_time_str, 
log_message, PHP_EOL);
+   write(fd, tmp, len);
+   efree(tmp); 
+   close(fd);
return;
}
}

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

2007-04-06 Thread Marcus Boerger
Hello Ilia,

  care to MFB your latest changes?

best regards
marcus

Friday, April 6, 2007, 3:58:48 PM, you wrote:

 iliaa   Fri Apr  6 13:58:48 2007 UTC

   Modified files:  (Branch: PHP_5_2)
 /php-src/main   main.c 
   Log:
   Avoid locks when appening to the error log file
   
   
 http://cvs.php.net/viewvc.cgi/php-src/main/main.c?r1=1.640.2.23.2.32r2=1.640.2.23.2.33diff_format=u
 Index: php-src/main/main.c
 diff -u php-src/main/main.c:1.640.2.23.2.32 
 php-src/main/main.c:1.640.2.23.2.33
 --- php-src/main/main.c:1.640.2.23.2.32   Sun Apr  1 19:29:42 2007
 +++ php-src/main/main.c   Fri Apr  6 13:58:48 2007
 @@ -18,7 +18,7 @@
 +--+
  */
  
 -/* $Id: main.c,v 1.640.2.23.2.32 2007/04/01 19:29:42 iliaa Exp $ */
 +/* $Id: main.c,v 1.640.2.23.2.33 2007/04/06 13:58:48 iliaa Exp $ */
  
  /* {{{ includes
   */
 @@ -27,6 +27,7 @@
  
  #include php.h
  #include stdio.h
 +#include fcntl.h
  #ifdef PHP_WIN32
  #include win32/time.h
  #include win32/signal.h
 @@ -59,10 +60,8 @@
  #include ext/standard/php_standard.h
  #include php_variables.h
  #include ext/standard/credits.h
 -#include ext/standard/flock_compat.h
  #ifdef PHP_WIN32
  #include io.h
 -#include fcntl.h
  #include win32/php_registry.h
  #endif
  #include php_syslog.h
 @@ -343,7 +342,7 @@
   */
  PHPAPI void php_log_err(char *log_message TSRMLS_DC)
  {
 -   FILE *log_file;
 +   int fd = -1;
 char error_time_str[128];
 struct tm tmbuf;
 time_t error_time;
 @@ -356,13 +355,16 @@
 return;
 }
  #endif
 -   log_file = VCWD_FOPEN(PG(error_log), ab);
 -   if (log_file != NULL) {
 +   fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | 
 O_WRONLY, 0644);
 +   if (fd != -1) {
 +   char *tmp;
 +   int len;
 time(error_time);
 strftime(error_time_str, sizeof(error_time_str),
 %d-%b-%Y %H:%M:%S, php_localtime_r(error_time, tmbuf));
 -   php_flock(fileno(log_file), 2);
 -   fprintf(log_file, [%s] %s%s, error_time_str, 
 log_message, PHP_EOL);
 -   fclose(log_file);
 +   len = spprintf(tmp, 0, [%s] %s%s,
 error_time_str, log_message, PHP_EOL);
 +   write(fd, tmp, len);
 +   efree(tmp); 
 +   close(fd);
 return;
 }
 }




Best regards,
 Marcus

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/spl spl_array.c /ext/spl/tests bug40442.phpt

2007-04-06 Thread Marcus Boerger
helly   Fri Apr  6 15:32:29 2007 UTC

  Added files: (Branch: PHP_5_2)
/php-src/ext/spl/tests  bug40442.phpt 

  Modified files:  
/php-src/ext/splspl_array.c 
  Log:
  - Fix #40442
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.123r2=1.124diff_format=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.123 php-src/ext/spl/spl_array.c:1.124
--- php-src/ext/spl/spl_array.c:1.123   Sat Mar 24 16:28:45 2007
+++ php-src/ext/spl/spl_array.c Fri Apr  6 15:32:29 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_array.c,v 1.123 2007/03/24 16:28:45 helly Exp $ */
+/* $Id: spl_array.c,v 1.124 2007/04/06 15:32:29 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -525,7 +525,7 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, index) == 
FAILURE) {
return;
}
-   RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 1 
TSRMLS_CC));
+   RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 0 
TSRMLS_CC));
 } /* }}} */
 
 /* {{{ proto mixed ArrayObject::offsetGet(mixed $index) U

http://cvs.php.net/viewvc.cgi/php-src/ext/spl/tests/bug40442.phpt?view=markuprev=1.1
Index: php-src/ext/spl/tests/bug40442.phpt
+++ php-src/ext/spl/tests/bug40442.phpt

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/gd config.w32 gd.c

2007-04-06 Thread Pierre-Alain Joye
pajoye  Fri Apr  6 15:38:35 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/gd config.w32 gd.c 
  Log:
  - Fix windows mutex intialization, add  HAVE_GD_FONTMUTEX and  
HAVE_LIBFREETYPE
to config.w32 (Thanks to Frank for the report)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/config.w32?r1=1.10.4.1r2=1.10.4.2diff_format=u
Index: php-src/ext/gd/config.w32
diff -u php-src/ext/gd/config.w32:1.10.4.1 php-src/ext/gd/config.w32:1.10.4.2
--- php-src/ext/gd/config.w32:1.10.4.1  Sat Mar 10 12:18:36 2007
+++ php-src/ext/gd/config.w32   Fri Apr  6 15:38:35 2007
@@ -1,4 +1,4 @@
-// $Id: config.w32,v 1.10.4.1 2007/03/10 12:18:36 pajoye Exp $
+// $Id: config.w32,v 1.10.4.2 2007/04/06 15:38:35 pajoye Exp $
 // vim:ft=javascript
 
 ARG_WITH(gd, Bundled GD support, yes,shared);
@@ -40,6 +40,8 @@
 /D HAVE_GDIMAGECOLORRESOLVE=1  \
 /D HAVE_GD_IMAGESETBRUSH=1  \
 /D HAVE_GD_IMAGESETTILE=1 \
+/D HAVE_GD_FONTMUTEX=1 \
+/D HAVE_LIBFREETYPE=1 \
 /D HAVE_GD_JPG  \
 /D HAVE_GD_PNG  \
 /D HAVE_GD_STRINGFTEX=1  \
http://cvs.php.net/viewvc.cgi/php-src/ext/gd/gd.c?r1=1.312.2.20.2.19r2=1.312.2.20.2.20diff_format=u
Index: php-src/ext/gd/gd.c
diff -u php-src/ext/gd/gd.c:1.312.2.20.2.19 php-src/ext/gd/gd.c:1.312.2.20.2.20
--- php-src/ext/gd/gd.c:1.312.2.20.2.19 Thu Apr  5 11:57:57 2007
+++ php-src/ext/gd/gd.c Fri Apr  6 15:38:35 2007
@@ -18,7 +18,7 @@
+--+
  */
 
-/* $Id: gd.c,v 1.312.2.20.2.19 2007/04/05 11:57:57 pajoye Exp $ */
+/* $Id: gd.c,v 1.312.2.20.2.20 2007/04/06 15:38:35 pajoye Exp $ */
 
 /* gd 1.2 is copyright 1994, 1995, Quest Protein Database Center,
Cold Spring Harbor Labs. */
@@ -1219,6 +1219,7 @@
 {
le_gd = zend_register_list_destructors_ex(php_free_gd_image, NULL, 
gd, module_number);
le_gd_font = zend_register_list_destructors_ex(php_free_gd_font, NULL, 
gd font, module_number);
+
 #if HAVE_GD_FONTMUTEX  HAVE_LIBFREETYPE
gdFontCacheMutexSetup();
 #endif

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



[PHP-CVS] cvs: php-src(PHP_5_2) / NEWS /ext/spl spl_array.c

2007-04-06 Thread Marcus Boerger
helly   Fri Apr  6 17:57:10 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-srcNEWS 
/php-src/ext/splspl_array.c 
  Log:
  - Fix 40442
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.627r2=1.2027.2.547.2.628diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.627 php-src/NEWS:1.2027.2.547.2.628
--- php-src/NEWS:1.2027.2.547.2.627 Thu Apr  5 01:48:56 2007
+++ php-src/NEWSFri Apr  6 17:57:09 2007
@@ -120,6 +120,8 @@
   methods). (Tony)
 - Fixed bug #40451 (addAttribute() may crash when used with non-existent child 
   node). (Tony)
+- Fixed bug #40442 (ArrayObject::offsetExists broke in 5.2.1, works in 5.2.0).
+  (olivier at elma dot fr, Marcus)
 - Fixed bug #40428 (imagepstext() doesn't accept optional parameter). (Pierre)
 - Fixed bug #40417 (Allow multiple instances of the same named PDO token in
   prepared statement emulation code). (Ilia)
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.71.2.17.2.10r2=1.71.2.17.2.11diff_format=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.71.2.17.2.10 
php-src/ext/spl/spl_array.c:1.71.2.17.2.11
--- php-src/ext/spl/spl_array.c:1.71.2.17.2.10  Sat Mar 24 16:28:53 2007
+++ php-src/ext/spl/spl_array.c Fri Apr  6 17:57:10 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_array.c,v 1.71.2.17.2.10 2007/03/24 16:28:53 helly Exp $ */
+/* $Id: spl_array.c,v 1.71.2.17.2.11 2007/04/06 17:57:10 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -520,7 +520,7 @@
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z, index) == 
FAILURE) {
return;
}
-   RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 1 
TSRMLS_CC));
+   RETURN_BOOL(spl_array_has_dimension_ex(0, getThis(), index, 0 
TSRMLS_CC));
 } /* }}} */
 
 /* {{{ proto mixed ArrayObject::offsetGet(mixed $index)

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/soap php_encoding.c

2007-04-06 Thread Andrei Zmievski
andrei  Fri Apr  6 18:25:49 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/soap   php_encoding.c 
  Log:
  Typo?
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.103.2.21.2.27r2=1.103.2.21.2.28diff_format=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.103.2.21.2.27 
php-src/ext/soap/php_encoding.c:1.103.2.21.2.28
--- php-src/ext/soap/php_encoding.c:1.103.2.21.2.27 Mon Apr  2 13:43:08 2007
+++ php-src/ext/soap/php_encoding.c Fri Apr  6 18:25:49 2007
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_encoding.c,v 1.103.2.21.2.27 2007/04/02 13:43:08 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.103.2.21.2.28 2007/04/06 18:25:49 andrei Exp $ */
 
 #include time.h
 
@@ -1016,7 +1016,7 @@
if (Z_TYPE_P(data) == IS_DOUBLE) {
char s[256];
 
-   snprintf(s, sizeof(s), %0.0F,floor(Z_DVAL_P(data)));
+   snprintf(s, sizeof(s), %0.0f,floor(Z_DVAL_P(data)));
xmlNodeSetContent(ret, BAD_CAST(s));
} else {
zval tmp = *data;

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/soap php_encoding.c

2007-04-06 Thread Andrei Zmievski
andrei  Fri Apr  6 18:27:58 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/soap   php_encoding.c 
  Log:
  Apologies. Didn't realize we were using custom snprintf().
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.103.2.21.2.28r2=1.103.2.21.2.29diff_format=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.103.2.21.2.28 
php-src/ext/soap/php_encoding.c:1.103.2.21.2.29
--- php-src/ext/soap/php_encoding.c:1.103.2.21.2.28 Fri Apr  6 18:25:49 2007
+++ php-src/ext/soap/php_encoding.c Fri Apr  6 18:27:58 2007
@@ -17,7 +17,7 @@
   |  Dmitry Stogov [EMAIL PROTECTED] |
   +--+
 */
-/* $Id: php_encoding.c,v 1.103.2.21.2.28 2007/04/06 18:25:49 andrei Exp $ */
+/* $Id: php_encoding.c,v 1.103.2.21.2.29 2007/04/06 18:27:58 andrei Exp $ */
 
 #include time.h
 
@@ -1016,7 +1016,7 @@
if (Z_TYPE_P(data) == IS_DOUBLE) {
char s[256];
 
-   snprintf(s, sizeof(s), %0.0f,floor(Z_DVAL_P(data)));
+   snprintf(s, sizeof(s), %0.0F,floor(Z_DVAL_P(data)));
xmlNodeSetContent(ret, BAD_CAST(s));
} else {
zval tmp = *data;

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



[PHP-CVS] cvs: php-src /ext/spl php_spl.c

2007-04-06 Thread Marcus Boerger
helly   Fri Apr  6 19:04:53 2007 UTC

  Modified files:  
/php-src/ext/splphp_spl.c 
  Log:
  - Fix types
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.110r2=1.111diff_format=u
Index: php-src/ext/spl/php_spl.c
diff -u php-src/ext/spl/php_spl.c:1.110 php-src/ext/spl/php_spl.c:1.111
--- php-src/ext/spl/php_spl.c:1.110 Fri Apr  6 18:50:07 2007
+++ php-src/ext/spl/php_spl.c   Fri Apr  6 19:04:53 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_spl.c,v 1.110 2007/04/06 18:50:07 helly Exp $ */
+/* $Id: php_spl.c,v 1.111 2007/04/06 19:04:53 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
#include config.h
@@ -546,9 +546,9 @@
success = zend_u_hash_del(SPL_G(autoload_functions), 
Z_TYPE(zfunc_name), lc_name, Z_UNILEN(zfunc_name)+1);
if (success != SUCCESS  obj_ptr) {
size_t func_name_len = Z_UNISIZE(zfunc_name);
-   lc_name.v = erealloc(lc_name.v, func_name_len + 
1 + sizeof(long));
-   memcpy(lc_name.v + func_name_len, 
Z_OBJ_HANDLE_PP(obj_ptr), sizeof(long));
-   func_name_len += sizeof(long);
+   lc_name.v = erealloc(lc_name.v, func_name_len + 
1 + sizeof(zend_object_handle));
+   memcpy(lc_name.v + func_name_len, 
Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle));
+   func_name_len += sizeof(zend_object_handle);
lc_name.s[func_name_len] = '\0';
if (Z_TYPE(zfunc_name) == IS_UNICODE) {
func_name_len /= sizeof(UChar);


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



[PHP-CVS] cvs: php-src(PHP_5_2) /main snprintf.h

2007-04-06 Thread Andrei Zmievski
andrei  Fri Apr  6 19:25:53 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/main   snprintf.h 
  Log:
  We can't use the printf attribute here since we are supporting
  non-standard formats (like 'F').
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/snprintf.h?r1=1.32.2.3.2.4r2=1.32.2.3.2.5diff_format=u
Index: php-src/main/snprintf.h
diff -u php-src/main/snprintf.h:1.32.2.3.2.4 
php-src/main/snprintf.h:1.32.2.3.2.5
--- php-src/main/snprintf.h:1.32.2.3.2.4Sat Feb 24 18:20:46 2007
+++ php-src/main/snprintf.h Fri Apr  6 19:25:52 2007
@@ -17,7 +17,7 @@
+--+
 */
 
-/* $Id: snprintf.h,v 1.32.2.3.2.4 2007/02/24 18:20:46 helly Exp $ */
+/* $Id: snprintf.h,v 1.32.2.3.2.5 2007/04/06 19:25:52 andrei Exp $ */
 
 /*
 
@@ -78,10 +78,10 @@
 
 
 BEGIN_EXTERN_C()
-PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...) 
PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
-PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list 
ap) PHP_ATTRIBUTE_FORMAT(printf, 3, 0);
-PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...) 
PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
-PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap) 
PHP_ATTRIBUTE_FORMAT(printf, 3, 0);
+PHPAPI int ap_php_slprintf(char *buf, size_t len, const char *format,...);
+PHPAPI int ap_php_vslprintf(char *buf, size_t len, const char *format, va_list 
ap);
+PHPAPI int ap_php_snprintf(char *, size_t, const char *, ...);
+PHPAPI int ap_php_vsnprintf(char *, size_t, const char *, va_list ap);
 PHPAPI int php_sprintf (char* s, const char* format, ...) 
PHP_ATTRIBUTE_FORMAT(printf, 2, 3);
 PHPAPI char * php_gcvt(double value, int ndigit, char dec_point, char 
exponent, char *buf);
 PHPAPI char * php_conv_fp(register char format, register double num,

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



[PHP-CVS] cvs: php-src /ext/spl php_spl.c

2007-04-06 Thread Marcus Boerger
helly   Fri Apr  6 21:02:20 2007 UTC

  Modified files:  
/php-src/ext/splphp_spl.c 
  Log:
  - Fix unicode issue (our string termination test checks both ending bytes 
instead of just one)
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.111r2=1.112diff_format=u
Index: php-src/ext/spl/php_spl.c
diff -u php-src/ext/spl/php_spl.c:1.111 php-src/ext/spl/php_spl.c:1.112
--- php-src/ext/spl/php_spl.c:1.111 Fri Apr  6 19:04:53 2007
+++ php-src/ext/spl/php_spl.c   Fri Apr  6 21:02:20 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_spl.c,v 1.111 2007/04/06 19:04:53 helly Exp $ */
+/* $Id: php_spl.c,v 1.112 2007/04/06 21:02:20 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
#include config.h
@@ -466,16 +466,18 @@
/* add object id to the hash to ensure uniqueness, for 
more reference look at bug #40091 */
zstr lc_name;
size_t func_name_len = Z_UNISIZE(zfunc_name);
-   lc_name.v = Z_UNIVAL(zfunc_name).v = 
erealloc(Z_UNIVAL(zfunc_name).v, func_name_len + 1 + sizeof(long));
+   lc_name.v = Z_UNIVAL(zfunc_name).v = 
erealloc(Z_UNIVAL(zfunc_name).v, func_name_len + 2 + 
sizeof(zend_object_handle));
memcpy(lc_name.s + func_name_len, 
Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle));
func_name_len += sizeof(zend_object_handle);
-   lc_name.s[func_name_len] = '\0';
alfi.obj = *obj_ptr;
alfi.obj-refcount++;
if (Z_TYPE(zfunc_name) == IS_UNICODE) {
-   Z_UNILEN(zfunc_name) = func_name_len / 
sizeof(UChar);
+   func_name_len /= sizeof(UChar);
+   Z_STRLEN(zfunc_name) = func_name_len;
+   lc_name.u[func_name_len] = '\0';
} else {
-   Z_UNILEN(zfunc_name) = func_name_len;
+   Z_STRLEN(zfunc_name) = func_name_len;
+   lc_name.s[func_name_len] = '\0';
}
} else {
alfi.obj = NULL;

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



[PHP-CVS] cvs: php-src /ext/spl php_spl.c

2007-04-06 Thread Marcus Boerger
helly   Fri Apr  6 21:07:48 2007 UTC

  Modified files:  
/php-src/ext/splphp_spl.c 
  Log:
  - Fix unicode issue in unregister according to register solution
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/php_spl.c?r1=1.112r2=1.113diff_format=u
Index: php-src/ext/spl/php_spl.c
diff -u php-src/ext/spl/php_spl.c:1.112 php-src/ext/spl/php_spl.c:1.113
--- php-src/ext/spl/php_spl.c:1.112 Fri Apr  6 21:02:20 2007
+++ php-src/ext/spl/php_spl.c   Fri Apr  6 21:07:48 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: php_spl.c,v 1.112 2007/04/06 21:02:20 helly Exp $ */
+/* $Id: php_spl.c,v 1.113 2007/04/06 21:07:48 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
#include config.h
@@ -474,7 +474,7 @@
if (Z_TYPE(zfunc_name) == IS_UNICODE) {
func_name_len /= sizeof(UChar);
Z_STRLEN(zfunc_name) = func_name_len;
-   lc_name.u[func_name_len] = '\0';
+   lc_name.u[func_name_len] = 0;
} else {
Z_STRLEN(zfunc_name) = func_name_len;
lc_name.s[func_name_len] = '\0';
@@ -548,12 +548,14 @@
success = zend_u_hash_del(SPL_G(autoload_functions), 
Z_TYPE(zfunc_name), lc_name, Z_UNILEN(zfunc_name)+1);
if (success != SUCCESS  obj_ptr) {
size_t func_name_len = Z_UNISIZE(zfunc_name);
-   lc_name.v = erealloc(lc_name.v, func_name_len + 
1 + sizeof(zend_object_handle));
+   lc_name.v = erealloc(lc_name.v, func_name_len + 
2 + sizeof(zend_object_handle));
memcpy(lc_name.v + func_name_len, 
Z_OBJ_HANDLE_PP(obj_ptr), sizeof(zend_object_handle));
func_name_len += sizeof(zend_object_handle);
-   lc_name.s[func_name_len] = '\0';
if (Z_TYPE(zfunc_name) == IS_UNICODE) {
func_name_len /= sizeof(UChar);
+   lc_name.u[func_name_len] = 0;
+   } else {
+   lc_name.s[func_name_len] = '\0';
}
success = 
zend_u_hash_del(SPL_G(autoload_functions), Z_TYPE(zfunc_name), lc_name, 
func_name_len+1);
}

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



[PHP-CVS] cvs: php-src /ext/spl spl_array.c

2007-04-06 Thread Marcus Boerger
helly   Fri Apr  6 21:15:44 2007 UTC

  Modified files:  
/php-src/ext/splspl_array.c 
  Log:
  - Fix unicode issue
  
http://cvs.php.net/viewvc.cgi/php-src/ext/spl/spl_array.c?r1=1.124r2=1.125diff_format=u
Index: php-src/ext/spl/spl_array.c
diff -u php-src/ext/spl/spl_array.c:1.124 php-src/ext/spl/spl_array.c:1.125
--- php-src/ext/spl/spl_array.c:1.124   Fri Apr  6 15:32:29 2007
+++ php-src/ext/spl/spl_array.c Fri Apr  6 21:15:44 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: spl_array.c,v 1.124 2007/04/06 15:32:29 helly Exp $ */
+/* $Id: spl_array.c,v 1.125 2007/04/06 21:15:44 helly Exp $ */
 
 #ifdef HAVE_CONFIG_H
 # include config.h
@@ -480,7 +480,7 @@
case IS_STRING:
case IS_UNICODE:
if (check_empty) {
-   if (zend_symtable_find(spl_array_get_hash_table(intern, 
0 TSRMLS_CC), Z_STRVAL_P(offset), Z_STRLEN_P(offset)+1, (void **) tmp) != 
FAILURE  zend_is_true(*tmp)) {
+   if 
(zend_u_symtable_find(spl_array_get_hash_table(intern, 0 TSRMLS_CC), 
Z_TYPE_P(offset), Z_UNIVAL_P(offset), Z_UNILEN_P(offset)+1, (void **) tmp) != 
FAILURE  zend_is_true(*tmp)) {
return 1;
}
return 0;

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



[PHP-CVS] cvs: php-src(PHP_5_2) /ext/standard filestat.c

2007-04-06 Thread Antony Dovgal
tony2001Fri Apr  6 22:10:57 2007 UTC

  Modified files:  (Branch: PHP_5_2)
/php-src/ext/standard   filestat.c 
  Log:
  MFB: clean  refactored disk_*() funcs implementation
  Ilia, feel free to make these functions public, though I don't see why would 
want to do that 
  
  http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filestat.c?r1=1.136.2.8.2.11r2=1.136.2.8.2.12diff_format=u
Index: php-src/ext/standard/filestat.c
diff -u php-src/ext/standard/filestat.c:1.136.2.8.2.11 
php-src/ext/standard/filestat.c:1.136.2.8.2.12
--- php-src/ext/standard/filestat.c:1.136.2.8.2.11  Mon Feb 26 14:11:34 2007
+++ php-src/ext/standard/filestat.c Fri Apr  6 22:10:56 2007
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: filestat.c,v 1.136.2.8.2.11 2007/02/26 14:11:34 tony2001 Exp $ */
+/* $Id: filestat.c,v 1.136.2.8.2.12 2007/04/06 22:10:56 tony2001 Exp $ */
 
 #include php.h
 #include safe_mode.h
@@ -120,14 +120,10 @@
 }
 /* }}} */
 
-/* {{{ proto float disk_total_space(string path)
-   Get total disk space for filesystem that path is on */
-PHP_FUNCTION(disk_total_space)
+static int php_disk_total_space(char *path, double *space TSRMLS_DC) /* {{{ */
+#if defined(WINDOWS) /* {{{ */
 {
-   zval **path;
-#ifdef WINDOWS
-   double bytestotal;
-
+   double bytestotal = 0;
HINSTANCE kernel32;
FARPROC gdfse;
typedef BOOL (WINAPI *gdfse_func)(LPCTSTR, PULARGE_INTEGER, 
PULARGE_INTEGER, PULARGE_INTEGER);
@@ -144,26 +140,6 @@
DWORD NumberOfFreeClusters;
DWORD TotalNumberOfClusters;
 
-#else /* not - WINDOWS */
-#if defined(HAVE_SYS_STATVFS_H)  defined(HAVE_STATVFS)
-   struct statvfs buf;
-#elif (defined(HAVE_SYS_STATFS_H) || defined(HAVE_SYS_MOUNT_H))  
defined(HAVE_STATFS)
-   struct statfs buf;
-#endif
-   double bytestotal = 0;
-#endif /* WINDOWS */
-
-   if (ZEND_NUM_ARGS()!=1 || zend_get_parameters_ex(1, path)==FAILURE) {
-   WRONG_PARAM_COUNT;
-   }
-
-   convert_to_string_ex(path);
-
-   if (php_check_open_basedir(Z_STRVAL_PP(path) TSRMLS_CC)) {
-   RETURN_FALSE;
-   }
-
-#ifdef WINDOWS
/* GetDiskFreeSpaceEx is only available in NT and Win95 post-OSR2,
   so we have to jump through some hoops to see if the function
   exists. */
@@ -173,48 +149,63 @@
/* It's available, so we can call it. */
if (gdfse) {
func = (gdfse_func)gdfse;
-   if (func(Z_STRVAL_PP(path),
-   FreeBytesAvailableToCaller,
-   TotalNumberOfBytes,
-   TotalNumberOfFreeBytes) == 0) { 
+   if (func(path,
+   FreeBytesAvailableToCaller,
+   TotalNumberOfBytes,
+   TotalNumberOfFreeBytes) == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
%s, php_win_err());
-   RETURN_FALSE;
+   return FAILURE;
}
 
/* i know - this is ugly, but i works [EMAIL 
PROTECTED] */
bytestotal  = TotalNumberOfBytes.HighPart *
(double) (((unsigned long)1)  31) * 2.0 +
TotalNumberOfBytes.LowPart;
-   }
-   /* If it's not available, we just use GetDiskFreeSpace */
-   else {
-   if (GetDiskFreeSpace(Z_STRVAL_PP(path),
-   SectorsPerCluster, BytesPerSector,
-   NumberOfFreeClusters, TotalNumberOfClusters) 
== 0) { 
+   } else { /* If it's not available, we just use GetDiskFreeSpace 
*/
+   if (GetDiskFreeSpace(path,
+   SectorsPerCluster, 
BytesPerSector,
+   NumberOfFreeClusters, 
TotalNumberOfClusters) == 0) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, 
%s, php_win_err());
-   RETURN_FALSE; 
+   return FAILURE;
}
bytestotal = (double)TotalNumberOfClusters * 
(double)SectorsPerCluster * (double)BytesPerSector;
}
-   }
-   else {
+   } else {
php_error_docref(NULL TSRMLS_CC, E_WARNING, Unable to load 
kernel32.dll);
-   RETURN_FALSE;
+   return FAILURE;
}
+   
+   *space = bytestotal;
+   return SUCCESS; 
+}
+/* }}} */
+#elif defined(OS2) /* {{{ */
+{
+   double bytestotal = 0;
+   FSALLOCATE fsinfo;
+   char drive = path[0]  95;
 
-#elif defined(OS2)
-   {
-   

[PHP-CVS] cvs: CVSROOT / avail checkoutlist commitinfo pear_acls peargroup_acls verify.php /pear avail group

2007-04-06 Thread Marcus Boerger
helly   Fri Apr  6 22:22:36 2007 UTC

  Added files: 
/CVSROOTpear_acls peargroup_acls verify.php 
/CVSROOT/pear   avail group 

  Modified files:  
/CVSROOTavail checkoutlist commitinfo 
  Log:
  - Split pear access rights to bring the new pear group to life (patch by Greg)
  http://cvs.php.net/viewvc.cgi/CVSROOT/avail?r1=1.1262r2=1.1263diff_format=u
Index: CVSROOT/avail
diff -u CVSROOT/avail:1.1262 CVSROOT/avail:1.1263
--- CVSROOT/avail:1.1262Wed Apr  4 18:19:39 2007
+++ CVSROOT/avail   Fri Apr  6 22:22:36 2007
@@ -15,9 +15,9 @@
 
avail|sterling,goba,imajes,wez,iliaa,derick,jon,cox,alan_k,jmcastagnetto,mj,pajoye,helly|CVSROOT
 
 # The PHP Developers have full access to the full source trees for
-# PHP and PEAR, as well as the documentation.
+# PHP, as well as the documentation.
 
-avail|mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,gopalv,bjori,nlopess,wrowe,shire,zoe|phpfi,php3,php-src,pecl!
 
,non-pecl,pear,peardoc,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa_IR,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca
+avail|mike,rolland,cawa,msisolak,alan_k,rrichards,tal,mfischer,fmk,hirokawa,jah,eschmid,dbeu,sebastian,samjam,avsm,ronabob,derick,sterling,venaas,stas,hholzgra,cmv,phildriscoll,jmoore,andre,sniper,sr,david,jdonagher,chagenbu,jon,elixer,joosters,jason,mysql,kalowsky,opaquedave,steinm,phanto,gluke,svanegmond,rjs,vlad,jimjag,emile,wez,sasha,camber,ohrn,romolo,martin,lurcher,wsanchez,dreid,bmcadams,swm,zhang,kevin,joey,entity,cardinal,coar,jflemer,raphael,danda,rbb,mboeren,dougm,edink,alexwaugh,bernd,zak,sesser,yohgaki,imajes,markonen,dickmeiss,helly,sander,jan,kir,aaron,jwoolley,pbannister,rvenkat,dali,rodif_bl,hyanantha,witten,georg,msopacua,mpdoremus,fujimoto,iliaa,chregu,azzit,gschlossnagle,andrey,dan,moriyoshi,dviner,bfrance,flex,iwakiri,john,harrie,pollita,ianh,k.schroeder,dcowgill,jerenkrantz,jay,ddhill,jorton,thetaphi,abies,vincent,goba,dmitry,pajoye,shie,rafi,magnus,tony2001,johannes,dbs,skoduru,nrathna,jesus,gopalv,bjori,nlopess,wrowe,shire,zoe|phpfi,php3,php-src,pecl!
 
,non-pecl,spl,phpdoc,phpdoc-ar,phpdoc-bg,phpdoc-cs,phpdoc-da,phpdoc-de,phpdoc-el,phpdoc-es,phpdoc-fa_IR,phpdoc-fi,phpdoc-fr,phpdoc-he,phpdoc-hk,phpdoc-hu,phpdoc-id,phpdoc-it,phpdoc-ja,phpdoc-kr,phpdoc-lt,phpdoc-nl,phpdoc-pl,phpdoc-pt_BR,phpdoc-pt,phpdoc-ro,phpdoc-ru,phpdoc-sk,phpdoc-sl,phpdoc-sv,phpdoc-tr,phpdoc-tw,phpdoc-zh,phpdoc-ca
 
 # fastcgi implementation for IIS
 avail|shane,wez,edink|fastcgi-isapi
@@ -59,25 +59,6 @@
 
 
avail|ilia,jalal,zak,andre,lyric,jmoore,ronabop,sebastian,joey,sniper,torben,hellekin,cnewbill,bate,yohgaki,jan,imajes,derick,msopacua,nohn,edink,iliaa,helly,sean,nlopess,tony2001|qaweb
 
-# The PEAR Team has access to the full PEAR tree, the PEAR portion of
-# the PHP tree, the PEAR website, and the PEAR documentation.
-
-avail|andrew,moh,sterling,jon,jlp,sebastian,troels,urs,jpm,adaniel,tuupola,mj,metallic,richard,aj,andre,zimt,uw,bjoern,chregu,tfromm,subjective,cox,jmcastagnetto,kaltoft,jccann,amiller,mansion,zyprexia,alexmerz,yavo,clambert,vblavet,bernd,nohn,mog,mfischer,kvn,jan,eru,murahachibu,hayk,cain,nhoizey,aditus,ludoo,imajes,graeme,eriksson,jasonlotito,dallen,lsmith,timmyg,artka,tal,kk,cmv,rashid,alexios,baba,reywob,ekilfoil,antonio,sagi,jrust,mehl,dickmann,alan_k,fab,thku,busterb,miked,pgc,ctrlsoft,tychay,dexter,sachat,svenasse,mw21st,arahn,matthias,dias,jfbus,derick,chief,sigi,tony,olivier,nepto,voyteck,cnb,dams,peterk,ernani,edink,quipo,egnited,arnaud,mcmontero,mbretter,nicos,philip,xnoguer,sjr,meebey,jellybob,darkelder,max,dcowgill,daggilli,kuboa,ncowham,sklar,krausbn,ordnas,avb,polone,datenpunk,inorm,llucax,davey,moosh,et,mscifo,yunosh,thesaur,hburbach,ohill,cellog,hlellelid,rmcclain,vincent,heino,neufeind,didou,schst,alain,mrcool,mroch,mike,vgoebbels,mixtli,farell,pmjones,jw,!
 

[PHP-CVS] cvs: CVSROOT /pear addkarma.php

2007-04-06 Thread Greg Beaver
cellog  Sat Apr  7 04:46:22 2007 UTC

  Added files: 
/CVSROOT/pear   addkarma.php 
  Log:
  add helper script to add karma
  
  # TODO: make it smarter, to recognize and add to existing karma dirs
  

http://cvs.php.net/viewvc.cgi/CVSROOT/pear/addkarma.php?view=markuprev=1.1
Index: CVSROOT/pear/addkarma.php
+++ CVSROOT/pear/addkarma.php
?php
if (!isset($_SERVER['argv'])) {
die(Must use CLI\n);
}
if (count($_SERVER['argv']) != 3) {
die(usage: addkarma.php handle directory,directory\n);
}
if (!strpos($_SERVER['argv'][2], '/')) {
die(usage: addkarma.php handle directory,directory (use directory/ for 
top-level)\n);
}
$newinfo = array();
$karma = array();
$new = new SplFileObject(dirname(__FILE__) . '/avail');
foreach ($new as $line) {
$line = trim($line);
if (!strlen($line) || $line[0] == '#' || $line == 'unavail') {
continue;
}
$line = explode('|', $line);
if ('unavail' == array_shift($line)) {
continue; // drop avail
}
if (!isset($line[1])) {
// avail everything
$modules = array('!');
} else {
$modules = explode(',', $line[1]);
}
$peoples = explode(',', $line[0]);
foreach ($peoples as $person) {
foreach ($modules as $module) {
if ($person == $_SERVER['argv'][1]) {
$karma[] = $module;
}
$newinfo[$person][$module] = 1;
}
}
}
$modules = explode(',', $_SERVER['argv'][2]);
array_walk($modules, create_function('$a,$b', '$a = trim($a,/);'));
$need = array();
foreach ($modules as $module) {
$test = explode('/', $module);
// test karma for directory and for parent directories
while (is_array($test)  count($test)) {
$mod = implode('/', $test);
if (in_array($mod, $karma)) {
if ($mod == $module) {
echo 'User already has karma for module ', $mod, \n;
} else {
echo 'User already has karma for parent directory ', $mod,
 ' of module ', $module, \n;
}
continue 2;
}
array_pop($test);
}
if (strpos($module, 'pear') === false) {
echo Module $module should be added to avail, not pear/avail, 
skipping\n;
continue;
}
$need[] = $module;
}
if (count($need)) {
echo 'adding karma for ' . implode(',', $modules) . \n;
clearstatcache();
$fp = fopen(dirname(__FILE__) . '/avail', 'r+');
// strlen(\n# vim:set ft=conf sw=2 ts=2 et:\n)
fseek($fp, -33, SEEK_END);
ftruncate($fp, ftell($fp));
fwrite($fp, avail| . $_SERVER['argv'][1] . '|' . implode(',', $need) .
\n# vim:set ft=conf sw=2 ts=2 et:\n);
fclose($fp);
}

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