@@ 5-46 (lines=42) @@ | ||
2 | ||
3 | namespace SleepingOwl\Admin\Console\Installation; |
|
4 | ||
5 | class CreateBootstrapFile extends Installator |
|
6 | { |
|
7 | public function showInfo() |
|
8 | { |
|
9 | $this->command->line('Creating bootstrap file: <info>✔</info>'); |
|
10 | } |
|
11 | ||
12 | /** |
|
13 | * Install the components. |
|
14 | * |
|
15 | * @return void |
|
16 | */ |
|
17 | public function install() |
|
18 | { |
|
19 | $file = $this->getFilePath(); |
|
20 | ||
21 | $contents = $this->command->files()->get(SLEEPINGOWL_STUB_PATH.'/bootstrap.stub'); |
|
22 | $this->command->files()->put($file, $contents); |
|
23 | $filePath = str_replace(base_path(), '', $file); |
|
24 | $this->command->line("<info>Bootstrap file is [{$filePath}]</info>"); |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * При возврате методом true данный компонент будет пропущен. |
|
29 | * |
|
30 | * @return bool |
|
31 | */ |
|
32 | public function installed() |
|
33 | { |
|
34 | return file_exists($this->getFilePath()); |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * @return string |
|
39 | */ |
|
40 | protected function getFilePath() |
|
41 | { |
|
42 | $bootstrapDirectory = $this->config->get('bootstrapDirectory', app_path('Admin')); |
|
43 | ||
44 | return $bootstrapDirectory.'/bootstrap.php'; |
|
45 | } |
|
46 | } |
|
47 |
@@ 5-46 (lines=42) @@ | ||
2 | ||
3 | namespace SleepingOwl\Admin\Console\Installation; |
|
4 | ||
5 | class CreateNavigationFile extends Installator |
|
6 | { |
|
7 | public function showInfo() |
|
8 | { |
|
9 | $this->command->line('Creating navigation file: <info>✔</info>'); |
|
10 | } |
|
11 | ||
12 | /** |
|
13 | * Install the components. |
|
14 | * |
|
15 | * @return void |
|
16 | */ |
|
17 | public function install() |
|
18 | { |
|
19 | $file = $this->getFilePath(); |
|
20 | ||
21 | $contents = $this->command->files()->get(SLEEPINGOWL_STUB_PATH.'/navigation.stub'); |
|
22 | $this->command->files()->put($file, $contents); |
|
23 | $filePath = str_replace(base_path(), '', $file); |
|
24 | $this->command->line("<info>Navigation file is [{$filePath}]</info>"); |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * При возврате методом true данный компонент будет пропущен. |
|
29 | * |
|
30 | * @return bool |
|
31 | */ |
|
32 | public function installed() |
|
33 | { |
|
34 | return file_exists($this->getFilePath()); |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * @return string |
|
39 | */ |
|
40 | protected function getFilePath() |
|
41 | { |
|
42 | $bootstrapDirectory = $this->config->get('bootstrapDirectory', app_path('Admin')); |
|
43 | ||
44 | return $bootstrapDirectory.'/navigation.php'; |
|
45 | } |
|
46 | } |
|
47 |
@@ 5-46 (lines=42) @@ | ||
2 | ||
3 | namespace SleepingOwl\Admin\Console\Installation; |
|
4 | ||
5 | class CreateRoutesFile extends Installator |
|
6 | { |
|
7 | public function showInfo() |
|
8 | { |
|
9 | $this->command->line('Creating routes file: <info>✔</info>'); |
|
10 | } |
|
11 | ||
12 | /** |
|
13 | * Install the components. |
|
14 | * |
|
15 | * @return void |
|
16 | */ |
|
17 | public function install() |
|
18 | { |
|
19 | $file = $this->getFilePath(); |
|
20 | ||
21 | $contents = $this->command->files()->get(SLEEPINGOWL_STUB_PATH.'/routes.stub'); |
|
22 | $this->command->files()->put($file, $contents); |
|
23 | $filePath = str_replace(base_path(), '', $file); |
|
24 | $this->command->line("<info>Routes file is [{$filePath}]</info>"); |
|
25 | } |
|
26 | ||
27 | /** |
|
28 | * При возврате методом true данный компонент будет пропущен. |
|
29 | * |
|
30 | * @return bool |
|
31 | */ |
|
32 | public function installed() |
|
33 | { |
|
34 | return file_exists($this->getFilePath()); |
|
35 | } |
|
36 | ||
37 | /** |
|
38 | * @return string |
|
39 | */ |
|
40 | protected function getFilePath() |
|
41 | { |
|
42 | $bootstrapDirectory = $this->config->get('bootstrapDirectory', app_path('Admin')); |
|
43 | ||
44 | return $bootstrapDirectory.'/routes.php'; |
|
45 | } |
|
46 | } |
|
47 |