1 | <?php |
||
12 | class InstallCommand extends BaseCommand |
||
13 | { |
||
14 | /** |
||
15 | * Avoids using llum to install package. |
||
16 | * |
||
17 | * @var bool |
||
18 | */ |
||
19 | protected $noLlum = false; |
||
20 | |||
21 | /** |
||
22 | * Install using php artisan vendor:publish. |
||
23 | * |
||
24 | * @var bool |
||
25 | */ |
||
26 | protected $useVendorPublish = false; |
||
27 | |||
28 | /** |
||
29 | * Install asking before overwrite files. |
||
30 | * |
||
31 | * @var bool |
||
32 | */ |
||
33 | protected $askBeforeOverwrite = false; |
||
34 | |||
35 | /** |
||
36 | * Initialize command. |
||
37 | * |
||
38 | * @param InputInterface $input |
||
39 | * @param OutputInterface $output |
||
40 | */ |
||
41 | protected function initialize(InputInterface $input, OutputInterface $output) |
||
42 | { |
||
43 | parent::initialize($input, $output); |
||
44 | if ($input->hasOption('no-llum')) { |
||
45 | $this->noLlum = $input->getOption('no-llum'); |
||
46 | } |
||
47 | if ($input->hasOption('dev')) { |
||
48 | $this->installDev = $input->getOption('dev'); |
||
49 | } |
||
50 | if ($input->hasOption('use-vendor-publish')) { |
||
51 | $this->useVendorPublish = $input->getOption('use-vendor-publish'); |
||
52 | } |
||
53 | if ($input->hasOption('dontforce')) { |
||
54 | $this->askBeforeOverwrite = $input->getOption('dontforce'); |
||
55 | } |
||
56 | } |
||
57 | |||
58 | /** |
||
59 | * Check is --no-llum option is active. |
||
60 | * |
||
61 | * @return bool |
||
62 | */ |
||
63 | private function isNoLlumActive() |
||
64 | { |
||
65 | return $this->noLlum; |
||
66 | } |
||
67 | |||
68 | /** |
||
69 | * Configure the command options. |
||
70 | */ |
||
71 | protected function configure() |
||
72 | { |
||
73 | $this->ignoreValidationErrors(); |
||
74 | |||
75 | $this->setName('install') |
||
76 | ->setDescription('Install Acacha AdminLTE package into the current project.'); |
||
77 | } |
||
78 | |||
79 | /** |
||
80 | * Execute the command. |
||
81 | * |
||
82 | * @param InputInterface $input |
||
83 | * @param OutputInterface $output |
||
84 | * |
||
85 | * @return void |
||
86 | */ |
||
87 | protected function execute(InputInterface $input, OutputInterface $output) |
||
98 | |||
99 | /** |
||
100 | * Get llum package name. |
||
101 | */ |
||
102 | private function getPackageName() |
||
110 | |||
111 | /** |
||
112 | * Execute command with option --no-llum. |
||
113 | * |
||
114 | * @param OutputInterface $output |
||
115 | */ |
||
116 | protected function executeWithoutLlum(OutputInterface $output) |
||
134 | |||
135 | /** |
||
136 | * Get the composer command for the environment. |
||
137 | * |
||
138 | * @return string |
||
139 | */ |
||
140 | private function findComposer() |
||
148 | |||
149 | /** |
||
150 | * Gets dev suffix. |
||
151 | * |
||
152 | * @return string |
||
153 | */ |
||
154 | private function getDevSuffix() |
||
158 | |||
159 | /** |
||
160 | * Manually publishes files to project. |
||
161 | * |
||
162 | * @param OutputInterface $output |
||
163 | */ |
||
164 | protected function publish(OutputInterface $output) |
||
169 | |||
170 | /** |
||
171 | * Publishes files with artisan publish command. |
||
172 | * |
||
173 | * @param OutputInterface $output |
||
174 | */ |
||
175 | protected function publishWithVendor(OutputInterface $output) |
||
180 | } |
||
181 |