@@ 20-47 (lines=28) @@ | ||
17 | * |
|
18 | * @author Andrés Montañez <[email protected]> |
|
19 | */ |
|
20 | class InstallTask extends AbstractComposerTask |
|
21 | { |
|
22 | public function getName() |
|
23 | { |
|
24 | return 'composer/install'; |
|
25 | } |
|
26 | ||
27 | public function getDescription() |
|
28 | { |
|
29 | return '[Composer] Install'; |
|
30 | } |
|
31 | ||
32 | public function execute() |
|
33 | { |
|
34 | $options = $this->getOptions(); |
|
35 | $cmd = sprintf('%s install %s', $options['path'], $options['flags']); |
|
36 | ||
37 | /** @var Process $process */ |
|
38 | $process = $this->runtime->runCommand(trim($cmd), $options['timeout']); |
|
39 | ||
40 | return $process->isSuccessful(); |
|
41 | } |
|
42 | ||
43 | protected function getComposerOptions() |
|
44 | { |
|
45 | return ['flags' => '--optimize-autoloader', 'timeout' => 120]; |
|
46 | } |
|
47 | } |
|
48 |
@@ 20-47 (lines=28) @@ | ||
17 | * |
|
18 | * @author Andrés Montañez <[email protected]> |
|
19 | */ |
|
20 | class AssetsInstallTask extends AbstractSymfonyTask |
|
21 | { |
|
22 | public function getName() |
|
23 | { |
|
24 | return 'symfony/assets-install'; |
|
25 | } |
|
26 | ||
27 | public function getDescription() |
|
28 | { |
|
29 | return '[Symfony] Assets Install'; |
|
30 | } |
|
31 | ||
32 | public function execute() |
|
33 | { |
|
34 | $options = $this->getOptions(); |
|
35 | $command = sprintf('%s assets:install %s --env=%s %s', $options['console'], $options['target'], $options['env'], $options['flags']); |
|
36 | ||
37 | /** @var Process $process */ |
|
38 | $process = $this->runtime->runCommand(trim($command)); |
|
39 | ||
40 | return $process->isSuccessful(); |
|
41 | } |
|
42 | ||
43 | protected function getSymfonyOptions() |
|
44 | { |
|
45 | return ['target' => 'web', 'flags' => '--symlink --relative']; |
|
46 | } |
|
47 | } |
|
48 |