Browse Source

[Nostromo] Mess Detector: naming rule

pull/1/head
Andrés Montañez 8 years ago
parent
commit
193265e424
  1. 6
      src/Mage/Command/BuiltIn/Releases/RollbackCommand.php
  2. 6
      src/Mage/Task/BuiltIn/FS/CopyTask.php
  3. 6
      src/Mage/Task/BuiltIn/FS/LinkTask.php
  4. 6
      src/Mage/Task/BuiltIn/FS/MoveTask.php
  5. 4
      src/Mage/Task/BuiltIn/Symfony/AsseticDumpTask.php
  6. 4
      src/Mage/Task/BuiltIn/Symfony/AssetsInstallTask.php
  7. 4
      src/Mage/Task/BuiltIn/Symfony/CacheClearTask.php
  8. 4
      src/Mage/Task/BuiltIn/Symfony/CacheWarmupTask.php

6
src/Mage/Command/BuiltIn/Releases/RollbackCommand.php

@ -104,7 +104,7 @@ class RollbackCommand extends DeployCommand
$hosts = $this->runtime->getEnvironmentConfig('hosts'); $hosts = $this->runtime->getEnvironmentConfig('hosts');
$hostPath = rtrim($this->runtime->getEnvironmentConfig('host_path'), '/'); $hostPath = rtrim($this->runtime->getEnvironmentConfig('host_path'), '/');
$releaseAvailableInHosts = 0; $availableInHosts = 0;
foreach ($hosts as $host) { foreach ($hosts as $host) {
$this->runtime->setWorkingHost($host); $this->runtime->setWorkingHost($host);
@ -121,13 +121,13 @@ class RollbackCommand extends DeployCommand
} }
if (in_array($releaseToRollback, $releases)) { if (in_array($releaseToRollback, $releases)) {
$releaseAvailableInHosts++; $availableInHosts++;
} }
$this->runtime->setWorkingHost(null); $this->runtime->setWorkingHost(null);
} }
if ($releaseAvailableInHosts === count($hosts)) { if ($availableInHosts === count($hosts)) {
return $releaseToRollback; return $releaseToRollback;
} }

6
src/Mage/Task/BuiltIn/FS/CopyTask.php

@ -36,10 +36,10 @@ class CopyTask extends AbstractFileTask
public function execute() public function execute()
{ {
$from = $this->getFile('from'); $copyFrom = $this->getFile('from');
$to = $this->getFile('to'); $copyTo = $this->getFile('to');
$cmd = sprintf('cp -p %s %s', $from, $to); $cmd = sprintf('cp -p %s %s', $copyFrom, $copyTo);
/** @var Process $process */ /** @var Process $process */
$process = $this->runtime->runCommand($cmd); $process = $this->runtime->runCommand($cmd);

6
src/Mage/Task/BuiltIn/FS/LinkTask.php

@ -36,10 +36,10 @@ class LinkTask extends AbstractFileTask
public function execute() public function execute()
{ {
$from = $this->getFile('from'); $linkFrom = $this->getFile('from');
$to = $this->getFile('to'); $linkTo = $this->getFile('to');
$cmd = sprintf('ln -snf %s %s', $from, $to); $cmd = sprintf('ln -snf %s %s', $linkFrom, $linkTo);
/** @var Process $process */ /** @var Process $process */
$process = $this->runtime->runCommand($cmd); $process = $this->runtime->runCommand($cmd);

6
src/Mage/Task/BuiltIn/FS/MoveTask.php

@ -36,10 +36,10 @@ class MoveTask extends AbstractFileTask
public function execute() public function execute()
{ {
$from = $this->getFile('from'); $moveFrom = $this->getFile('from');
$to = $this->getFile('to'); $moveTo = $this->getFile('to');
$cmd = sprintf('mv %s %s', $from, $to); $cmd = sprintf('mv %s %s', $moveFrom, $moveTo);
/** @var Process $process */ /** @var Process $process */
$process = $this->runtime->runCommand($cmd); $process = $this->runtime->runCommand($cmd);

4
src/Mage/Task/BuiltIn/Symfony/AsseticDumpTask.php

@ -44,11 +44,11 @@ class AsseticDumpTask extends AbstractTask
protected function getOptions() protected function getOptions()
{ {
$userGlobalOptions = $this->runtime->getConfigOptions('symfony', []); $userGlobalOptions = $this->runtime->getConfigOptions('symfony', []);
$userEnvironmentOptions = $this->runtime->getEnvironmentConfig('symfony', []); $userEnvOptions = $this->runtime->getEnvironmentConfig('symfony', []);
$options = array_merge( $options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'flags' => ''], ['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
(is_array($userGlobalOptions) ? $userGlobalOptions : []), (is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvironmentOptions) ? $userEnvironmentOptions : []), (is_array($userEnvOptions) ? $userEnvOptions : []),
$this->options $this->options
); );

4
src/Mage/Task/BuiltIn/Symfony/AssetsInstallTask.php

@ -44,11 +44,11 @@ class AssetsInstallTask extends AbstractTask
protected function getOptions() protected function getOptions()
{ {
$userGlobalOptions = $this->runtime->getConfigOptions('symfony', []); $userGlobalOptions = $this->runtime->getConfigOptions('symfony', []);
$userEnvironmentOptions = $this->runtime->getEnvironmentConfig('symfony', []); $userEnvOptions = $this->runtime->getEnvironmentConfig('symfony', []);
$options = array_merge( $options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'target' => 'web', 'flags' => '--symlink --relative'], ['console' => 'bin/console', 'env' => 'dev', 'target' => 'web', 'flags' => '--symlink --relative'],
(is_array($userGlobalOptions) ? $userGlobalOptions : []), (is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvironmentOptions) ? $userEnvironmentOptions : []), (is_array($userEnvOptions) ? $userEnvOptions : []),
$this->options $this->options
); );

4
src/Mage/Task/BuiltIn/Symfony/CacheClearTask.php

@ -44,11 +44,11 @@ class CacheClearTask extends AbstractTask
protected function getOptions() protected function getOptions()
{ {
$userGlobalOptions = $this->runtime->getConfigOptions('symfony', []); $userGlobalOptions = $this->runtime->getConfigOptions('symfony', []);
$userEnvironmentOptions = $this->runtime->getEnvironmentConfig('symfony', []); $userEnvOptions = $this->runtime->getEnvironmentConfig('symfony', []);
$options = array_merge( $options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'flags' => ''], ['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
(is_array($userGlobalOptions) ? $userGlobalOptions : []), (is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvironmentOptions) ? $userEnvironmentOptions : []), (is_array($userEnvOptions) ? $userEnvOptions : []),
$this->options $this->options
); );

4
src/Mage/Task/BuiltIn/Symfony/CacheWarmupTask.php

@ -44,11 +44,11 @@ class CacheWarmupTask extends AbstractTask
protected function getOptions() protected function getOptions()
{ {
$userGlobalOptions = $this->runtime->getConfigOptions('symfony', []); $userGlobalOptions = $this->runtime->getConfigOptions('symfony', []);
$userEnvironmentOptions = $this->runtime->getEnvironmentConfig('symfony', []); $userEnvOptions = $this->runtime->getEnvironmentConfig('symfony', []);
$options = array_merge( $options = array_merge(
['console' => 'bin/console', 'env' => 'dev', 'flags' => ''], ['console' => 'bin/console', 'env' => 'dev', 'flags' => ''],
(is_array($userGlobalOptions) ? $userGlobalOptions : []), (is_array($userGlobalOptions) ? $userGlobalOptions : []),
(is_array($userEnvironmentOptions) ? $userEnvironmentOptions : []), (is_array($userEnvOptions) ? $userEnvOptions : []),
$this->options $this->options
); );

Loading…
Cancel
Save