Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

code style and small documentation fixes

due to comments in a6d8222 4fd934d
  • Loading branch information...
commit a098f97b0efb325a25194f130626c232d63b382c 1 parent 4fd934d
@cebe cebe authored
View
22 framework/cli/commands/MigrateCommand.php
@@ -15,11 +15,11 @@
* the yii-dbmigrations extension ((https://github.com/pieterclaerhout/yii-dbmigrations),
* authored by Pieter Claerhout.
*
- * Since version 1.1.11 this command will exit with the following exit status codes:
+ * Since version 1.1.11 this command will exit with the following exit codes:
* <ul>
* <li>0 on success</li>
* <li>1 on general error</li>
- * <li>2 on failing migration.</li>
+ * <li>2 on failed migration.</li>
* </ul>
*
* @author Qiang Xue <qiang.xue@gmail.com>
@@ -67,7 +67,8 @@ class MigrateCommand extends CConsoleCommand
public function beforeAction($action,$params)
{
$path=Yii::getPathOfAlias($this->migrationPath);
- if($path===false || !is_dir($path)) {
+ if($path===false || !is_dir($path))
+ {
echo 'Error: The migration directory does not exist: '.$this->migrationPath."\n";
exit(1);
}
@@ -119,7 +120,8 @@ public function actionUp($args)
public function actionDown($args)
{
$step=isset($args[0]) ? (int)$args[0] : 1;
- if($step<1) {
+ if($step<1)
+ {
echo "Error: The step parameter must be greater than 0.\n";
return 1;
}
@@ -154,7 +156,8 @@ public function actionDown($args)
public function actionRedo($args)
{
$step=isset($args[0]) ? (int)$args[0] : 1;
- if($step<1) {
+ if($step<1)
+ {
echo "Error: The step parameter must be greater than 0.\n";
return 1;
}
@@ -204,7 +207,8 @@ public function actionTo($args)
$originalVersion=$version;
if(preg_match('/^m?(\d{6}_\d{6})(_.*?)?$/',$version,$matches))
$version='m'.$matches[1];
- else {
+ else
+ {
echo "Error: The version option must be either a timestamp (e.g. 101129_185401)\nor the full name of a migration (e.g. m101129_185401_create_user_table).\n";
return 1;
}
@@ -223,10 +227,12 @@ public function actionTo($args)
{
if(strpos($migration,$version.'_')===0)
{
- if($i===0) {
+ if($i===0)
+ {
echo "Already at '$originalVersion'. Nothing needs to be done.\n";
return 0;
- } else
+ }
+ else
return $this->actionDown(array($i));
}
}
View
2  framework/console/CConsoleCommand.php
@@ -112,7 +112,7 @@ public function behaviors()
* dispatch the command request to an appropriate action with the corresponding
* option values
* @param array $args command line parameters for this command.
- * @return integer application exit code returned by the action, 0 if action does not return anything
+ * @return integer application exit code, which is returned by the invoced action, 0 if the action did not return anything
* (return value is available since version 1.1.11)
*/
public function run($args)
View
3  framework/console/CConsoleCommandRunner.php
@@ -46,7 +46,8 @@ class CConsoleCommandRunner extends CComponent
/**
* Executes the requested command.
* @param array $args list of user supplied parameters (including the entry script name and the command name).
- * @return integer|null application exit code returned by the command
+ * @return integer|null application exit code returned by the command.
+ * if null is returned by command, application will not exit. See also {@link CConsoleApplication::processRequest()}.
* (return value is available since version 1.1.11)
*/
public function run($args)
Please sign in to comment.
Something went wrong with that request. Please try again.