1<?php 2 3$fname = dirname(__FILE__) . '/write2.phar'; 4@unlink($fname); 5 6$phar = new Phar($fname); 7$phar->setStub('<?php 8$phar = new Phar(__FILE__); 9var_dump($phar->getMetadata()); 10mkdir("phar://" . __FILE__ . "/test"); 11var_dump(is_dir("phar://" . __FILE__ . "/test")); 12$phar2 = new Phar(__FILE__); 13var_dump($phar2->getMetadata()); 14var_dump(isset($phar["test"])); 15var_dump(isset($phar2["test"])); 16echo "ok\n"; 17__HALT_COMPILER(); 18?>'); 19$phar->setMetadata('hi'); 20$phar['test.txt'] = "hi 21"; 22$phar['test.txt']->setMetadata('hi'); 23?> 24