Index: branches/5.3.x/core/units/helpers/deployment_helper.php =================================================================== diff -u -N -r15956 -r16094 --- branches/5.3.x/core/units/helpers/deployment_helper.php (.../deployment_helper.php) (revision 15956) +++ branches/5.3.x/core/units/helpers/deployment_helper.php (.../deployment_helper.php) (revision 16094) @@ -1,6 +1,6 @@ isCommandLine ) { $this->ip = $this->Application->getClientIp(); } - elseif ( isset($GLOBALS['argv'][3]) ) { - $this->ip = $GLOBALS['argv'][3]; + else { + if ( isset($GLOBALS['argv'][3]) ) { + $this->ip = $GLOBALS['argv'][3]; + } + + if ( isset($GLOBALS['argv'][4]) ) { + $new_stages = explode(',', $GLOBALS['argv'][4]); + $unknown_stages = array_diff($new_stages, $this->stages); + + if ( $unknown_stages ) { + throw new InvalidArgumentException('Unknown deployment stages: ' . implode(', ', $unknown_stages)); + } + + $this->stages = $new_stages; + } } } @@ -173,19 +200,23 @@ $ret = true; $this->dryRun = $dry_run; - foreach ( $this->Application->ModuleInfo as $module_name => $module_info ) { - $this->moduleName = $module_name; + if ( in_array(self::STAGE_DB_MIGRATE, $this->stages) ) { + foreach ( $this->Application->ModuleInfo as $module_name => $module_info ) { + $this->moduleName = $module_name; - if ( !file_exists($this->getModuleFile('project_upgrades.sql')) ) { - continue; - } + if ( !file_exists($this->getModuleFile('project_upgrades.sql')) ) { + continue; + } - $ret = $ret && $this->deploy($module_name); + $ret = $ret && $this->deploy($module_name); + } } - if ( $ret && !$this->dryRun ) { - $this->resetCaches(); - $this->refreshThemes(); + if ( in_array(self::STAGE_CACHE_RESET, $this->stages) ) { + if ( $ret && !$this->dryRun ) { + $this->resetCaches(); + $this->refreshThemes(); + } } if ( !$this->isCommandLine ) { @@ -719,4 +750,4 @@ return $this; } -} \ No newline at end of file +}