version 1.1.1.1, 2012/02/21 23:47:59
|
version 1.1.1.2, 2012/05/29 12:34:41
|
Line 38 PHAR_FUNC(phar_opendir) /* {{{ */
|
Line 38 PHAR_FUNC(phar_opendir) /* {{{ */
|
goto skip_phar; |
goto skip_phar; |
} |
} |
|
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &filename, &filename_len, &zcontext) == FAILURE) { | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p|z", &filename, &filename_len, &zcontext) == FAILURE) { |
return; |
return; |
} |
} |
|
|
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { |
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { |
char *arch, *entry, *fname; |
char *arch, *entry, *fname; |
int arch_len, entry_len, fname_len; |
int arch_len, entry_len, fname_len; |
fname = zend_get_executed_filename(TSRMLS_C); | fname = (char*)zend_get_executed_filename(TSRMLS_C); |
|
|
/* we are checking for existence of a file within the relative path. Chances are good that this is |
/* we are checking for existence of a file within the relative path. Chances are good that this is |
retrieving something from within the phar archive */ |
retrieving something from within the phar archive */ |
Line 113 PHAR_FUNC(phar_file_get_contents) /* {{{ */
|
Line 113 PHAR_FUNC(phar_file_get_contents) /* {{{ */
|
} |
} |
|
|
/* Parse arguments */ |
/* Parse arguments */ |
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) { | if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p|br!ll", &filename, &filename_len, &use_include_path, &zcontext, &offset, &maxlen) == FAILURE) { |
goto skip_phar; |
goto skip_phar; |
} |
} |
|
|
Line 122 PHAR_FUNC(phar_file_get_contents) /* {{{ */
|
Line 122 PHAR_FUNC(phar_file_get_contents) /* {{{ */
|
int arch_len, entry_len, fname_len; |
int arch_len, entry_len, fname_len; |
php_stream_context *context = NULL; |
php_stream_context *context = NULL; |
|
|
fname = zend_get_executed_filename(TSRMLS_C); | fname = (char*)zend_get_executed_filename(TSRMLS_C); |
|
|
if (strncasecmp(fname, "phar://", 7)) { |
if (strncasecmp(fname, "phar://", 7)) { |
goto skip_phar; |
goto skip_phar; |
Line 203 phar_it:
|
Line 203 phar_it:
|
|
|
/* uses mmap if possible */ |
/* uses mmap if possible */ |
if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) { |
if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) { |
#if PHP_MAJOR_VERSION < 6 | #if PHP_API_VERSION < 20100412 |
if (PG(magic_quotes_runtime)) { |
if (PG(magic_quotes_runtime)) { |
int newlen; |
int newlen; |
contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */ |
contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */ |
Line 244 PHAR_FUNC(phar_readfile) /* {{{ */
|
Line 244 PHAR_FUNC(phar_readfile) /* {{{ */
|
&& !cached_phars.arBuckets) { |
&& !cached_phars.arBuckets) { |
goto skip_phar; |
goto skip_phar; |
} |
} |
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) { | if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p|br!", &filename, &filename_len, &use_include_path, &zcontext) == FAILURE) { |
goto skip_phar; |
goto skip_phar; |
} |
} |
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) { |
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) { |
Line 253 PHAR_FUNC(phar_readfile) /* {{{ */
|
Line 253 PHAR_FUNC(phar_readfile) /* {{{ */
|
php_stream_context *context = NULL; |
php_stream_context *context = NULL; |
char *name; |
char *name; |
phar_archive_data *phar; |
phar_archive_data *phar; |
fname = zend_get_executed_filename(TSRMLS_C); | fname = (char*)zend_get_executed_filename(TSRMLS_C); |
|
|
if (strncasecmp(fname, "phar://", 7)) { |
if (strncasecmp(fname, "phar://", 7)) { |
goto skip_phar; |
goto skip_phar; |
Line 340 PHAR_FUNC(phar_fopen) /* {{{ */
|
Line 340 PHAR_FUNC(phar_fopen) /* {{{ */
|
/* no need to check, include_path not even specified in fopen/ no active phars */ |
/* no need to check, include_path not even specified in fopen/ no active phars */ |
goto skip_phar; |
goto skip_phar; |
} |
} |
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ss|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) { | if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "ps|br", &filename, &filename_len, &mode, &mode_len, &use_include_path, &zcontext) == FAILURE) { |
goto skip_phar; |
goto skip_phar; |
} |
} |
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) { |
if (use_include_path || (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://"))) { |
Line 349 PHAR_FUNC(phar_fopen) /* {{{ */
|
Line 349 PHAR_FUNC(phar_fopen) /* {{{ */
|
php_stream_context *context = NULL; |
php_stream_context *context = NULL; |
char *name; |
char *name; |
phar_archive_data *phar; |
phar_archive_data *phar; |
fname = zend_get_executed_filename(TSRMLS_C); | fname = (char*)zend_get_executed_filename(TSRMLS_C); |
|
|
if (strncasecmp(fname, "phar://", 7)) { |
if (strncasecmp(fname, "phar://", 7)) { |
goto skip_phar; |
goto skip_phar; |
Line 621 static void phar_file_stat(const char *filename, php_s
|
Line 621 static void phar_file_stat(const char *filename, php_s
|
phar_entry_info *data = NULL; |
phar_entry_info *data = NULL; |
phar_archive_data *phar; |
phar_archive_data *phar; |
|
|
fname = zend_get_executed_filename(TSRMLS_C); | fname = (char*)zend_get_executed_filename(TSRMLS_C); |
|
|
/* we are checking for existence of a file within the relative path. Chances are good that this is |
/* we are checking for existence of a file within the relative path. Chances are good that this is |
retrieving something from within the phar archive */ |
retrieving something from within the phar archive */ |
Line 813 void fname(INTERNAL_FUNCTION_PARAMETERS) { \
|
Line 813 void fname(INTERNAL_FUNCTION_PARAMETERS) { \
|
char *filename; \ |
char *filename; \ |
int filename_len; \ |
int filename_len; \ |
\ |
\ |
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { \ | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { \ |
return; \ |
return; \ |
} \ |
} \ |
\ |
\ |
Line 905 PHAR_FUNC(phar_is_file) /* {{{ */
|
Line 905 PHAR_FUNC(phar_is_file) /* {{{ */
|
&& !cached_phars.arBuckets) { |
&& !cached_phars.arBuckets) { |
goto skip_phar; |
goto skip_phar; |
} |
} |
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { | if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { |
goto skip_phar; |
goto skip_phar; |
} |
} |
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { |
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { |
char *arch, *entry, *fname; |
char *arch, *entry, *fname; |
int arch_len, entry_len, fname_len; |
int arch_len, entry_len, fname_len; |
fname = zend_get_executed_filename(TSRMLS_C); | fname = (char*)zend_get_executed_filename(TSRMLS_C); |
|
|
/* we are checking for existence of a file within the relative path. Chances are good that this is |
/* we are checking for existence of a file within the relative path. Chances are good that this is |
retrieving something from within the phar archive */ |
retrieving something from within the phar archive */ |
Line 972 PHAR_FUNC(phar_is_link) /* {{{ */
|
Line 972 PHAR_FUNC(phar_is_link) /* {{{ */
|
&& !cached_phars.arBuckets) { |
&& !cached_phars.arBuckets) { |
goto skip_phar; |
goto skip_phar; |
} |
} |
if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "s", &filename, &filename_len) == FAILURE) { | if (zend_parse_parameters_ex(ZEND_PARSE_PARAMS_QUIET, ZEND_NUM_ARGS() TSRMLS_CC, "p", &filename, &filename_len) == FAILURE) { |
goto skip_phar; |
goto skip_phar; |
} |
} |
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { |
if (!IS_ABSOLUTE_PATH(filename, filename_len) && !strstr(filename, "://")) { |
char *arch, *entry, *fname; |
char *arch, *entry, *fname; |
int arch_len, entry_len, fname_len; |
int arch_len, entry_len, fname_len; |
fname = zend_get_executed_filename(TSRMLS_C); | fname = (char*)zend_get_executed_filename(TSRMLS_C); |
|
|
/* we are checking for existence of a file within the relative path. Chances are good that this is |
/* we are checking for existence of a file within the relative path. Chances are good that this is |
retrieving something from within the phar archive */ |
retrieving something from within the phar archive */ |