forked from doctrine/orm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[2.0][DDC-274] Fixing Coding Standards for CLI tool.
- Loading branch information
guilhermeblanco
committed
Mar 24, 2010
1 parent
50c4e50
commit b216798
Showing
37 changed files
with
155 additions
and
155 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,15 +19,15 @@ | |
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\Common\Cli; | ||
namespace Doctrine\Common\CLI; | ||
|
||
/** | ||
* Generic CLI Controller of Tasks execution | ||
* | ||
* To include a new Task support, create a task: | ||
* | ||
* [php] | ||
* class MyProject\Tools\Cli\Tasks\MyTask extends Doctrine\ORM\Tools\Cli\Tasks\AbstractTask | ||
* class MyProject\Tools\CLI\Tasks\MyTask extends Doctrine\ORM\Tools\CLI\Tasks\AbstractTask | ||
* { | ||
* public function run(); | ||
* public function basicHelp(); | ||
|
@@ -38,9 +38,9 @@ | |
* And then, load the namespace assoaicated an include the support to it in your command-line script: | ||
* | ||
* [php] | ||
* $cli = new Doctrine\Common\Cli\CliController(); | ||
* $cli = new Doctrine\Common\CLI\CLIController(); | ||
* $cliNS = $cli->getNamespace('custom'); | ||
* $cliNS->addTask('myTask', 'MyProject\Tools\Cli\Tasks\MyTask'); | ||
* $cliNS->addTask('myTask', 'MyProject\Tools\CLI\Tasks\MyTask'); | ||
* | ||
* To execute, just type any classify-able name: | ||
* | ||
|
@@ -55,7 +55,7 @@ | |
* @author Jonathan Wage <[email protected]> | ||
* @author Roman Borschel <[email protected]> | ||
*/ | ||
class CliController extends AbstractNamespace | ||
class CLIController extends AbstractNamespace | ||
{ | ||
/** | ||
* The CLI processor of tasks | ||
|
@@ -69,12 +69,12 @@ public function __construct(Configuration $config, Printers\AbstractPrinter $pri | |
$this->setConfiguration($config); | ||
|
||
// Include core namespaces of tasks | ||
$ns = 'Doctrine\Common\Cli\Tasks'; | ||
$ns = 'Doctrine\Common\CLI\Tasks'; | ||
$this->addNamespace('Core') | ||
->addTask('help', $ns . '\HelpTask') | ||
->addTask('version', $ns . '\VersionTask'); | ||
|
||
$ns = 'Doctrine\ORM\Tools\Cli\Tasks'; | ||
$ns = 'Doctrine\ORM\Tools\CLI\Tasks'; | ||
$this->addNamespace('Orm') | ||
->addTask('clear-cache', $ns . '\ClearCacheTask') | ||
->addTask('convert-mapping', $ns . '\ConvertMappingTask') | ||
|
@@ -87,7 +87,7 @@ public function __construct(Configuration $config, Printers\AbstractPrinter $pri | |
->addTask('generate-entities', $ns . '\GenerateEntitiesTask') | ||
->addTask('generate-repositories', $ns . '\GenerateRepositoriesTask'); | ||
|
||
$ns = 'Doctrine\DBAL\Tools\Cli\Tasks'; | ||
$ns = 'Doctrine\DBAL\Tools\CLI\Tasks'; | ||
$this->addNamespace('Dbal') | ||
->addTask('run-sql', $ns . '\RunSqlTask') | ||
->addTask('version', $ns . '\VersionTask'); | ||
|
@@ -98,12 +98,12 @@ public function __construct(Configuration $config, Printers\AbstractPrinter $pri | |
* Example of inclusion support to a single task: | ||
* | ||
* [php] | ||
* $cli->addTask('my-custom-task', 'MyProject\Cli\Tasks\MyCustomTask'); | ||
* $cli->addTask('my-custom-task', 'MyProject\CLI\Tasks\MyCustomTask'); | ||
* | ||
* @param string $name CLI Task name | ||
* @param string $class CLI Task class (FQCN - Fully Qualified Class Name) | ||
* | ||
* @return CliController This object instance | ||
* @return CLIController This object instance | ||
*/ | ||
public function addTask($name, $class) | ||
{ | ||
|
@@ -294,7 +294,7 @@ private function _retrieveTaskNamespace($namespacePath) | |
|
||
// If the given namespace returned "null", throw exception | ||
if ($taskNamespace === null) { | ||
throw CliException::namespaceDoesNotExist($namespaceName, $currentNamespacePath); | ||
throw CLIException::namespaceDoesNotExist($namespaceName, $currentNamespacePath); | ||
} | ||
|
||
$currentNamespacePath = (( ! empty($currentNamespacePath)) ? ':' : '') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ | |
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\Common\Cli; | ||
namespace Doctrine\Common\CLI; | ||
|
||
/** | ||
* CLI Exception class | ||
|
@@ -33,7 +33,7 @@ | |
* @author Jonathan Wage <[email protected]> | ||
* @author Roman Borschel <[email protected]> | ||
*/ | ||
class CliException extends \Doctrine\Common\CommonException | ||
class CLIException extends \Exception | ||
{ | ||
public static function namespaceDoesNotExist($namespaceName, $namespacePath = '') | ||
{ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.