php-src/ext/phar/tests/cache_list/files/write6.phar

23 lines
No EOL
675 B
Text
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
$phar = new Phar(__FILE__);
$d = dirname(__FILE__) . "/copyonwrite6";
mkdir($d);
file_put_contents($d . "/file1", "file1\n");
file_put_contents($d . "/file2", "file2\n");
$arr = $phar->buildFromIterator(new RecursiveDirectoryIterator($d, RecursiveDirectoryIterator::SKIP_DOTS),$d);
$arr = $phar->buildFromDirectory($d);
ksort($arr);
var_dump($arr);
$phar2 = new Phar(__FILE__);
$arr = array();
foreach ($phar2 as $name => $file) {
$arr[$name] = $file->getContent();
}
ksort($arr);
foreach ($arr as $name => $content) {
echo $name, " ", $content;
}
echo "ok\n";
__HALT_COMPILER(); ?>
0hiÈpŸIzzoí¶hi
ϬÌBE¿@Äx% “CÜcrGBMB