diff options
author | Xinchen Hui <laruence@php.net> | 2013-10-17 12:25:01 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2013-10-17 12:25:01 +0800 |
commit | a1a7522105c333aff3d8c6c61ec68a85c8dd9927 (patch) | |
tree | b49a812b7f30790004e9f2949f26d0c65fc6eae4 /ext | |
parent | d51553e3992d6c7d2654db6342fa8c0393a85380 (diff) | |
parent | 06994a419d625291c2ae071e3b22716901b45cf6 (diff) | |
download | php-git-a1a7522105c333aff3d8c6c61ec68a85c8dd9927.tar.gz |
Merge branch 'PHP-5.5'
Diffstat (limited to 'ext')
-rw-r--r-- | ext/phar/config.m4 | 2 | ||||
-rw-r--r-- | ext/phar/php_phar.h | 7 | ||||
-rw-r--r-- | ext/phar/util.c | 11 |
3 files changed, 18 insertions, 2 deletions
diff --git a/ext/phar/config.m4 b/ext/phar/config.m4 index d424060f2a..614d672eab 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 a6d7bff414..4146e28f77 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 +#define PHAR_HAVE_RESOLVE_ALIAS +PHP_PHAR_API int phar_resolve_alias(char *alias, int alias_len, char **filename, int *filename_len TSRMLS_DC); + #endif /* PHP_PHAR_H */ diff --git a/ext/phar/util.c b/ext/phar/util.c index d42164a57c..697c35767d 100644 --- a/ext/phar/util.c +++ b/ext/phar/util.c @@ -927,6 +927,17 @@ phar_entry_info * phar_open_jit(phar_archive_data *phar, phar_entry_info *entry, } /* }}} */ +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; +} +/* }}} */ + int phar_free_alias(phar_archive_data *phar, char *alias, int alias_len TSRMLS_DC) /* {{{ */ { if (phar->refcount || phar->is_persistent) { |