Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 01e16ccdc0
Fetching contributors…

Cannot retrieve contributors at this time

executable file 50 lines (41 sloc) 1.319 kb
#!/usr/bin/env php
<?php
// show all errors
error_reporting(E_ALL);
require_once __DIR__.'/../lib/Phark/ClassLoader.php';
$classloader = new \Phark\ClassLoader(array(__DIR__.'/../lib'));
$classloader->register();
$commandline = new \Phark\Commandline();
$commandline
->register("install", new \Phark\Command\InstallCommand())
->register("help", new \Phark\Command\HelpCommand())
->register("environment", new \Phark\Command\EnvironmentCommand())
->register("list", new \Phark\Command\ListCommand())
->register("deps", new \Phark\Command\DependenciesCommand())
->register("bundle", new \Phark\Command\BundleCommand())
->register("remove", new \Phark\Command\RemoveCommand())
;
// show help
if(count($argv) == 1 || in_array('--help', $argv) || ($argc == 2 && $argv[1] == 'help'))
{
echo "usage: phark [--version] [--help] <command> [<args>]\n\n";
echo "The commands that are available are:\n";
foreach($commandline->commands() as $k=>$c)
printf(" %-12s %s\n", $k, $c->summary());
echo "\nSee 'phark help <command>' for more information on specific commands.\n";
exit(1);
}
else if(in_array('--version', $argv))
{
echo Phark::VERSION."\n";
exit(1);
}
try
{
$commandline->execute(array_slice($argv,1));
}
catch(\Phark\Exception $e)
{
printf("phark error: %s\n", $e->getMessage());
exit(1);
}
Jump to Line
Something went wrong with that request. Please try again.