-
Notifications
You must be signed in to change notification settings - Fork 0
/
machine
executable file
·45 lines (37 loc) · 1.02 KB
/
machine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/env php
<?php
require_once __DIR__ . '/vendor/autoload.php';
use League\Flysystem\Adapter\Local;
use League\Flysystem\Filesystem;
use Machine\Application;
use Machine\Console\Make\ClassCommand;
use Machine\Console\Make\InterfaceCommand;
use Machine\Console\Make\TraitCommand;
use Machine\Console\Make\TestCommand;
use Symfony\Component\Console\Output\ConsoleOutput;
try
{
/*
* Setup the application
*/
$app = new Application('1.0.0');
$app->container->bind(Filesystem::class, function() {
return new Filesystem(new Local(getcwd()));
});
/*
* Register Commands
*/
$app->add($app->container->make(ClassCommand::class));
$app->add($app->container->make(InterfaceCommand::class));
$app->add($app->container->make(TraitCommand::class));
$app->add($app->container->make(TestCommand::class));
/*
* Run the application
*/
$app->run();
}
catch(Exception $e)
{
$output = new ConsoleOutput;
$output->writeln("<error>{$e->getMessage()}</error>");
}