mirror of
https://github.com/php/php-src.git
synced 2025-08-18 15:08:55 +02:00
23 lines
No EOL
675 B
Text
23 lines
No EOL
675 B
Text
<?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(); ?>
|
||
0 |