Re: com php-src: export output globals: main/output.c main/php_output.h

From: Date: Wed, 29 Oct 2014 22:24:55 +0000
Subject: Re: com php-src: export output globals: main/output.c main/php_output.h
References: 1 2  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82881@lists.php.net to get a copy of this message
On Wed, October 29, 2014 21:01, Michael Wallner wrote: > We should rather look if an API is missing instead of going back using > OG(). > On 29 Oct 2014 20:06, "Anatol Belski" <ab@php.net> wrote: > > >> Commit: 5d76185792d2c7c7d47838b71a0b230f9668e21c >> Author: Anatol Belski <ab@php.net> Wed, 29 Oct 2014 20:02:41 >> +0100 >> Parents: 4b8f411d313bddb0c1cd9308a7402ea20fb348b4 >> Branches: PHP-5.6 master >> >> >> Link: >> >> http://git.php.net/?p=php-src.git;a=commitdiff;h=5d76185792d2c7c7d47838b >> 71a0b230f9668e21c >> >> >> Log: >> export output globals >> >> needed by phpdbg >> >> Changed paths: >> M main/output.c >> M main/php_output.h >> >> >> >> Diff: >> diff --git a/main/output.c b/main/output.c index 1dac717..c2b7b34 100644 >> --- a/main/output.c >> +++ b/main/output.c >> @@ -35,7 +35,11 @@ >> #include "zend_stack.h" >> #include "php_output.h" >> >> >> -ZEND_DECLARE_MODULE_GLOBALS(output); >> +#ifdef ZTS >> +PHPAPI int output_globals_id; >> +#else >> +PHPAPI php_output_globals output_globals; >> +#endif >> >> >> const char php_output_default_handler_name[sizeof("default output >> handler")] = "default output handler"; const char >> php_output_devnull_handler_name[sizeof("null output handler")] = "null >> output handler"; diff --git a/main/php_output.h b/main/php_output.h index >> 0312e25..947da2c 100644 >> --- a/main/php_output.h >> +++ b/main/php_output.h >> @@ -152,6 +152,12 @@ ZEND_BEGIN_MODULE_GLOBALS(output) >> int output_start_lineno; ZEND_END_MODULE_GLOBALS(output) >> >> >> +#ifdef ZTS >> +PHPAPI extern int output_globals_id; >> +#else >> +PHPAPI extern php_output_globals output_globals; >> +#endif >> + >> /* there should not be a need to use OG() from outside of output.c */ >> #ifdef ZTS >> # define OG(v) TSRMG(output_globals_id, zend_output_globals *, v) >> >> >> What I had as idea was to do something like PHPAPI ZEND_DECLARE_MODULE_GLOBALS, thus to export automatically every globals. Not sure whether that's too much, but I've already met such issues with non-core extensions or even with the extensions in separate modules, which need to access others module globals. But not sure that's too much (maybe were ok for master). Regards Anatol

« previous php.cvs (#82881) next »