mirror of
https://github.com/php/php-src.git
synced 2026-04-22 07:28:09 +02:00
23 lines
675 B
Plaintext
23 lines
675 B
Plaintext
<?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 |