|
18 | 18 |
|
19 | 19 | #include "phar_internal.h"
|
20 | 20 |
|
21 |
| -#define PHAR_FUNC(name) \ |
22 |
| - static PHP_NAMED_FUNCTION(name) |
23 |
| - |
24 |
| -PHAR_FUNC(phar_opendir) /* {{{ */ |
| 21 | +PHP_FUNCTION(phar_opendir) /* {{{ */ |
25 | 22 | {
|
26 | 23 | char *filename;
|
27 | 24 | size_t filename_len;
|
@@ -156,7 +153,7 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool
|
156 | 153 | return name;
|
157 | 154 | }
|
158 | 155 |
|
159 |
| -PHAR_FUNC(phar_file_get_contents) /* {{{ */ |
| 156 | +PHP_FUNCTION(phar_file_get_contents) /* {{{ */ |
160 | 157 | {
|
161 | 158 | zend_string *filename;
|
162 | 159 | zend_string *contents;
|
@@ -233,7 +230,7 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
|
233 | 230 | }
|
234 | 231 | /* }}} */
|
235 | 232 |
|
236 |
| -PHAR_FUNC(phar_readfile) /* {{{ */ |
| 233 | +PHP_FUNCTION(phar_readfile) /* {{{ */ |
237 | 234 | {
|
238 | 235 | zend_string *filename;
|
239 | 236 | bool use_include_path = 0;
|
@@ -277,7 +274,7 @@ PHAR_FUNC(phar_readfile) /* {{{ */
|
277 | 274 | }
|
278 | 275 | /* }}} */
|
279 | 276 |
|
280 |
| -PHAR_FUNC(phar_fopen) /* {{{ */ |
| 277 | +PHP_FUNCTION(phar_fopen) /* {{{ */ |
281 | 278 | {
|
282 | 279 | zend_string *filename;
|
283 | 280 | char *mode;
|
@@ -653,7 +650,7 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ
|
653 | 650 | /* }}} */
|
654 | 651 |
|
655 | 652 | #define PharFileFunction(fname, funcnum, orig) \
|
656 |
| -ZEND_NAMED_FUNCTION(fname) { \ |
| 653 | +PHP_FUNCTION(fname) { \ |
657 | 654 | if (!PHAR_G(intercepted)) { \
|
658 | 655 | PHAR_G(orig)(INTERNAL_FUNCTION_PARAM_PASSTHRU); \
|
659 | 656 | } else { \
|
@@ -725,7 +722,7 @@ PharFileFunction(phar_file_exists, FS_EXISTS, orig_file_exists)
|
725 | 722 | PharFileFunction(phar_is_dir, FS_IS_DIR, orig_is_dir)
|
726 | 723 | /* }}} */
|
727 | 724 |
|
728 |
| -PHAR_FUNC(phar_is_file) /* {{{ */ |
| 725 | +PHP_FUNCTION(phar_is_file) /* {{{ */ |
729 | 726 | {
|
730 | 727 | char *filename;
|
731 | 728 | size_t filename_len;
|
@@ -791,7 +788,7 @@ PHAR_FUNC(phar_is_file) /* {{{ */
|
791 | 788 | }
|
792 | 789 | /* }}} */
|
793 | 790 |
|
794 |
| -PHAR_FUNC(phar_is_link) /* {{{ */ |
| 791 | +PHP_FUNCTION(phar_is_link) /* {{{ */ |
795 | 792 | {
|
796 | 793 | char *filename;
|
797 | 794 | size_t filename_len;
|
@@ -886,7 +883,7 @@ void phar_release_functions(void)
|
886 | 883 | PHAR_G(orig_##func) = NULL; \
|
887 | 884 | if (NULL != (orig = zend_hash_str_find_ptr(CG(function_table), #func, sizeof(#func)-1))) { \
|
888 | 885 | PHAR_G(orig_##func) = orig->internal_function.handler; \
|
889 |
| - orig->internal_function.handler = phar_##func; \ |
| 886 | + orig->internal_function.handler = PHP_FN(phar_##func); \ |
890 | 887 | }
|
891 | 888 |
|
892 | 889 | void phar_intercept_functions_init(void)
|
|
0 commit comments