public function execute($args) { if ($args) { $file = $args[0]; if (file_exists($file) && \Clips\is_phar($file)) { switch (count($args)) { case 1: $p = new \Phar($file); foreach ($p as $k => $v) { echo $k . PHP_EOL; } break; default: echo \Clips\phar_contents($file, $args[1]); } } else { $this->error("The file {$file} is not exists or is not a phar file!"); } } else { $this->error('No phar file input!'); } }
public function testPharContents() { $this->assertNull(Clips\phar_contents(__DIR__ . '/../../data/test', 'tree1.json')); $this->assertNotNull(Clips\phar_contents(__DIR__ . '/../../data/test', 'tree.json')); }