]> granicus.if.org Git - php/commitdiff
fix some of the failing tests due to non-reopened phar fp
authorGreg Beaver <cellog@php.net>
Tue, 12 Feb 2008 05:16:53 +0000 (05:16 +0000)
committerGreg Beaver <cellog@php.net>
Tue, 12 Feb 2008 05:16:53 +0000 (05:16 +0000)
ext/phar/util.c

index af9abaf14add9140c167c61c0c09cc3275f7926c..4b4bfc27faed2773a9ff8349a37c479c9c290fe8 100644 (file)
 php_stream *phar_get_efp(phar_entry_info *entry)
 {
        if (entry->fp_type == PHAR_FP) {
+               if (!entry->phar->fp) {
+                       /* re-open just in time for cases where our refcount reached 0 on the phar archive */
+                       phar_open_archive_fp(entry->phar TSRMLS_CC);
+               }
                return entry->phar->fp;
        } else if (entry->fp_type == PHAR_UFP) {
                return entry->phar->ufp;