1 | <?php |
||
9 | class AddonStatusCommand extends Command |
||
10 | { |
||
11 | /** |
||
12 | * The console command signature. |
||
13 | * |
||
14 | * @var string |
||
15 | */ |
||
16 | protected $signature = 'addon:status'; |
||
17 | |||
18 | /** |
||
19 | * The console command description. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | protected $description = 'List up addon information'; |
||
24 | |||
25 | /** |
||
26 | * Execute the console command. |
||
27 | * |
||
28 | * @return mixed |
||
29 | */ |
||
30 | 1 | public function handle(Filesystem $filesystem, AddonEnvironment $env) |
|
31 | { |
||
32 | // make addons/ |
||
33 | 1 | $addonsDirectory = $env->path(); |
|
34 | 1 | if (!$filesystem->exists($addonsDirectory)) { |
|
35 | $filesystem->makeDirectory($addonsDirectory); |
||
36 | } |
||
37 | |||
38 | // copy app/config/addon.php |
||
39 | 1 | $addonConfigSourceFile = __DIR__.'/../../config/addon.php'; |
|
40 | 1 | $addonConfigFile = $this->laravel['path.config'].'/addon.php'; |
|
41 | 1 | if (!$filesystem->exists($addonConfigFile)) { |
|
42 | 1 | $filesystem->copy($addonConfigSourceFile, $addonConfigFile); |
|
43 | |||
44 | 1 | $this->info('make config: '.$addonConfigFile); |
|
45 | } |
||
46 | |||
47 | // show lists |
||
48 | 1 | $addons = $env->addons(); |
|
49 | 1 | foreach ($addons as $addon) { |
|
50 | 1 | $this->dump($addon); |
|
51 | } |
||
52 | 1 | } |
|
53 | |||
54 | 1 | protected function dump($addon) |
|
58 | } |
||
59 |