php-src/ext/phar/tests/cache_list/files/write3.phar.inc
Greg Beaver e16636f069 add tests for copy-on-write support
- fix metadata handling with cached phars
 - fix virtual_dirs with rmdir
 - ensure that after copy-on-write, all existing Phar objects link to the newly copied phar data
2008-10-12 19:40:11 +00:00

21 lines
543 B
PHP

<?php
$fname = dirname(__FILE__) . '/write3.phar';
@unlink($fname);
$phar = new Phar($fname);
$phar->setStub('<?php
clearstatcache();
var_dump(file_exists("phar://" . __FILE__ . "/test"), is_dir("phar://" . __FILE__ . "/test"));
rmdir("phar://" . __FILE__ . "/test");
clearstatcache();
var_dump(file_exists("phar://" . __FILE__ . "/test"), is_dir("phar://" . __FILE__ . "/test"));
echo "ok\n";
__HALT_COMPILER();
?>');
$phar->setMetadata('hi');
$phar['test.txt'] = "hi
";
$phar['test.txt']->setMetadata('hi');
$phar->addEmptyDir('test');
?>