Browse Source

Code refactoring.

1.0
Andrés Montañez 11 years ago
parent
commit
d17dd0eb27
  1. 4
      Mage/Command/AbstractCommand.php
  2. 1
      Mage/Command/BuiltIn/DeployCommand.php
  3. 2
      Mage/Compiler.php
  4. 3
      Mage/Config.php
  5. 4
      Mage/Console.php
  6. 2
      Mage/Task/BuiltIn/Filesystem/LinkSharedFilesTask.php
  7. 2
      Mage/Task/BuiltIn/Ioncube/EncryptTask.php
  8. 2
      Mage/Task/BuiltIn/Releases/ListTask.php
  9. 2
      Mage/Task/BuiltIn/Scm/ChangeBranchTask.php

4
Mage/Command/AbstractCommand.php

@ -22,13 +22,13 @@ abstract class AbstractCommand
/** /**
* Instance of the loaded Configuration. * Instance of the loaded Configuration.
* *
* @var Mage\Config * @var \Mage\Config
*/ */
protected $config = null; protected $config = null;
/** /**
* Runs the Command * Runs the Command
* @throws Exception * @throws \Exception
*/ */
public abstract function run(); public abstract function run();

1
Mage/Command/BuiltIn/DeployCommand.php

@ -456,7 +456,6 @@ class DeployCommand extends AbstractCommand implements RequiresEnvironment
$runTask = false; $runTask = false;
} }
$result = false;
if ($runTask == true) { if ($runTask == true) {
try { try {
$result = $task->run(); $result = $task->run();

2
Mage/Compiler.php

@ -39,7 +39,7 @@ class Compiler
$phar->startBuffering(); $phar->startBuffering();
$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__), RecursiveIteratorIterator::CHILD_FIRST); $iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__), RecursiveIteratorIterator::CHILD_FIRST);
/** @var $path SplFileInfo */ /** @var $path \SplFileInfo */
foreach ($iterator as $path) { foreach ($iterator as $path) {
if ($path->isFile()) { if ($path->isFile()) {
$phar->addFromString(str_replace(dirname(__DIR__).'/', '', $path->getPathname()), file_get_contents($path)); $phar->addFromString(str_replace(dirname(__DIR__).'/', '', $path->getPathname()), file_get_contents($path));

3
Mage/Config.php

@ -255,9 +255,8 @@ class Config
if (isset($config[$configStage])) { if (isset($config[$configStage])) {
$tasksData = ($config[$configStage] ? (array) $config[$configStage] : array()); $tasksData = ($config[$configStage] ? (array) $config[$configStage] : array());
foreach ($tasksData as $taskName => $taskData) { foreach ($tasksData as $taskData) {
if (is_array($taskData)) { if (is_array($taskData)) {
;
$tasks[] = array( $tasks[] = array(
'name' => key($taskData), 'name' => key($taskData),
'parameters' => current($taskData), 'parameters' => current($taskData),

4
Mage/Console.php

@ -26,7 +26,7 @@ class Console
{ {
/** /**
* Handler to the current Log File. * Handler to the current Log File.
* @var handler * @var mixed
*/ */
private static $log = null; private static $log = null;
@ -56,7 +56,7 @@ class Console
/** /**
* Configuration * Configuration
* @var Mage/Config * @var \Mage\Config
*/ */
private static $config; private static $config;

2
Mage/Task/BuiltIn/Filesystem/LinkSharedFilesTask.php

@ -21,7 +21,7 @@ class LinkSharedFilesTask extends AbstractTask implements IsReleaseAware
* Runs the task * Runs the task
* *
* @return boolean * @return boolean
* @throws Exception * @throws \Exception
* @throws \Mage\Task\ErrorWithMessageException * @throws \Mage\Task\ErrorWithMessageException
* @throws SkipException * @throws SkipException
*/ */

2
Mage/Task/BuiltIn/Ioncube/EncryptTask.php

@ -321,7 +321,7 @@ class EncryptTask extends AbstractTask
* *
* @see \Mage\Task\AbstractTask::run() * @see \Mage\Task\AbstractTask::run()
* *
* @return boolan * @return bool
* @throws \Mage\Task\ErrorWithMessageException * @throws \Mage\Task\ErrorWithMessageException
*/ */
public function run() { public function run() {

2
Mage/Task/BuiltIn/Releases/ListTask.php

@ -46,7 +46,7 @@ class ListTask extends AbstractTask implements IsReleaseAware
$releases = ($output == '') ? array() : explode(PHP_EOL, $output); $releases = ($output == '') ? array() : explode(PHP_EOL, $output);
// Get Current // Get Current
$result = $this->runCommandRemote('ls -l ' . $symlink, $output); $result = $this->runCommandRemote('ls -l ' . $symlink, $output) && $result;
$currentRelease = explode('/', $output); $currentRelease = explode('/', $output);
$currentRelease = trim(array_pop($currentRelease)); $currentRelease = trim(array_pop($currentRelease));

2
Mage/Task/BuiltIn/Scm/ChangeBranchTask.php

@ -87,7 +87,7 @@ class ChangeBranchTask extends AbstractTask
$branch = $this->getParameter('branch', $scmData['branch']); $branch = $this->getParameter('branch', $scmData['branch']);
$command = 'git checkout ' . $branch; $command = 'git checkout ' . $branch;
$result = $this->runCommandLocal($command); $result = $this->runCommandLocal($command) && $result;
self::$startingBranch = $currentBranch; self::$startingBranch = $currentBranch;
} else { } else {

Loading…
Cancel
Save