From 5255145701f983d461ec4ddf0fde9f171ed2b7c3 Mon Sep 17 00:00:00 2001 From: "Jonathan.Wage" Date: Wed, 10 Oct 2007 18:21:36 +0000 Subject: [PATCH] Tweaks to CLI and initial entry of some new blank tasks. --- lib/Doctrine/Cli.php | 4 +- lib/Doctrine/Cli/Task/GenerateMigration.php | 41 +++++++++++++++++++++ lib/Doctrine/Cli/Task/Migrate.php | 41 +++++++++++++++++++++ 3 files changed, 84 insertions(+), 2 deletions(-) create mode 100644 lib/Doctrine/Cli/Task/GenerateMigration.php create mode 100644 lib/Doctrine/Cli/Task/Migrate.php diff --git a/lib/Doctrine/Cli.php b/lib/Doctrine/Cli.php index fdff83cfd..ce4ddf524 100644 --- a/lib/Doctrine/Cli.php +++ b/lib/Doctrine/Cli.php @@ -100,13 +100,13 @@ class Doctrine_Cli } if ($optionalArguments = $taskInstance->getOptionalArgumentsDescriptions()) { - foreach ($requiredArguments as $name => $description) { + foreach ($optionalArguments as $name => $description) { $args .= $name . ' - ' . $description."\n"; } } if ($args) { - echo "\nArguments:\n"; + echo "\nArguments (* = required):\n"; echo $args; } diff --git a/lib/Doctrine/Cli/Task/GenerateMigration.php b/lib/Doctrine/Cli/Task/GenerateMigration.php new file mode 100644 index 000000000..1fb43c5b3 --- /dev/null +++ b/lib/Doctrine/Cli/Task/GenerateMigration.php @@ -0,0 +1,41 @@ +. + */ + +/** + * Doctrine_Cli_Task_GenerateMigration + * + * @package Doctrine + * @subpackage Cli + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision: 2761 $ + * @author Jonathan H. Wage + */ +class Doctrine_Cli_Task_GenerateMigration extends Doctrine_Cli_Task +{ + public $description = 'Generate new migration class definition', + $requiredArguments = array('path' => 'Specify the complete path to your migration classes folder.'), + $optionalArguments = array(); + + public function execute() + { } +} \ No newline at end of file diff --git a/lib/Doctrine/Cli/Task/Migrate.php b/lib/Doctrine/Cli/Task/Migrate.php new file mode 100644 index 000000000..617d77dc0 --- /dev/null +++ b/lib/Doctrine/Cli/Task/Migrate.php @@ -0,0 +1,41 @@ +. + */ + +/** + * Doctrine_Cli_Task_Migrate + * + * @package Doctrine + * @subpackage Cli + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision: 2761 $ + * @author Jonathan H. Wage + */ +class Doctrine_Cli_Task_Migrate extends Doctrine_Cli_Task +{ + public $description = 'Migrate database to latest version or the specified version', + $requiredArguments = array(), + $optionalArguments = array('version' => 'Version to migrate to. If you do not specify, the db will be migrated from the current version to the latest.'); + + public function execute() + { } +} \ No newline at end of file