[PHP-CVS] com php-src: Re-fix bug #55544: ext/zlib/php_zlib.h ext/zlib/tests/bug55544.phpt ext/zlib/zlib.c

2012-07-24 Thread Xinchen Hui
Commit:4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe
Author:Xinchen Hui larue...@php.net Tue, 24 Jul 2012 14:43:53 
+0800
Parents:   2abc4c2f6fabfc81d12380170dc5ec7be9314a61
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe

Log:
Re-fix bug #55544

Bugs:
https://bugs.php.net/55544

Changed paths:
  M  ext/zlib/php_zlib.h
  A  ext/zlib/tests/bug55544.phpt
  M  ext/zlib/zlib.c


Diff:
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index 449dfed..ab67351 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -55,6 +55,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib)
long output_compression_default;
char *output_handler;
php_zlib_context *ob_gzhandler;
+zend_bool handler_registered;
 ZEND_END_MODULE_GLOBALS(zlib);
 
 php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char 
*mode, int options, char **opened_path, php_stream_context *context STREAMS_DC 
TSRMLS_DC);
diff --git a/ext/zlib/tests/bug55544.phpt b/ext/zlib/tests/bug55544.phpt
new file mode 100644
index 000..ca4214a
Binary files /dev/null and b/ext/zlib/tests/bug55544.phpt differ
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index eac757b..7ff2b30 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -263,6 +263,8 @@ static php_output_handler 
*php_zlib_output_handler_init(const char *handler_name
ZLIBG(output_compression) = chunk_size ? chunk_size : 
PHP_OUTPUT_HANDLER_DEFAULT_SIZE;
}
 
+ZLIBG(handler_registered) = 1;
+
if ((h = php_output_handler_create_internal(handler_name, 
handler_name_len, php_zlib_output_handler, chunk_size, flags TSRMLS_CC))) {
php_output_handler_set_context(h, 
php_zlib_output_handler_context_init(TSRMLS_C), 
php_zlib_output_handler_context_dtor TSRMLS_CC);
}
@@ -964,9 +966,10 @@ static PHP_MSHUTDOWN_FUNCTION(zlib)
 static PHP_RINIT_FUNCTION(zlib)
 {
ZLIBG(compression_coding) = 0;
-   ZLIBG(output_compression) = ZLIBG(output_compression_default);
-
-   php_zlib_output_compression_start(TSRMLS_C);
+if (!ZLIBG(handler_registered)) {
+ZLIBG(output_compression) = ZLIBG(output_compression_default);
+php_zlib_output_compression_start(TSRMLS_C);
+}
 
return SUCCESS;
 }
@@ -976,6 +979,7 @@ static PHP_RINIT_FUNCTION(zlib)
 static PHP_RSHUTDOWN_FUNCTION(zlib)
 {
php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C);
+ZLIBG(handler_registered) = 0;
 
 return SUCCESS;
 }
@@ -1000,6 +1004,7 @@ static PHP_MINFO_FUNCTION(zlib)
 static ZEND_MODULE_GLOBALS_CTOR_D(zlib)
 {
zlib_globals-ob_gzhandler = NULL;
+zlib_globals-handler_registered = 0;
 }
 /* }}} */


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



[PHP-CVS] com php-src: binary compatibility: ext/zlib/php_zlib.h

2012-07-24 Thread Xinchen Hui
Commit:9fe8c58130ac82d2b52b35a290b71569abe50d18
Author:Xinchen Hui larue...@php.net Tue, 24 Jul 2012 14:45:13 
+0800
Parents:   4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=9fe8c58130ac82d2b52b35a290b71569abe50d18

Log:
binary compatibility

Changed paths:
  M  ext/zlib/php_zlib.h


Diff:
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index ab67351..e895e0e 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -52,9 +52,9 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib)
int compression_coding;
long output_compression;
long output_compression_level;
-   long output_compression_default;
char *output_handler;
php_zlib_context *ob_gzhandler;
+   long output_compression_default;
 zend_bool handler_registered;
 ZEND_END_MODULE_GLOBALS(zlib);


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



Re: [PHP-CVS] com php-src: Re-fix bug #55544: ext/zlib/php_zlib.h ext/zlib/tests/bug55544.phpt ext/zlib/zlib.c

2012-07-24 Thread Laruence
Hi:
   the fix is bad smell, I knew.  maybe you can find a better fix :) ?

  the problem is explained in #55544:
 here is the confusion(assuming -d output_handler=ob_gzhandler -d
zlib.output_compression=0) :

1. php.output_handler will change the ZLIGB(output_compression) before the zlib
RINIT
2. in zlib RINIT, we set the ZLIBG(output_compression) to default value(ini)

3. if we don't override the ZLIBG(output_compression), then in the
php_zlib_output_compression_start which will be called in RINT will
try to start
zlib compression handler (although it depends on the requeset header),
then, the
conflict warning will be threw.

4. if we override it, then it the php_zlib_output_compression_start, it will
return FALIURE, and no compression occurred(see the codes from my previous
reply)

so, the key problem is multi-featrues depends on one global flag -
ZLIBG(output_compression).

thanks


On Tue, Jul 24, 2012 at 2:43 PM, Xinchen Hui larue...@php.net wrote:
 Commit:4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe
 Author:Xinchen Hui larue...@php.net Tue, 24 Jul 2012 14:43:53 
 +0800
 Parents:   2abc4c2f6fabfc81d12380170dc5ec7be9314a61
 Branches:  PHP-5.4

 Link:   
 http://git.php.net/?p=php-src.git;a=commitdiff;h=4c1e2bbd6f744b4048d4e0540ecc5dbe005494fe

 Log:
 Re-fix bug #55544

 Bugs:
 https://bugs.php.net/55544

 Changed paths:
   M  ext/zlib/php_zlib.h
   A  ext/zlib/tests/bug55544.phpt
   M  ext/zlib/zlib.c


 Diff:
 diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
 index 449dfed..ab67351 100644
 --- a/ext/zlib/php_zlib.h
 +++ b/ext/zlib/php_zlib.h
 @@ -55,6 +55,7 @@ ZEND_BEGIN_MODULE_GLOBALS(zlib)
 long output_compression_default;
 char *output_handler;
 php_zlib_context *ob_gzhandler;
 +zend_bool handler_registered;
  ZEND_END_MODULE_GLOBALS(zlib);

  php_stream *php_stream_gzopen(php_stream_wrapper *wrapper, char *path, char 
 *mode, int options, char **opened_path, php_stream_context *context 
 STREAMS_DC TSRMLS_DC);
 diff --git a/ext/zlib/tests/bug55544.phpt b/ext/zlib/tests/bug55544.phpt
 new file mode 100644
 index 000..ca4214a
 Binary files /dev/null and b/ext/zlib/tests/bug55544.phpt differ
 diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
 index eac757b..7ff2b30 100644
 --- a/ext/zlib/zlib.c
 +++ b/ext/zlib/zlib.c
 @@ -263,6 +263,8 @@ static php_output_handler 
 *php_zlib_output_handler_init(const char *handler_name
 ZLIBG(output_compression) = chunk_size ? chunk_size : 
 PHP_OUTPUT_HANDLER_DEFAULT_SIZE;
 }

 +ZLIBG(handler_registered) = 1;
 +
 if ((h = php_output_handler_create_internal(handler_name, 
 handler_name_len, php_zlib_output_handler, chunk_size, flags TSRMLS_CC))) {
 php_output_handler_set_context(h, 
 php_zlib_output_handler_context_init(TSRMLS_C), 
 php_zlib_output_handler_context_dtor TSRMLS_CC);
 }
 @@ -964,9 +966,10 @@ static PHP_MSHUTDOWN_FUNCTION(zlib)
  static PHP_RINIT_FUNCTION(zlib)
  {
 ZLIBG(compression_coding) = 0;
 -   ZLIBG(output_compression) = ZLIBG(output_compression_default);
 -
 -   php_zlib_output_compression_start(TSRMLS_C);
 +if (!ZLIBG(handler_registered)) {
 +ZLIBG(output_compression) = ZLIBG(output_compression_default);
 +php_zlib_output_compression_start(TSRMLS_C);
 +}

 return SUCCESS;
  }
 @@ -976,6 +979,7 @@ static PHP_RINIT_FUNCTION(zlib)
  static PHP_RSHUTDOWN_FUNCTION(zlib)
  {
 php_zlib_cleanup_ob_gzhandler_mess(TSRMLS_C);
 +ZLIBG(handler_registered) = 0;

  return SUCCESS;
  }
 @@ -1000,6 +1004,7 @@ static PHP_MINFO_FUNCTION(zlib)
  static ZEND_MODULE_GLOBALS_CTOR_D(zlib)
  {
 zlib_globals-ob_gzhandler = NULL;
 +zlib_globals-handler_registered = 0;
  }
  /* }}} */


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




-- 
Laruence  Xinchen Hui
http://www.laruence.com/

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



[PHP-CVS] com php-src: Add syslog support to mail.log #62356: ext/standard/mail.c php.ini-development php.ini-production

2012-07-24 Thread Florian Anderiasch
Commit:ddc8d1624525e500c593f4cbd30b3358ad4ad95e
Author:Florian Anderiasch f...@php.net Tue, 24 Jul 2012 14:29:25 
+0200
Parents:   9fe8c58130ac82d2b52b35a290b71569abe50d18
Branches:  PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=ddc8d1624525e500c593f4cbd30b3358ad4ad95e

Log:
Add syslog support to mail.log #62356

Patch by Michael Orlitzky

Bugs:
https://bugs.php.net/62356

Changed paths:
  M  ext/standard/mail.c
  M  php.ini-development
  M  php.ini-production


Diff:
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index 36568c5..0bbdebc 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -39,6 +39,7 @@
 #endif
 #endif
 
+#include php_syslog.h
 #include php_mail.h
 #include php_ini.h
 #include php_string.h
@@ -189,6 +190,37 @@ PHP_FUNCTION(mail)
 }
 /* }}} */
 
+
+void php_mail_log_crlf_to_spaces(char *message) {
+   /* Find all instances of carriage returns or line feeds and
+* replace them with spaces. Thus, a log line is always one line
+* long
+*/
+   char *p = message;
+   while ((p = strpbrk(p, \r\n))) {
+   *p = ' ';
+   }
+}
+
+void php_mail_log_to_syslog(char *message) {
+   /* Write 'message' to syslog. */
+#ifdef HAVE_SYSLOG_H
+   php_syslog(LOG_NOTICE, %s, message);
+#endif
+}
+
+
+void php_mail_log_to_file(char *filename, char *message, size_t message_size) {
+   /* Write 'message' to the given file. */
+   uint flags = IGNORE_URL_WIN | REPORT_ERRORS | 
STREAM_DISABLE_OPEN_BASEDIR;
+   php_stream *stream = php_stream_open_wrapper(filename, a, flags, 
NULL);
+   if (stream) {
+   php_stream_write(stream, message, message_size);
+   php_stream_close(stream);
+   }
+}
+
+
 /* {{{ php_mail
  */
 PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, 
char *extra_cmd TSRMLS_DC)
@@ -216,19 +248,22 @@ PHPAPI int php_mail(char *to, char *subject, char 
*message, char *headers, char
if (mail_log  *mail_log) {
char *tmp;
int l = spprintf(tmp, 0, mail() on [%s:%d]: To: %s -- 
Headers: %s\n, zend_get_executed_filename(TSRMLS_C), 
zend_get_executed_lineno(TSRMLS_C), to, hdr ? hdr : );
-   php_stream *stream = php_stream_open_wrapper(mail_log, a, 
IGNORE_URL_WIN | REPORT_ERRORS | STREAM_DISABLE_OPEN_BASEDIR, NULL);
 
-   if (hdr) { /* find all \r\n instances and replace them with 
spaces, so a log line is always one line long */ 
-   char *p = tmp;
-   while ((p = strpbrk(p, \r\n))) {
-   *p = ' ';
-   }
-   tmp[l - 1] = '\n';
+   if (hdr) {
+   php_mail_log_crlf_to_spaces(tmp);
}
-   if (stream) {
-   php_stream_write(stream, tmp, l);
-   php_stream_close(stream);
+
+   if (!strcmp(mail_log, syslog)) {
+   /* Drop the final space when logging to syslog. */
+   tmp[l - 1] = 0;
+   php_mail_log_to_syslog(tmp);
+   }
+   else {
+   /* Convert the final space to a newline when logging to 
file. */
+   tmp[l - 1] = '\n';
+   php_mail_log_to_file(mail_log, tmp, l);
}
+
efree(tmp);
}
if (PG(mail_x_header)) {
diff --git a/php.ini-development b/php.ini-development
index 298cb06..4ff4192 100644
--- a/php.ini-development
+++ b/php.ini-development
@@ -1020,6 +1020,8 @@ mail.add_x_header = On
 ; The path to a log file that will log all mail() calls. Log entries include
 ; the full path of the script, line number, To address and headers.
 ;mail.log =
+; Log mail to syslog (Event Log on NT, not valid in Windows 95).
+;mail.log = syslog
 
 [SQL]
 ; http://php.net/sql.safe-mode
diff --git a/php.ini-production b/php.ini-production
index d4c1261..814455b 100644
--- a/php.ini-production
+++ b/php.ini-production
@@ -1020,6 +1020,8 @@ mail.add_x_header = On
 ; The path to a log file that will log all mail() calls. Log entries include
 ; the full path of the script, line number, To address and headers.
 ;mail.log =
+; Log mail to syslog (Event Log on NT, not valid in Windows 95).
+;mail.log = syslog
 
 [SQL]
 ; http://php.net/sql.safe-mode


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4': php.ini-development php.ini-production

2012-07-24 Thread Florian Anderiasch
Commit:81de31884d219645e4128e3dd57db8edbf5c
Author:Florian Anderiasch f...@php.net Tue, 24 Jul 2012 14:34:41 
+0200
Parents:   45d596ea1e32792c7b7b7f28be220dea861b6708 
ddc8d1624525e500c593f4cbd30b3358ad4ad95e
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=81de31884d219645e4128e3dd57db8edbf5c

Log:
Merge branch 'PHP-5.4'

* PHP-5.4:
  Add syslog support to mail.log #62356

Bugs:
https://bugs.php.net/62356

Changed paths:
  MM  php.ini-development
  MM  php.ini-production


Diff:



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



[PHP-CVS] com php-src: Add optional depth parameter to json_encode #62369: ext/json/json.c ext/json/php_json.h ext/json/tests/bug62369.phpt

2012-07-24 Thread Florian Anderiasch
Commit:45d596ea1e32792c7b7b7f28be220dea861b6708
Author:Florian Anderiasch f...@php.net Tue, 24 Jul 2012 13:15:16 
+0200
Parents:   dd9d64b21e4bbc8a106a6156dc6ffefbcc33ec02
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=45d596ea1e32792c7b7b7f28be220dea861b6708

Log:
Add optional depth parameter to json_encode #62369

Bugs:
https://bugs.php.net/62369

Changed paths:
  M  ext/json/json.c
  M  ext/json/php_json.h
  A  ext/json/tests/bug62369.phpt


Diff:
diff --git a/ext/json/json.c b/ext/json/json.c
index 9669047..dab4230 100644
--- a/ext/json/json.c
+++ b/ext/json/json.c
@@ -47,6 +47,7 @@ ZEND_DECLARE_MODULE_GLOBALS(json)
 ZEND_BEGIN_ARG_INFO_EX(arginfo_json_encode, 0, 0, 1)
ZEND_ARG_INFO(0, value)
ZEND_ARG_INFO(0, options)
+   ZEND_ARG_INFO(0, depth)
 ZEND_END_ARG_INFO()
 
 ZEND_BEGIN_ARG_INFO_EX(arginfo_json_decode, 0, 0, 1)
@@ -126,6 +127,7 @@ static PHP_GINIT_FUNCTION(json)
 {
json_globals-encoder_depth = 0;
json_globals-error_code = 0;
+   json_globals-encode_max_depth = 0;
 }
 /* }}} */
 
@@ -341,6 +343,9 @@ static void json_encode_array(smart_str *buf, zval **val, 
int options TSRMLS_DC)
}
}
 
+   if (JSON_G(encoder_depth)  JSON_G(encode_max_depth)) {
+   JSON_G(error_code) = PHP_JSON_ERROR_DEPTH;
+   }
--JSON_G(encoder_depth);
json_pretty_print_char(buf, options, '\n' TSRMLS_CC);
json_pretty_print_indent(buf, options TSRMLS_CC);
@@ -702,13 +707,16 @@ static PHP_FUNCTION(json_encode)
zval *parameter;
smart_str buf = {0};
long options = 0;
+long depth = JSON_PARSER_DEFAULT_DEPTH;
 
-   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z|l, parameter, 
options) == FAILURE) {
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z|ll, 
parameter, options, depth) == FAILURE) {
return;
}
 
JSON_G(error_code) = PHP_JSON_ERROR_NONE;
 
+   JSON_G(encode_max_depth) = depth;
+
php_json_encode(buf, parameter, options TSRMLS_CC);
 
if (JSON_G(error_code) != PHP_JSON_ERROR_NONE  !(options  
PHP_JSON_PARTIAL_OUTPUT_ON_ERROR)) {
diff --git a/ext/json/php_json.h b/ext/json/php_json.h
index afeff3f..2b3cf58 100644
--- a/ext/json/php_json.h
+++ b/ext/json/php_json.h
@@ -40,6 +40,7 @@ extern zend_module_entry json_module_entry;
 ZEND_BEGIN_MODULE_GLOBALS(json)
int encoder_depth;
int error_code;
+   int encode_max_depth;
 ZEND_END_MODULE_GLOBALS(json)
 
 #ifdef ZTS
diff --git a/ext/json/tests/bug62369.phpt b/ext/json/tests/bug62369.phpt
new file mode 100644
index 000..a5efd80
--- /dev/null
+++ b/ext/json/tests/bug62369.phpt
@@ -0,0 +1,34 @@
+--TEST--
+FR #62369 (Segfault on json_encode(deeply_nested_array)
+--SKIPIF--
+?php if (!extension_loaded(json)) print skip; ?
+--FILE--
+?php
+
+$array = array();
+for ($i=0; $i550; $i++) {
+$array = array($array);
+}
+
+json_encode($array, 0, 551);
+switch (json_last_error()) {
+case JSON_ERROR_NONE:
+echo 'OK'.PHP_EOL;
+break;
+case JSON_ERROR_DEPTH:
+echo 'ERROR'.PHP_EOL;
+break;
+}
+
+json_encode($array, 0, 540);
+switch (json_last_error()) {
+case JSON_ERROR_NONE:
+echo 'OK'.PHP_EOL;
+break;
+case JSON_ERROR_DEPTH:
+echo 'ERROR'.PHP_EOL;
+break;
+}
+--EXPECTF--
+OK
+ERROR


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



[PHP-CVS] com php-src: Updated NES: NEWS

2012-07-24 Thread Florian Anderiasch
Commit:f2cef8afc499ede08e935449030595933d070c5e
Author:Florian Anderiasch f...@php.net Tue, 24 Jul 2012 14:46:19 
+0200
Parents:   ddc8d1624525e500c593f4cbd30b3358ad4ad95e
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f2cef8afc499ede08e935449030595933d070c5e

Log:
Updated NES

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index 883d910..0df6970 100644
--- a/NEWS
+++ b/NEWS
@@ -21,6 +21,9 @@ PHP   
 NEWS
   . Fixed bug #62564 (Extending MessageFormatter and adding property causes 
 crash). (Felipe)
 
+- Mail:
+  . Fixed bug #62356 (Add syslog support to mail.log). (Michael Orlitzky)
+
 - MySQLnd:
   . Fixed bug #62594 (segfault in mysqlnd_res_meta::set_mode). (Laruence)


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



[PHP-CVS] com php-src: - Fixed ZTS build: ext/standard/mail.c

2012-07-24 Thread Felipe Pena
Commit:54cba5aa91c58e2bcfa7957f72d5f4553c0dd265
Author:Felipe Pena felipe...@gmail.com Tue, 24 Jul 2012 10:02:32 
-0300
Parents:   f2cef8afc499ede08e935449030595933d070c5e
Branches:  PHP-5.4 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=54cba5aa91c58e2bcfa7957f72d5f4553c0dd265

Log:
- Fixed ZTS build

Changed paths:
  M  ext/standard/mail.c


Diff:
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index 0bbdebc..364f7fc 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -210,7 +210,7 @@ void php_mail_log_to_syslog(char *message) {
 }
 
 
-void php_mail_log_to_file(char *filename, char *message, size_t message_size) {
+void php_mail_log_to_file(char *filename, char *message, size_t message_size 
TSRMLS_DC) {
/* Write 'message' to the given file. */
uint flags = IGNORE_URL_WIN | REPORT_ERRORS | 
STREAM_DISABLE_OPEN_BASEDIR;
php_stream *stream = php_stream_open_wrapper(filename, a, flags, 
NULL);
@@ -261,7 +261,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, 
char *headers, char
else {
/* Convert the final space to a newline when logging to 
file. */
tmp[l - 1] = '\n';
-   php_mail_log_to_file(mail_log, tmp, l);
+   php_mail_log_to_file(mail_log, tmp, l TSRMLS_CC);
}
 
efree(tmp);


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



[PHP-CVS] com php-src: ini intl.explicit_cleanup - INTL_EXPLICIT_CLEANUP: ext/intl/php_intl.c

2012-07-24 Thread Gustavo André dos Santos Lopes
Commit:f356be68c244dd0dd70894ac4a5c9b4e3a882e04
Author:Gustavo André dos Santos Lopes cataphr...@php.net Tue, 24 
Jul 2012 15:13:02 +0200
Parents:   777160f7b544971f7e73932482735af69bc42ec7
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=f356be68c244dd0dd70894ac4a5c9b4e3a882e04

Log:
ini intl.explicit_cleanup - INTL_EXPLICIT_CLEANUP

Added an environment variable and removed the ini setting
intl.explicit_cleanup for calling u_cleanup()

Changed paths:
  M  ext/intl/php_intl.c


Diff:
diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c
index 38175ca..78da0f5 100755
--- a/ext/intl/php_intl.c
+++ b/ext/intl/php_intl.c
@@ -853,36 +853,11 @@ zend_function_entry intl_functions[] = {
 };
 /* }}} */
 
-static zend_bool explicit_cleanup = 0;
-
-static ZEND_INI_MH(OnExplicitCleanupUpdate)
-{
-   if (stage == PHP_INI_STAGE_STARTUP) {
-   if (new_value_length == 2  strcasecmp(on, new_value) == 0) {
-   explicit_cleanup = (zend_bool)1;
-   }
-   else if (new_value_length == 3  strcasecmp(yes, new_value) 
== 0) {
-   explicit_cleanup = (zend_bool)1;
-   }
-   else if (new_value_length == 4  strcasecmp(true, new_value) 
== 0) {
-   explicit_cleanup = (zend_bool)1;
-   }
-   else {
-   explicit_cleanup = (zend_bool)atoi(new_value);
-   }
-   return SUCCESS;
-   } else {
-   return FAILURE;
-   }
-}
-
-
 /* {{{ INI Settings */
 PHP_INI_BEGIN()
 STD_PHP_INI_ENTRY(LOCALE_INI_NAME, NULL, PHP_INI_ALL, 
OnUpdateStringUnempty, default_locale, zend_intl_globals, intl_globals)
 STD_PHP_INI_ENTRY(intl.error_level, 0, PHP_INI_ALL, OnUpdateLong, 
error_level, zend_intl_globals, intl_globals)
STD_PHP_INI_ENTRY(intl.use_exceptions, 0, PHP_INI_ALL, 
OnUpdateBool, use_exceptions, zend_intl_globals, intl_globals)
-   PHP_INI_ENTRY_EX(intl.explicit_cleanup, 0, 0, 
OnExplicitCleanupUpdate, zend_ini_boolean_displayer_cb)
 PHP_INI_END()
 /* }}} */
 
@@ -1015,14 +990,18 @@ PHP_MINIT_FUNCTION( intl )
 }
 /* }}} */
 
+#define EXPLICIT_CLEANUP_ENV_VAR INTL_EXPLICIT_CLEANUP
+
 /* {{{ PHP_MSHUTDOWN_FUNCTION
  */
 PHP_MSHUTDOWN_FUNCTION( intl )
 {
+   const char *cleanup;
 /* For the default locale php.ini setting */
 UNREGISTER_INI_ENTRIES();
 
-if (explicit_cleanup) {
+   cleanup = getenv(EXPLICIT_CLEANUP_ENV_VAR);
+if (cleanup != NULL  !(cleanup[0] == '0'  cleanup[1] == '\0')) {
u_cleanup();
 }


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



[PHP-CVS] svn: /SVNROOT/ global_avail

2012-07-24 Thread Rasmus Lerdorf
rasmus   Tue, 24 Jul 2012 18:56:50 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=326797

Log:
karma

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail	2012-07-24 17:10:02 UTC (rev 326796)
+++ SVNROOT/global_avail	2012-07-24 18:56:50 UTC (rev 326797)
@@ -53,7 +53,7 @@
 # The PHP Documentation Group maintains the documentation and its
 # translations.


[PHP-CVS] com php-src: Fix bug #62654: sapi/fpm/fpm/fpm_sockets.c

2012-07-24 Thread Rasmus Lerdorf
Commit:5f224412fa6892645ca548ac75f20ff8743ed916
Author:Rasmus Lerdorf ras...@php.net Tue, 24 Jul 2012 16:28:49 
-0700
Parents:   54cba5aa91c58e2bcfa7957f72d5f4553c0dd265
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5f224412fa6892645ca548ac75f20ff8743ed916

Log:
Fix bug #62654

Bugs:
https://bugs.php.net/62654

Changed paths:
  M  sapi/fpm/fpm/fpm_sockets.c


Diff:
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index d24dccc..f56b9cf 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -455,11 +455,11 @@ int fpm_socket_get_listening_queue(int sock, unsigned 
*cur_lq, unsigned *max_lq)
 
 #endif
 
-int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen) /* 
{{{ */
+int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen) /* 
{{{ */
 {
int fd;
 
-   if (!sun || sun-sun_family != AF_UNIX) {
+   if (!sock || sock-sun_family != AF_UNIX) {
return -1;
}
 
@@ -467,7 +467,7 @@ int fpm_socket_unix_test_connect(struct sockaddr_un *sun, 
size_t socklen) /* {{{
return -1;
}
 
-   if (connect(fd, (struct sockaddr *)sun, socklen) == -1) {
+   if (connect(fd, (struct sockaddr *)sock, socklen) == -1) {
return -1;
}


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



[PHP-CVS] com php-src: Fix bug #62654: sapi/fpm/fpm/fpm_sockets.c

2012-07-24 Thread Rasmus Lerdorf
Commit:a05e07ea1f75b8021c9b64bf93ff970873375d97
Author:Rasmus Lerdorf ras...@php.net Tue, 24 Jul 2012 16:28:49 
-0700
Parents:   f356be68c244dd0dd70894ac4a5c9b4e3a882e04
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=a05e07ea1f75b8021c9b64bf93ff970873375d97

Log:
Fix bug #62654

Bugs:
https://bugs.php.net/62654

Changed paths:
  M  sapi/fpm/fpm/fpm_sockets.c


Diff:
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index d24dccc..f56b9cf 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -455,11 +455,11 @@ int fpm_socket_get_listening_queue(int sock, unsigned 
*cur_lq, unsigned *max_lq)
 
 #endif
 
-int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen) /* 
{{{ */
+int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen) /* 
{{{ */
 {
int fd;
 
-   if (!sun || sun-sun_family != AF_UNIX) {
+   if (!sock || sock-sun_family != AF_UNIX) {
return -1;
}
 
@@ -467,7 +467,7 @@ int fpm_socket_unix_test_connect(struct sockaddr_un *sun, 
size_t socklen) /* {{{
return -1;
}
 
-   if (connect(fd, (struct sockaddr *)sun, socklen) == -1) {
+   if (connect(fd, (struct sockaddr *)sock, socklen) == -1) {
return -1;
}


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



[PHP-CVS] com php-src: Fix bug #62654: sapi/fpm/fpm/fpm_sockets.c

2012-07-24 Thread Rasmus Lerdorf
Commit:0fbc8561e687689f796d95584cea1fa959eee83b
Author:Rasmus Lerdorf ras...@php.net Tue, 24 Jul 2012 16:28:49 
-0700
Parents:   f356be68c244dd0dd70894ac4a5c9b4e3a882e04
Branches:  master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=0fbc8561e687689f796d95584cea1fa959eee83b

Log:
Fix bug #62654

Bugs:
https://bugs.php.net/62654

Changed paths:
  M  sapi/fpm/fpm/fpm_sockets.c


Diff:
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index d24dccc..f56b9cf 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -455,11 +455,11 @@ int fpm_socket_get_listening_queue(int sock, unsigned 
*cur_lq, unsigned *max_lq)
 
 #endif
 
-int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen) /* 
{{{ */
+int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen) /* 
{{{ */
 {
int fd;
 
-   if (!sun || sun-sun_family != AF_UNIX) {
+   if (!sock || sock-sun_family != AF_UNIX) {
return -1;
}
 
@@ -467,7 +467,7 @@ int fpm_socket_unix_test_connect(struct sockaddr_un *sun, 
size_t socklen) /* {{{
return -1;
}
 
-   if (connect(fd, (struct sockaddr *)sun, socklen) == -1) {
+   if (connect(fd, (struct sockaddr *)sock, socklen) == -1) {
return -1;
}


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



[PHP-CVS] com php-src: Fix bug #62654: sapi/fpm/fpm/fpm_sockets.c

2012-07-24 Thread Gustavo André dos Santos Lopes
Commit:5799ebdb0cafb2de1dbb18cfe780976c98dbaeac
Author:Rasmus Lerdorf ras...@php.net Tue, 24 Jul 2012 16:28:49 
-0700
Committer: Gustavo André dos Santos Lopes cataphr...@php.net  Wed, 25 Jul 
2012 02:03:47 +0200
Parents:   ffa8461bfebebd8158cdb26ad5f3439c527545f7
Branches:  PHP-5.3

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5799ebdb0cafb2de1dbb18cfe780976c98dbaeac

Log:
Fix bug #62654

Bugs:
https://bugs.php.net/62654

Changed paths:
  M  sapi/fpm/fpm/fpm_sockets.c


Diff:
diff --git a/sapi/fpm/fpm/fpm_sockets.c b/sapi/fpm/fpm/fpm_sockets.c
index d24dccc..f56b9cf 100644
--- a/sapi/fpm/fpm/fpm_sockets.c
+++ b/sapi/fpm/fpm/fpm_sockets.c
@@ -455,11 +455,11 @@ int fpm_socket_get_listening_queue(int sock, unsigned 
*cur_lq, unsigned *max_lq)
 
 #endif
 
-int fpm_socket_unix_test_connect(struct sockaddr_un *sun, size_t socklen) /* 
{{{ */
+int fpm_socket_unix_test_connect(struct sockaddr_un *sock, size_t socklen) /* 
{{{ */
 {
int fd;
 
-   if (!sun || sun-sun_family != AF_UNIX) {
+   if (!sock || sock-sun_family != AF_UNIX) {
return -1;
}
 
@@ -467,7 +467,7 @@ int fpm_socket_unix_test_connect(struct sockaddr_un *sun, 
size_t socklen) /* {{{
return -1;
}
 
-   if (connect(fd, (struct sockaddr *)sun, socklen) == -1) {
+   if (connect(fd, (struct sockaddr *)sock, socklen) == -1) {
return -1;
}


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



[PHP-CVS] svn: /SVNROOT/ global_avail

2012-07-24 Thread Johannes Schlüter
johannes Wed, 25 Jul 2012 00:10:14 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=326802

Log:
Give myself access to karma.git

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2012-07-24 23:38:18 UTC (rev 326801)
+++ SVNROOT/global_avail2012-07-25 00:10:14 UTC (rev 326802)
@@ -9,7 +9,7 @@
 avail||playground.git

 # People that have access to the Karma implementation that is usedon 
git.php.net
-avail|dsp,irker,derick,fa|karma.git
+avail|dsp,irker,derick,fa,johannes|karma.git

 # Some people also have access to the configuration files in the SVNROOT.


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

[PHP-CVS] com karma: Allow myself to do forced pushes.: hooks/pre-receive

2012-07-24 Thread Johannes Schlüter
Commit:870bde4b24538cf7b64f0dd01b630241c5a53109
Author:Johannes Schlüter johan...@schlueters.de Wed, 25 Jul 2012 
02:08:05 +0200
Parents:   d1884840e7108c098ce75e7bbe204fb77b5fc975
Branches:  master

Link:   
http://git.php.net/?p=karma.git;a=commitdiff;h=870bde4b24538cf7b64f0dd01b630241c5a53109

Log:
Allow myself to do forced pushes.

This should be made nicer in some way so we can easily fix the repo when
messed up.

Changed paths:
  M  hooks/pre-receive


Diff:
diff --git a/hooks/pre-receive b/hooks/pre-receive
index 2fcfe42..d605a8d 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -133,7 +133,7 @@ if (isset($restrictedBranches[$repo_name])) {
 });
 }
 
-if (count($restricted)  0  $pi-isForced()) {
+if (count($restricted)  0  $pi-isForced()  $user != 'johannes') {
 deny(You are allowed to overwrite commits on  . implode(', ', 
$restricted));
 }


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



Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.phpt Zend/tests/const_de

2012-07-24 Thread Stas Malyshev
Hi!

On 7/24/12 5:15 PM, Johannes Schlüter wrote:
 Branch: PHP-5.4
 Deleted commits count: 2298
 User: Johannes Schlüter johan...@php.net Wed, 25 Jul 2012 00:15:30 
 +
 

What does this push do?

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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



Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.phpt Zend/tests/const_de

2012-07-24 Thread Johannes Schlüter
Hi, 

for some reason master was merged into the PHP-5.4 branch. I undid this
change in the repo. If you pulled in between your next pull should
result in an error. Use 
   git reset --hard origin/PHP-5.4
to reset your local checkout to the current version on the server.

johannes

On Wed, 2012-07-25 at 00:15 +, Johannes Schlüter wrote:
 Branch: PHP-5.4
 Deleted commits count: 2298
 User: Johannes Schlüter johan...@php.net Wed, 25 Jul 2012 00:15:30 
 +
 -- 
 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



Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.phpt Zend/tests/const_de

2012-07-24 Thread Rasmus Lerdorf
On 07/24/2012 05:18 PM, Stas Malyshev wrote:
 Hi!
 
 On 7/24/12 5:15 PM, Johannes Schlüter wrote:
 Branch: PHP-5.4
 Deleted commits count: 2298
 User: Johannes Schlüter johan...@php.net Wed, 25 Jul 2012 00:15:30 
 +

 
 What does this push do?
 

It reverses the mess I caused. I had no idea I did it, and the commit
messages didn't show it, but I merged master into 5.4 and pushed it. The
commit message just showed the trivial sun/sock fpm change, but what
actually happened was that I changed the 5.4 tree into master at the
same time. I really really hate that a simple client-side mistake can
cause silent massive code changes like this.

So, what I did to cause it was to do a 'git rebase master' in the 5.4
branch. Just muscle memory from working all day in an environment where
we develop in master all the time. The forced-push restriction we put in
to try to prevent this kind of mass-repo-fuck doesn't catch this
particular kind of fuckyness.

-Rasmus

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



[PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.

2012-07-24 Thread Sean Coates
 Use 
   git reset --hard origin/PHP-5.4
 to reset your local checkout to the current version on the server.

It should be noted that when you `reset --hard`, you'll lose local changes 
(including branch commits, except in the reflog). You'll probably want to stash 
first, reset, then stash pop (or branch locally, merge, checkout 5.4, reset, 
then cherry-pick (or maybe merge)).

Sorry for the noise if this is already widely known, but since PHP is 
relatively new to the world of git, I thought it was worth mentioning.

S



[PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.

2012-07-24 Thread Johannes Schlüter
On Tue, 2012-07-24 at 20:34 -0400, Sean Coates wrote:
  Use 
git reset --hard origin/PHP-5.4
  to reset your local checkout to the current version on the server.
 
 It should be noted that when you `reset --hard`, you'll lose local
 changes (including branch commits, except in the reflog). You'll
 probably want to stash first, reset, then stash pop (or branch
 locally, merge, checkout 5.4, reset, then cherry-pick (or maybe
 merge)).
 
 Sorry for the noise if this is already widely known, but since PHP is
 relatively new to the world of git, I thought it was worth mentioning.

Thanks for the advise! I hope nobody was affected as we had the issue
for less than an hour.

For reference:

The 5.4 with the invalid commit is backed up at 
https://github.com/johannes/php-src/commits/php-5.4-messup2
The bad commit was 8ad868 there, looks innocent but is quite a big
merge.

I wonder if anybody can suggest a way to detect such commits
automatically so we can catch them. `git diff` and others show nothing
of relevance.


To undo the commit I took the following steps:

$ git checkout PHP-5.4# Get a clean tree including the bad
  # commit
$ git reset --hard 5f224412fa689  # This is the last good commit
  # before 8ad868
$ git push -f origin PHP-5.4  # Overwrite newer versions on the
  # server. Right now only I can do that
  # (see my recent commit to karma.git)

johannes


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



[PHP-CVS] com karma: Fix error message: hooks/pre-receive

2012-07-24 Thread Johannes Schlüter
Commit:3f9aeb02ef1bde0d2f3c25c3a297bb872964c99a
Author:Johannes Schlüter johan...@schlueters.de Wed, 25 Jul 2012 
03:09:52 +0200
Parents:   870bde4b24538cf7b64f0dd01b630241c5a53109
Branches:  master

Link:   
http://git.php.net/?p=karma.git;a=commitdiff;h=3f9aeb02ef1bde0d2f3c25c3a297bb872964c99a

Log:
Fix error message

Changed paths:
  M  hooks/pre-receive


Diff:
diff --git a/hooks/pre-receive b/hooks/pre-receive
index d605a8d..e30ca6c 100755
--- a/hooks/pre-receive
+++ b/hooks/pre-receive
@@ -134,7 +134,7 @@ if (isset($restrictedBranches[$repo_name])) {
 }
 
 if (count($restricted)  0  $pi-isForced()  $user != 'johannes') {
-deny(You are allowed to overwrite commits on  . implode(', ', 
$restricted));
+deny(You are not allowed to overwrite commits on  . implode(', ', 
$restricted));
 }
 
 $prefix  = sprintf('%s/', $repo_name);


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



[PHP-CVS] Re: [PHP-DEV] Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.

2012-07-24 Thread Stas Malyshev
Hi!

 I wonder if anybody can suggest a way to detect such commits
 automatically so we can catch them. `git diff` and others show nothing
 of relevance.

We could get some commit that is only in master (like NEWS edits, for
example) and check for it - if it's ever pushed into 5.4 that's trouble.
This is of course a special master/5.4 hack but should work I think...
-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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