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: | Xinchen Hui | Date: | Thu, 17 Oct 2013 04:23:09 +0000 |
| Subject: | 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 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-73675@lists.php.net to get a copy of this message | ||
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
+#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 8348a47..e9f1b16 100644
--- a/ext/phar/util.c
+++ b/ext/phar/util.c
@@ -1185,6 +1185,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) {