]> granicus.if.org Git - php/commitdiff
fix memleaks and all but 1 test
authorGreg Beaver <cellog@php.net>
Sat, 27 Jan 2007 18:45:48 +0000 (18:45 +0000)
committerGreg Beaver <cellog@php.net>
Sat, 27 Jan 2007 18:45:48 +0000 (18:45 +0000)
ext/phar/phar.c
ext/phar/tests/open_for_write_existing_b.phpt
ext/phar/tests/open_for_write_existing_c.phpt
ext/phar/tests/open_for_write_newfile_b.phpt
ext/phar/tests/open_for_write_newfile_c.phpt
ext/phar/tests/phar_oo_compressed_002.phpt

index bc1f08135a62c705321bd2840979a020cce0c21e..e4361854107b91d0380131f91dd3946974086918 100644 (file)
@@ -849,7 +849,6 @@ int phar_open_file(php_stream *fp, char *fname, int fname_len, char *alias, int
        efree(savebuf);
        
        if (pphar) {
-               mydata->refcount++;
                *pphar = mydata;
        }
 
index e289a245cbfc32b91009dfe3e5be2ff0d4a02fd3..fbfce79c419254ebdd96dbb045afbf3d8138b3e6 100755 (executable)
@@ -32,13 +32,11 @@ include $pname . '/b/c.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
-
-Catchable fatal error: fopen(): phar error: file "%sopen_for_write_existing_b.phar.php" cannot opened for writing, disabled by ini setting in %sopen_for_write_existing_b.php on line %d
-
-Warning: fopen(phar://%sopen_for_write_existing_b.phar.php/b/c.php): failed to open stream: phar error: file "b/c.php" could not be created in phar "%spen_for_write_existing_b.phar.php" in %spen_for_write_existing_b.php on line %d
+Warning: fopen(phar://%sopen_for_write_existing_b.phar.php/b/c.php): failed to open stream: phar error: file "%sopen_for_write_existing_b.phar.php" cannot opened for writing, disabled by ini setting
+phar error: file "b/c.php" could not be created in phar "%sopen_for_write_existing_b.phar.php" in %sopen_for_write_existing_b.php on line %d
 
 Warning: fwrite(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d
 
 Warning: fclose(): supplied argument is not a valid stream resource in %spen_for_write_existing_b.php on line %d
 This is b/c
-===DONE===
+===DONE===
\ No newline at end of file
index e6e63337007d727294048c76cb35b91148f03fb7..1733cea584a460de347551e8e7d00cb9cc8c86ce 100755 (executable)
@@ -26,5 +26,11 @@ include $pname . '/b/c.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
+Warning: fopen(phar://%sopen_for_write_existing_c.phar.php/b/c.php): failed to open stream: phar error: file "%sopen_for_write_existing_c.phar.php" cannot opened for writing, disabled by ini setting
+phar error: file "b/c.php" could not be created in phar "%sopen_for_write_existing_c.phar.php" in %sopen_for_write_existing_c.php on line %d
 
-Catchable fatal error: fopen(): phar error: file "%sopen_for_write_existing_c.phar.php" cannot opened for writing, disabled by ini setting in %sopen_for_write_existing_c.php on line %d
+Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d
+
+Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_existing_c.php on line %d
+This is b/c
+===DONE===
\ No newline at end of file
index 86c562f03d958d747fb3b6fe712635b9de45995b..b62158201aa77f8f0e397de8fd1894cc866189ba 100755 (executable)
@@ -35,16 +35,15 @@ include $pname . '/b/new.php';
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
 
-Catchable fatal error: fopen(): phar error: file "%sopen_for_write_newfile_b.phar.php" cannot opened for writing, disabled by ini setting in %sopen_for_write_newfile_b.php on line %d
+Warning: fopen(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: file "%sopen_for_write_newfile_b.phar.php" cannot opened for writing, disabled by ini setting
+phar error: file "b/new.php" could not be created in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d
 
-Warning: fopen(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: file "b/new.php" could not be created in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d
+Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d
 
-Warning: fwrite()%sresource%sin %sopen_for_write_newfile_b.php on line %d
-
-Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line %d
+Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_b.php on line 20
 This is b/c
 
-Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d
+Warning: include(phar://%sopen_for_write_newfile_b.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line 22
 
 Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d
 
index dedfada7ce58b84a3e32a7f2748f0f27be1f6424..c4242bdb2e7b1168c2e6f34fb7f8bdf5a5eaf8c2 100755 (executable)
@@ -28,5 +28,16 @@ include $pname . '/b/new.php';
 --CLEAN--
 <?php unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); ?>
 --EXPECTF--
+Warning: fopen(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: file "%sopen_for_write_newfile_c.phar.php" cannot opened for writing, disabled by ini setting
+phar error: file "b/new.php" could not be created in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d
 
-Catchable fatal error: fopen(): phar error: file "%sopen_for_write_newfile_c.phar.php" cannot opened for writing, disabled by ini setting in %sopen_for_write_newfile_c.php on line %d
+Warning: fwrite(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d
+
+Warning: fclose(): supplied argument is not a valid stream resource in %sopen_for_write_newfile_c.php on line %d
+This is b/c
+
+Warning: include(phar://%sopen_for_write_newfile_c.phar.php/b/new.php): failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d
+
+Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d
+
+===DONE===
\ No newline at end of file
index c318750a318de806630f368f0c3778f9e14d034d..a22790498263c5055cac603f27c6ef0abeb451c1 100755 (executable)
@@ -4,6 +4,7 @@ Phar: context/compress=GZ
 <?php if (!extension_loaded("phar")) print "skip"; ?>
 <?php if (!extension_loaded("zlib")) print "skip zlib not present"; ?>
 --INI--
+phar.readonly=0
 phar.require_hash=0
 --FILE--
 <?php