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
#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;
#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 */
}
/* }}} */
+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) {