summaryrefslogtreecommitdiff
path: root/ext/phar/tests/zf_test.phpt
diff options
context:
space:
mode:
authorSteph Fox <sfox@php.net>2008-03-03 08:41:15 +0000
committerSteph Fox <sfox@php.net>2008-03-03 08:41:15 +0000
commit8343d7c1395608c6e4941e10e9aa27e8fe9a7854 (patch)
tree554ba1f6fe0e877c7bb4973386dff7dbf711a60b /ext/phar/tests/zf_test.phpt
parent555d853295a97d68db37a5479e8ee110078b45fb (diff)
downloadphp-git-8343d7c1395608c6e4941e10e9aa27e8fe9a7854.tar.gz
- A bit more work on PharData creation/conversion.
- If readonly=0, why not $phardata->convertToPhar()? - Known issue with directories creating 'as-file' copies within the archive (all formats) @Greg/Marcus/Tony: This passes all tests on my box, 5.2/5.3/release_ts/debug_ts, and I can't find any more memleaks. Obviously this is too good to be true, so if conversion is still messy elsewhere please feel free to fix, or bug and assign to me.
Diffstat (limited to 'ext/phar/tests/zf_test.phpt')
-rw-r--r--ext/phar/tests/zf_test.phpt27
1 files changed, 14 insertions, 13 deletions
diff --git a/ext/phar/tests/zf_test.phpt b/ext/phar/tests/zf_test.phpt
index fa898c9a57..bc3580fb06 100644
--- a/ext/phar/tests/zf_test.phpt
+++ b/ext/phar/tests/zf_test.phpt
@@ -8,12 +8,14 @@ phar.readonly=0
<?php
$file = "zfapp";
-$tgz_file = dirname(__FILE__) . "/files/$file.tgz";
-chdir(dirname(__FILE__));
+$orig_file = dirname(__FILE__) . "/files/$file.tgz";
+$tgz_file = dirname(__FILE__) . "/$file.tgz";
+$phar_file = dirname(__FILE__) . "/$file.phar";
+copy($orig_file, $tgz_file);
-$phar_file = basename(__FILE__, '.php') . '.phar';
-@unlink($phar_file);
-copy($tgz_file, $phar_file);
+$phar = new PharData($tgz_file);
+$phar->convertToPhar();
+$phar->stopBuffering();
$phar = new Phar($phar_file);
$phar->startBuffering();
@@ -34,14 +36,13 @@ foreach(new RecursiveIteratorIterator($phar) as $path) {
===DONE===
--CLEAN--
<?php
-unlink(dirname(__FILE__) . '/' . basename(__FILE__, '.clean.php') . '.phar');
-__HALT_COMPILER();
+unlink(dirname(__FILE__) . '/zfapp.phar');
?>
--EXPECTF--
-phar://%szf_test.phar/application/default/controllers/ErrorController.php
-phar://%szf_test.phar/application/default/controllers/IndexController.php
-phar://%szf_test.phar/application/default/views/scripts/error/error.phtml
-phar://%szf_test.phar/application/default/views/scripts/index/index.phtml
-phar://%szf_test.phar/html/.htaccess
-phar://%szf_test.phar/html/index.php
+phar://%szfapp.phar/application/default/controllers/ErrorController.php
+phar://%szfapp.phar/application/default/controllers/IndexController.php
+phar://%szfapp.phar/application/default/views/scripts/error/error.phtml
+phar://%szfapp.phar/application/default/views/scripts/index/index.phtml
+phar://%szfapp.phar/html/.htaccess
+phar://%szfapp.phar/html/index.php
===DONE===