diff --git a/patches/Readme.md b/patches/Readme.md index 7827ad4..e7c50f6 100644 --- a/patches/Readme.md +++ b/patches/Readme.md @@ -3,7 +3,7 @@ 名称 Name | 平台 Platform | 可选? Optional? | 用途 Usage --- | --- | --- | --- -phar.patch | * | 可选 Optional | 允许micro使用压缩phar Allow micro use compressed phar +phar_\.patch | * | 可选 Optional | 允许micro使用压缩phar Allow micro use compressed phar static_opcache_\.patch | * | 可选 Optional | 支持静态构建opcache Support build opcache statically macos_iconv.patch | macOS | 可选 Optional | 支持链接到系统的iconv Support link against system iconv static_extensions_win32_\.patch | Windows | 可选 Optional | 支持静态构建Windows其他扩展 Support build other extensions for windows diff --git a/patches/phar_80.patch b/patches/phar_80.patch new file mode 100644 index 0000000..c33a24f --- /dev/null +++ b/patches/phar_80.patch @@ -0,0 +1,22 @@ +diff --git a/ext/phar/phar.c b/ext/phar/phar.c +index 2403d77a..c908a1b4 100644 +--- a/ext/phar/phar.c ++++ b/ext/phar/phar.c +@@ -3309,6 +3309,8 @@ static zend_string *phar_resolve_path(const char *filename, size_t filename_len) + return phar_find_in_include_path((char *) filename, filename_len, NULL); + } + ++char *micro_get_filename(void); ++ + static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type) /* {{{ */ + { + zend_op_array *res; +@@ -3319,7 +3321,7 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type) + if (!file_handle || !file_handle->filename) { + return phar_orig_compile_file(file_handle, type); + } +- if (strstr(file_handle->filename, ".phar") && !strstr(file_handle->filename, "://")) { ++ if ((strstr(file_handle->filename, micro_get_filename()) || strstr(file_handle->filename, ".phar")) && !strstr(file_handle->filename, "://")) { + if (SUCCESS == phar_open_from_filename((char*)file_handle->filename, strlen(file_handle->filename), NULL, 0, 0, &phar, NULL)) { + if (phar->is_zip || phar->is_tar) { + zend_file_handle f = *file_handle; diff --git a/patches/phar.patch b/patches/phar_81.patch similarity index 100% rename from patches/phar.patch rename to patches/phar_81.patch