if ($f === false) {
self::error("Path for file '$arg' does not exist.\n");
}
- return $f . substr($arg, strlen($d));;
+ return $f . '/' . basename($arg);
}
static function cli_arg_typ_filecont($arg, $cfg, $key)
$dir = new InvertedRegexIterator($dir, $invregex);
}
+ $any = false;
foreach($dir as $pn => $f) {
+ $any = true;
call_user_func($func, $pn, $f, $args);
}
+ return $any;
}
// {{{ static function cli_cmd_inf_list
/**
*/
public function cli_cmd_run_tree()
{
- $this->phar_dir_operation(
+ $a = $this->phar_dir_operation(
new DirectoryGraphIterator(
$this->args['f']['val']),
array($this, 'phar_dir_echo')
);
+ if (!$a) {
+ echo "|-<root directory>\n";
+ }
}
// }}}
// {{{ cli_cmd_inf_extract
}
}
- $phar = $args['f']['val'];
+ $phar = $this->args['f']['val'];
$base = $phar->getPathname();
$bend = strpos($base, '.phar');
$bend = strpos($base, '/', $bend);
if (isset($entry)) {
if (!$phar[$entry]->hasMetadata()) {
+ echo "No Metadata\n";
exit(1);
}
echo serialize($phar[$entry]->getMetadata());
} else {
if (!$phar->hasMetadata()) {
+ echo "No Metadata\n";
exit(1);
}
$meta = $phar->getMetadata();
echo $meta[$index];
exit(0);
} else {
+ echo "No Metadata\n";
exit(1);
}
} else {