]> granicus.if.org Git - php/commitdiff
use zip_free() instead of zip_close(), and don't add a stub if it already exists...
authorGreg Beaver <cellog@php.net>
Fri, 4 Jan 2008 17:04:41 +0000 (17:04 +0000)
committerGreg Beaver <cellog@php.net>
Fri, 4 Jan 2008 17:04:41 +0000 (17:04 +0000)
ext/phar/TODO
ext/phar/phar.c
ext/phar/tests/frontcontroller1.phpt

index e7669b614bddd3d72ba0dd0afa60f3ef00bb3195..b0f3f57919feb5a10dcfaa51d70dcfcfecae0651 100644 (file)
@@ -60,16 +60,14 @@ Version 1.2.1
 
 Version 1.3.0
 
- * Provide an additional header that allows better compatibility with PHP 4
-   __HALT_COMPILER();function __HALT_COMPILER(){}$a=<<<PHARDATABEGIN\n
  * ability to have Phar object return file class as offsetGet() result
  * ability to store empty directories
  * implement PPG signing
- * ability to match files containing a metadata key opendir('phar://a.phar/?mime-type=image/jpeg')
-   or foreach ($p->match('mime-type', 'image/jpeg') as $file)
+ X tar support [Greg]
+ X zip support [Greg]
  X Phar::copy($from, $to); [Greg]
  X Phar::delete($what) [Greg]
  X Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
  * Layout: Option to compress all content rather than single files.
-   That excludes stub and manifest haeder.
+   That excludes stub and manifest haeder. (tar only)
  X clean crap paths like phar://blah.phar/file//../to\\here.php [Greg]
index c68edf4165ccbdfede3626dd939407ed8d84eee4..f3f7396e287c6b7813618849653694e52293f57b 100644 (file)
@@ -208,7 +208,7 @@ static void phar_destroy_phar_data(phar_archive_data *data TSRMLS_DC) /* {{{ */
 {
 #if HAVE_PHAR_ZIP
        if (data->zip) {
-               zip_close(data->zip);
+               _zip_free(data->zip);
                data->zip = 0;
        }
 #endif
@@ -3256,7 +3256,7 @@ int phar_zip_flush(phar_archive_data *archive, char *user_stub, long len, char *
                        efree(user_stub);
                }
        } else {
-               if (archive->is_brandnew) {
+               if (-1 != phar_stub_index) {
                        struct zip_source *source;
                        /* this is a brand new phar, add the stub */
                        if (NULL == (source = zip_source_buffer(archive->zip, newstub, sizeof(newstub) - 1, 0)) || -1 == zip_add(archive->zip, ".phar/stub.php", source)) {
index 2c5e35c141f527dd410d60d67195c62bd1244e7d..0cff6e6f3d179497bbdee1a454c77835b50e1b2e 100644 (file)
@@ -5,6 +5,8 @@ Phar front controller
 --INI--
 phar.require_hash=0
 phar.readonly=0
+--ENV--
+REQUEST_URI=/frontcontroller1.phar.php/a.jpg
 --FILE--
 <?php
 $fname = dirname(__FILE__) . '/' . basename(__FILE__, '.php') . '.phar.php';
@@ -30,4 +32,4 @@ __HALT_COMPILER();
 Content-type: image/jpeg
 Content-length: 3
 --EXPECT--
-hio===DONE===
+hio