From: Greg Beaver Date: Sat, 21 Jun 2008 17:05:18 +0000 (+0000) Subject: PHP 5.2 fixes to direct include of compressed archives X-Git-Tag: php-5.3.0alpha1~683 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=eb0a98939a63d47f2b3b6cdc4c4fdbb801b5bbfb;p=php PHP 5.2 fixes to direct include of compressed archives --- diff --git a/ext/phar/phar.c b/ext/phar/phar.c index af9fba71a8..ff1f774aa5 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -3123,13 +3123,13 @@ static void php_phar_init_globals_module(zend_phar_globals *phar_globals) } /* }}} */ -#if PHP_VERSION_ID >= 50300 static size_t phar_zend_stream_reader(void *handle, char *buf, size_t len TSRMLS_DC) /* {{{ */ { return php_stream_read(phar_get_pharfp((phar_archive_data*)handle TSRMLS_CC), buf, len); } /* }}} */ +#if PHP_VERSION_ID >= 50300 static size_t phar_zend_stream_fsizer(void *handle TSRMLS_DC) /* {{{ */ { return ((phar_archive_data*)handle)->halt_offset + 32; @@ -3137,7 +3137,7 @@ static size_t phar_zend_stream_fsizer(void *handle TSRMLS_DC) /* {{{ */ #else /* PHP_VERSION_ID */ -static long stream_fteller_for_zend(void *handle TSRMLS_DC) /* {{{ */ +static long phar_stream_fteller_for_zend(void *handle TSRMLS_DC) /* {{{ */ { return (long)php_stream_tell(phar_get_pharfp((phar_archive_data*)handle TSRMLS_CC)); } @@ -3201,9 +3201,9 @@ static zend_op_array *phar_compile_file(zend_file_handle *file_handle, int type file_handle->free_filename = 0; /* we do our own reading directly from the phar, don't change the next line */ file_handle->handle.stream.handle = phar; - file_handle->handle.stream.reader = (zend_stream_reader_t)_php_stream_read; + file_handle->handle.stream.reader = phar_zend_stream_reader; file_handle->handle.stream.closer = NULL; /* don't close - let phar handle this one */ - file_handle->handle.stream.fteller = stream_fteller_for_zend; + file_handle->handle.stream.fteller = phar_stream_fteller_for_zend; file_handle->handle.stream.interactive = 0; phar->is_persistent ? php_stream_rewind(PHAR_GLOBALS->cached_fp[phar->phar_pos].fp) :