Re: com php-src: Add ability of alias resolving (it cause problem while work with opcache): ext/phar/config.m4 ext/phar/php_phar.h ext/phar/util.c
| From: | Pierre Joye | Date: | Thu, 17 Oct 2013 10:09:47 +0000 |
| Subject: | Re: com php-src: Add ability of alias resolving (it cause problem while work with opcache): ext/phar/config.m4 ext/phar/php_phar.h ext/phar/util.c | ||
| References: | 1 2 3 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-73681@lists.php.net to get a copy of this message | ||
Please add a note to UPGRADING.INTERNALS too :)
On Thu, Oct 17, 2013 at 11:40 AM, Laruence <laruence@php.net> wrote:
> On Thu, Oct 17, 2013 at 4:53 PM, Nikita Popov <nikita.ppv@gmail.com> wrote:
>> On Thu, Oct 17, 2013 at 6:23 AM, Xinchen Hui <laruence@php.net> wrote:
>>>
>>> Commit: 06994a419d625291c2ae071e3b22716901b45cf6
>>> Author: Xinchen Hui <laruence@php.net> Thu, 17 Oct 2013
>>> 12:23:09 +0800
>>> Parents: 865f22162767bcdac60d90b2509751601b65f6ee
>>> Branches: PHP-5.5
>>>
>>> Link:
>>>
>>> http://git.php.net/?p=php-src.git;a=commitdiff;h=06994a419d625291c2ae071e3b22716901b45cf6
>>>
>>> Log:
>>> Add ability of alias resolving (it cause problem while work with opcache)
>>>
>>> Changed paths:
>>> M ext/phar/config.m4
>>> M ext/phar/php_phar.h
>>> M ext/phar/util.c
>>>
>>>
>>> Diff:
>>> diff --git a/ext/phar/config.m4 b/ext/phar/config.m4
>>> index d424060..614d672 100644
>>> --- a/ext/phar/config.m4
>>> +++ b/ext/phar/config.m4
>>> @@ -28,5 +28,7 @@ if test "$PHP_PHAR" != "no"; then
>>> PHP_ADD_EXTENSION_DEP(phar, spl, true)
>>> PHP_ADD_MAKEFILE_FRAGMENT
>>>
>>> + PHP_INSTALL_HEADERS([ext/phar], [php_phar.h])
>>> +
>>> PHP_OUTPUT(ext/phar/phar.1 ext/phar/phar.phar.1)
>>> fi
>>> diff --git a/ext/phar/php_phar.h b/ext/phar/php_phar.h
>>> index a6d7bff..4146e28 100644
>>> --- a/ext/phar/php_phar.h
>>> +++ b/ext/phar/php_phar.h
>>> @@ -22,7 +22,7 @@
>>> #ifndef PHP_PHAR_H
>>> #define PHP_PHAR_H
>>>
>>> -#define PHP_PHAR_VERSION "2.0.1"
>>> +#define PHP_PHAR_VERSION "2.0.2"
>>>
>>> #include "ext/standard/basic_functions.h"
>>> extern zend_module_entry phar_module_entry;
>>> @@ -31,9 +31,12 @@ extern zend_module_entry phar_module_entry;
>>> #ifdef PHP_WIN32
>>> #define PHP_PHAR_API __declspec(dllexport)
>>> #else
>>> -#define PHP_PHAR_API
>>> +#define PHP_PHAR_API PHPAPI
>>> #endif
>>
>>
>> Could we replace this with just
#define PHP_PHAR_API PHPAPI
>> (without any
>> conditionals)?
>>
>>>
>>> +PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char
>>> **filename, int *filename_len TSRMLS_DC) /* {{{ */ {
>>> + phar_archive_data **fd_ptr;
>>> + if (SUCCESS == zend_hash_find(&(PHAR_GLOBALS->phar_alias_map),
>>> alias, alias_len, (void**)&fd_ptr)) {
>>> + *filename = (*fd_ptr)->fname;
>>> + *filename_len = (*fd_ptr)->fname_len;
>>> + return 1;
>>> + }
>>> + return 0;
>>> +}
>>> +/* }}} */
>>
>>
>> The return type seems slightly confusing here. If it returns a boolean it
>> would be nice to declare the return type as zend_bool. If
>> it returns a
>> status code, maybe use SUCCESS/FAILURE instead of 0/1?
> Nikita, thanks, make sense, I will update it.
>
>
>>
>> Nikita
>
>
>
> --
> Laruence Xinchen Hui
> http://www.laruence.com/
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--
Pierre
@pierrejoye | http://blog.thepimp.net | http://www.libgd.org