+++ Introduction The Doctrine Cli is a collection of tasks that help you with your day to do development and testing with your Doctrine implementation. Typically with the examples in this manual, you setup php scripts to perform whatever tasks you may need. This Cli tool is aimed at providing an out of the box solution for those tasks. +++ Tasks Below is a list of available tasks for managing your Doctrine implementation. ./cli build-all ./cli build-all-load ./cli build-all-reload ./cli compile ./cli create-db ./cli create-tables ./cli dql ./cli drop-db ./cli dump-data ./cli generate-migration ./cli generate-migrations-from-db ./cli generate-migrations-from-models ./cli generate-models-from-db ./cli generate-models-from-yaml ./cli generate-sql ./cli generate-yaml-from-db ./cli generate-yaml-from-models ./cli load-data ./cli load-dummy-data ./cli migrate ./cli rebuild-db The tasks for the CLI are separate from the CLI and can be used standalone. Below is an example. $task = new Doctrine_Task_GenerateModelsFromYaml(); $args = array('yaml_schema_path' => '/path/to/schema', 'models_path' => '/path/to/models'); $task->setArguments($args); try { if ($task->validate()) { $task->execute(); } } catch (Exception $e) { throw new Doctrine_Exception($e->getMessage()); } +++ Usage File named "cli" that is set to executable #!/usr/bin/env php Actual php file named "cli.php" that implements the Doctrine_Cli. // Include your Doctrine configuration/setup here, your connections, models, etc. // Configure Doctrine Cli // Normally these are arguments to the cli tasks but if they are set here the arguments will be auto-filled and are not required for you to enter them. $config = array('data_fixtures_path' => '/path/to/data/fixtures', 'models_path' => '/path/to/models', 'migrations_path' => '/path/to/migrations', 'sql_path' => '/path/to/data/sql', 'yaml_schema_path' => '/path/to/schema'); $cli = new Doctrine_Cli($config); $cli->run($_SERVER['argv']); Now you can begin executing commands. ./cli generate-models-from-yaml ./cli create-tables