forked from orchestral/canvas
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcanvas
executable file
·57 lines (45 loc) · 2.23 KB
/
canvas
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
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/env php
<?php
$workingPath = getcwd();
$config = ['preset' => 'laravel'];
require $_composer_autoload_path ?? __DIR__.'/vendor/autoload.php';
if (file_exists("{$workingPath}/canvas.yaml")) {
$config = Symfony\Component\Yaml\Yaml::parseFile("{$workingPath}/canvas.yaml");
}
$files = new Illuminate\Filesystem\Filesystem();
$preset = Orchestra\Canvas\Canvas::preset(
$config, $workingPath, $files
);
$app = new Symfony\Component\Console\Application('Canvas for Laravel');
$app->setVersion(Composer\InstalledVersions::getPrettyVersion('orchestra/canvas'));
if (! file_exists("{$workingPath}/canvas.yaml")) {
$app->add(new Orchestra\Canvas\Commands\Preset($preset));
}
$app->add(new Orchestra\Canvas\Commands\Channel($preset));
$app->add(new Orchestra\Canvas\Commands\Component($preset));
$app->add(new Orchestra\Canvas\Commands\Console($preset));
$app->add(new Orchestra\Canvas\Commands\Event($preset));
$app->add(new Orchestra\Canvas\Commands\Exception($preset));
$app->add(new Orchestra\Canvas\Commands\Database\Cast($preset));
$app->add(new Orchestra\Canvas\Commands\Database\Eloquent($preset));
$app->add(new Orchestra\Canvas\Commands\Database\Factory($preset));
$app->add(new Orchestra\Canvas\Commands\Database\Migration($preset));
$app->add(new Orchestra\Canvas\Commands\Database\Observer($preset));
$app->add(new Orchestra\Canvas\Commands\Job($preset));
$app->add(new Orchestra\Canvas\Commands\Listener($preset));
$app->add(new Orchestra\Canvas\Commands\Mail($preset));
$app->add(new Orchestra\Canvas\Commands\Notification($preset));
$app->add(new Orchestra\Canvas\Commands\Policy($preset));
$app->add(new Orchestra\Canvas\Commands\Provider($preset));
$app->add(new Orchestra\Canvas\Commands\Request($preset));
$app->add(new Orchestra\Canvas\Commands\Resource($preset));
$app->add(new Orchestra\Canvas\Commands\Routing\Controller($preset));
$app->add(new Orchestra\Canvas\Commands\Routing\Middleware($preset));
$app->add(new Orchestra\Canvas\Commands\Rule($preset));
$app->add(new Orchestra\Canvas\Commands\Testing($preset));
$app->add(new Orchestra\Canvas\Commands\StubPublish($preset));
if ($preset->is('laravel')) {
$app->add(new Orchestra\Canvas\Commands\Database\Seeder($preset));
}
$preset->addAdditionalCommands($app);
$app->run();