Skip to content

Commit a736697

Browse files
committed
ext/phar: Use standard naming for PHP functions
1 parent 7e45e57 commit a736697

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

ext/phar/func_interceptors.c

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,7 @@
1818

1919
#include "phar_internal.h"
2020

21-
#define PHAR_FUNC(name) \
22-
static PHP_NAMED_FUNCTION(name)
23-
24-
PHAR_FUNC(phar_opendir) /* {{{ */
21+
PHP_FUNCTION(phar_opendir) /* {{{ */
2522
{
2623
char *filename;
2724
size_t filename_len;
@@ -156,7 +153,7 @@ static zend_string* phar_get_name_for_relative_paths(zend_string *filename, bool
156153
return name;
157154
}
158155

159-
PHAR_FUNC(phar_file_get_contents) /* {{{ */
156+
PHP_FUNCTION(phar_file_get_contents) /* {{{ */
160157
{
161158
zend_string *filename;
162159
zend_string *contents;
@@ -233,7 +230,7 @@ PHAR_FUNC(phar_file_get_contents) /* {{{ */
233230
}
234231
/* }}} */
235232

236-
PHAR_FUNC(phar_readfile) /* {{{ */
233+
PHP_FUNCTION(phar_readfile) /* {{{ */
237234
{
238235
zend_string *filename;
239236
bool use_include_path = 0;
@@ -277,7 +274,7 @@ PHAR_FUNC(phar_readfile) /* {{{ */
277274
}
278275
/* }}} */
279276

280-
PHAR_FUNC(phar_fopen) /* {{{ */
277+
PHP_FUNCTION(phar_fopen) /* {{{ */
281278
{
282279
zend_string *filename;
283280
char *mode;
@@ -653,7 +650,7 @@ static void phar_file_stat(const char *filename, size_t filename_length, int typ
653650
/* }}} */
654651

655652
#define PharFileFunction(fname, funcnum, orig) \
656-
ZEND_NAMED_FUNCTION(fname) { \
653+
PHP_FUNCTION(fname) { \
657654
if (!PHAR_G(intercepted)) { \
658655
PHAR_G(orig)(INTERNAL_FUNCTION_PARAM_PASSTHRU); \
659656
} else { \
@@ -725,7 +722,7 @@ PharFileFunction(phar_file_exists, FS_EXISTS, orig_file_exists)
725722
PharFileFunction(phar_is_dir, FS_IS_DIR, orig_is_dir)
726723
/* }}} */
727724

728-
PHAR_FUNC(phar_is_file) /* {{{ */
725+
PHP_FUNCTION(phar_is_file) /* {{{ */
729726
{
730727
char *filename;
731728
size_t filename_len;
@@ -791,7 +788,7 @@ PHAR_FUNC(phar_is_file) /* {{{ */
791788
}
792789
/* }}} */
793790

794-
PHAR_FUNC(phar_is_link) /* {{{ */
791+
PHP_FUNCTION(phar_is_link) /* {{{ */
795792
{
796793
char *filename;
797794
size_t filename_len;
@@ -886,7 +883,7 @@ void phar_release_functions(void)
886883
PHAR_G(orig_##func) = NULL; \
887884
if (NULL != (orig = zend_hash_str_find_ptr(CG(function_table), #func, sizeof(#func)-1))) { \
888885
PHAR_G(orig_##func) = orig->internal_function.handler; \
889-
orig->internal_function.handler = phar_##func; \
886+
orig->internal_function.handler = PHP_FN(phar_##func); \
890887
}
891888

892889
void phar_intercept_functions_init(void)

0 commit comments

Comments
 (0)