cvs: pecl /phar phar.c phar_internal.h

From: Date: Mon, 14 Apr 2008 04:47:33 +0000
Subject: cvs: pecl /phar phar.c phar_internal.h
Groups: php.pecl.cvs 
Request: Send a blank email to pecl-cvs+get-10369@lists.php.net to get a copy of this message
cellog Mon Apr 14 04:47:33 2008 UTC Modified files: /pecl/phar phar.c phar_internal.h Log: another attempt at fixing mac OS X compile, remove unused obsolete code http://cvs.php.net/viewvc.cgi/pecl/phar/phar.c?r1=1.328&r2=1.329&diff_format=u Index: pecl/phar/phar.c diff -u pecl/phar/phar.c:1.328 pecl/phar/phar.c:1.329 --- pecl/phar/phar.c:1.328 Thu Apr 10 03:12:07 2008 +++ pecl/phar/phar.c Mon Apr 14 04:47:33 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar.c,v 1.328 2008/04/10 03:12:07 cellog Exp $ */ +/* $Id: phar.c,v 1.329 2008/04/14 04:47:33 cellog Exp $ */ #define PHAR_MAIN 1 #include "phar_internal.h" @@ -25,6 +25,11 @@ #include "func_interceptors.h" ZEND_DECLARE_MODULE_GLOBALS(phar) +int phar_has_bz2; +int phar_has_zlib; +#if PHP_VERSION_ID >= 50300 +char *(*phar_save_resolve_path)(const char *filename, int filename_len TSRMLS_DC); +#endif /** * set's phar->is_writeable based on the current INI value @@ -2663,7 +2668,7 @@ /* this code is obsoleted in php 5.3 */ entry = (char *) filename; - if (!IS_ABSOLUTE_PATH(entry, strlen(entry))) { + if (!IS_ABSOLUTE_PATH(entry, strlen(entry)) && !strstr(entry, "://")) { phar_archive_data **pphar = NULL; char *fname; int fname_len; @@ -2696,67 +2701,6 @@ } return FAILURE; } -#if HELLY_0 - if (0 && zend_hash_num_elements(&(PHAR_GLOBALS->phar_fname_map))) { - char *fname = NULL; - int fname_len; - - fname = zend_get_executed_filename(TSRMLS_C); - if (strncasecmp(fname, "phar://", 7)) { - goto skip_phar; - } - fname_len = strlen(fname); - if (SUCCESS == phar_split_fname(fname, fname_len, &arch, &arch_len, &entry, &entry_len TSRMLS_CC)) { - char *name, *old; - - old = entry; - entry = (char *) filename; - /* include within phar, if :// is not in the url, then prepend phar://<archive>/ */ - if (strstr(entry, "://")) { - efree(arch); - efree(old); - goto skip_phar; - } - entry_len = strlen(entry); - if (!IS_ABSOLUTE_PATH(entry, entry_len)) { - phar_archive_data *pphar = NULL; - /* retrieving an include within the current directory, so use this if possible */ - if (SUCCESS == (zend_hash_find(&(PHAR_GLOBALS->phar_fname_map), arch, arch_len, (void **) &pphar))) { - if (!(entry = phar_find_in_include_path(entry, entry_len, &pphar TSRMLS_CC))) { - /* this file is not in the phar, use the original path */ - if (SUCCESS == phar_orig_zend_open(filename, handle TSRMLS_CC)) { - if (SUCCESS == phar_mount_entry(pphar, handle->opened_path ? handle->opened_path : (char *) filename, strlen(handle->opened_path ? handle->opened_path : filename), (char *) filename, strlen(filename) TSRMLS_CC)) { - if (handle->opened_path) { - efree(handle->opened_path); - } - entry = (char *) filename; - goto dopharthing; - } - } - efree(old); - efree(arch); - return FAILURE; - } - } - } -dopharthing: - efree(old); - /* auto-convert to phar:// */ - spprintf(&name, 4096, "phar://%s/%s", arch, entry); - efree(arch); - if (entry != filename) { - efree(entry); - } - if (SUCCESS == phar_orig_zend_open(name, handle TSRMLS_CC)) { - if (!handle->opened_path) { - handle->opened_path = name; - } - return SUCCESS; - } - return FAILURE; - } - } -#endif skip_phar: return phar_orig_zend_open(filename, handle TSRMLS_CC); } @@ -2855,7 +2799,7 @@ php_info_print_table_header(2, "Phar: PHP Archive support", "enabled"); php_info_print_table_row(2, "Phar EXT version", PHP_PHAR_VERSION); php_info_print_table_row(2, "Phar API version", PHP_PHAR_API_VERSION); - php_info_print_table_row(2, "CVS revision", "$Revision: 1.328 $"); + php_info_print_table_row(2, "CVS revision", "$Revision: 1.329 $"); php_info_print_table_row(2, "Phar-based phar archives", "enabled"); php_info_print_table_row(2, "Tar-based phar archives", "enabled"); php_info_print_table_row(2, "ZIP-based phar archives", "enabled"); http://cvs.php.net/viewvc.cgi/pecl/phar/phar_internal.h?r1=1.99&r2=1.100&diff_format=u Index: pecl/phar/phar_internal.h diff -u pecl/phar/phar_internal.h:1.99 pecl/phar/phar_internal.h:1.100 --- pecl/phar/phar_internal.h:1.99 Fri Apr 11 04:20:14 2008 +++ pecl/phar/phar_internal.h Mon Apr 14 04:47:33 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: phar_internal.h,v 1.99 2008/04/11 04:20:14 cellog Exp $ */ +/* $Id: phar_internal.h,v 1.100 2008/04/14 04:47:33 cellog Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -342,13 +342,16 @@ }; #endif +#ifndef PHAR_MAIN +extern int phar_has_bz2; +extern int phar_has_zlib; +# if PHP_VERSION_ID >= 50300 +extern char *(*phar_save_resolve_path)(const char *filename, int filename_len TSRMLS_DC); +# endif +#endif + BEGIN_EXTERN_C() -int phar_has_bz2; -int phar_has_zlib; -#if PHP_VERSION_ID >= 50300 -char *(*phar_save_resolve_path)(const char *filename, int filename_len TSRMLS_DC); -#endif #ifdef PHP_WIN32 char *tsrm_strtok_r(char *s, const char *delim, char **last);

« previous php.pecl.cvs (#10369) next »