Added a a helper method to the runtime that merges env specific options with global ones

This commit is contained in:
Yanick Witschi
2017-02-01 15:23:31 +01:00
parent b7ecc97523
commit dc48f19b26
5 changed files with 25 additions and 16 deletions
+1 -4
View File
@@ -43,12 +43,9 @@ class AsseticDumpTask extends AbstractTask
protected function getOptions()
{
$userGlobalOptions = $this->runtime->getConfigOption('symfony', []);
$userEnvOptions = $this->runtime->getEnvOption('symfony', []);
$options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
(is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvOptions) ? $userEnvOptions : []),
$this->runtime->getMergedEnvAndConfigOption('symfony', [], []),
$this->options
);
@@ -43,12 +43,9 @@ class AssetsInstallTask extends AbstractTask
protected function getOptions()
{
$userGlobalOptions = $this->runtime->getConfigOption('symfony', []);
$userEnvOptions = $this->runtime->getEnvOption('symfony', []);
$options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'target' => 'web', 'flags' => '--symlink --relative'],
(is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvOptions) ? $userEnvOptions : []),
$this->runtime->getMergedEnvAndConfigOption('symfony', [], []),
$this->options
);
+1 -4
View File
@@ -43,12 +43,9 @@ class CacheClearTask extends AbstractTask
protected function getOptions()
{
$userGlobalOptions = $this->runtime->getConfigOption('symfony', []);
$userEnvOptions = $this->runtime->getEnvOption('symfony', []);
$options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
(is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvOptions) ? $userEnvOptions : []),
$this->runtime->getMergedEnvAndConfigOption('symfony', [], []),
$this->options
);
+1 -4
View File
@@ -43,12 +43,9 @@ class CacheWarmupTask extends AbstractTask
protected function getOptions()
{
$userGlobalOptions = $this->runtime->getConfigOption('symfony', []);
$userEnvOptions = $this->runtime->getEnvOption('symfony', []);
$options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
(is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvOptions) ? $userEnvOptions : []),
$this->runtime->getMergedEnvAndConfigOption('symfony', [], []),
$this->options
);