Ilia, hi,

There's no way to query the current callback setting there. If RINIT's the only way to achieve it, and we can't have RINIT, the manual needs fixing to reflect reality.

So - are you officially calling it a 'won't fix'?

Or is there a less intrusive fix in the wings? (Read: I've no idea whether promoting OnChangeCallback to ZEND_INI_MH() would do the trick.)

- Steph


----- Original Message ----- From: "Ilia Alshanetsky" <[EMAIL PROTECTED]>
To: "Dmitry Stogov" <[EMAIL PROTECTED]>
Cc: <php-cvs@lists.php.net>
Sent: Friday, February 16, 2007 1:47 PM
Subject: Re: [PHP-CVS] cvs: php-src /ext/standard assert.c basic_functions.c


Dmitry,

Please revert this patch. The code adds RINIT that hits every request for functionality that is only needed for testing of the code and is otherwise rarely used. I do not believe it warrants slowing down every single request, even by a little bit.


On 16-Feb-07, at 8:12 AM, Dmitry Stogov wrote:

dmitry Fri Feb 16 13:12:55 2007 UTC

  Modified files:
    /php-src/ext/standard assert.c basic_functions.c
  Log:
Fixed return value of assert_options(ASSERT_CALLBACK) and possible crash (Andy Wharmby)


http://cvs.php.net/viewvc.cgi/php-src/ext/standard/assert.c? r1=1.71&r2=1.72&diff_format=u
Index: php-src/ext/standard/assert.c
diff -u php-src/ext/standard/assert.c:1.71 php-src/ext/standard/ assert.c:1.72
--- php-src/ext/standard/assert.c:1.71 Mon Jan  1 09:29:30 2007
+++ php-src/ext/standard/assert.c Fri Feb 16 13:12:55 2007
@@ -16,7 +16,7 @@

+--------------------------------------------------------------------- -+
  */

-/* $Id: assert.c,v 1.71 2007/01/01 09:29:30 sebastian Exp $ */
+/* $Id: assert.c,v 1.72 2007/02/16 13:12:55 dmitry Exp $ */

 /* {{{ includes/startup/misc */

@@ -114,6 +114,16 @@
 return SUCCESS;
 }

+PHP_RINIT_FUNCTION(assert)
+{
+ if (ASSERTG(cb)) {
+ MAKE_STD_ZVAL(ASSERTG(callback));
+ ZVAL_STRING(ASSERTG(callback), ASSERTG(cb), 1);
+ }
+
+ return SUCCESS;
+}
+
 PHP_RSHUTDOWN_FUNCTION(assert)
 {
 if (ASSERTG(callback)) {
@@ -202,11 +212,6 @@
 RETURN_TRUE;
 }

- if (!ASSERTG(callback) && ASSERTG(cb)) {
- MAKE_STD_ZVAL(ASSERTG(callback));
- ZVAL_STRING(ASSERTG(callback), ASSERTG(cb), 1);
- }
-
 if (ASSERTG(callback)) {
 zval *args[3];
 zval *retval;
@@ -309,6 +314,11 @@
 break;

 case ASSERT_CALLBACK:
+ if (ASSERTG(callback) != NULL) {
+ RETVAL_ZVAL(ASSERTG(callback), 1, 0);
+ } else {
+ RETVAL_NULL();
+ }
 if (ac == 2) {
 if (ASSERTG(callback)) {
 zval_ptr_dtor(&ASSERTG(callback));
@@ -316,7 +326,7 @@
 ASSERTG(callback) = *value;
 zval_add_ref(value);
 }
- RETURN_TRUE;
+ return;
 break;

 default:
http://cvs.php.net/viewvc.cgi/php-src/ext/standard/ basic_functions.c?r1=1.846&r2=1.847&diff_format=u
Index: php-src/ext/standard/basic_functions.c
diff -u php-src/ext/standard/basic_functions.c:1.846 php-src/ext/ standard/basic_functions.c:1.847 --- php-src/ext/standard/basic_functions.c:1.846 Thu Feb 8 15:31:01 2007
+++ php-src/ext/standard/basic_functions.c Fri Feb 16 13:12:55 2007
@@ -17,7 +17,7 @@

+--------------------------------------------------------------------- -+
  */

-/* $Id: basic_functions.c,v 1.846 2007/02/08 15:31:01 helly Exp $ */
+/* $Id: basic_functions.c,v 1.847 2007/02/16 13:12:55 dmitry Exp $ */

 #include "php.h"
 #include "php_streams.h"
@@ -4147,6 +4147,7 @@
 #ifdef HAVE_SYSLOG_H
 PHP_RINIT(syslog)(INIT_FUNC_ARGS_PASSTHRU);
 #endif
+ PHP_RINIT(assert) (INIT_FUNC_ARGS_PASSTHRU);
 PHP_RINIT(dir)(INIT_FUNC_ARGS_PASSTHRU);
 PHP_RINIT(url_scanner_ex)(INIT_FUNC_ARGS_PASSTHRU);


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


Ilia Alshanetsky

--
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

Reply via email to