diff --git a/lib/Doctrine/Config.php b/lib/Doctrine/Config.php new file mode 100644 index 000000000..ac2695703 --- /dev/null +++ b/lib/Doctrine/Config.php @@ -0,0 +1,33 @@ +openConnection($adapter, $name); + } + + public function bindComponent($modelName, $connectionName) + { + return Doctrine_Manager::getInstance()->bindComponent($modelName, $connectionName); + } + + public function setAttribute($key, $value) + { + foreach ($this->connections as $connection) { + $connection->setAttribute($key, $value); + } + } + + public function addCliConfig($key, $value) + { + $this->cliConfig[$key] = $value; + } + + public function getCliConfig() + { + return $this->cliConfig; + } +} \ No newline at end of file diff --git a/lib/cli b/lib/cli new file mode 100755 index 000000000..a8bd6e2c9 --- /dev/null +++ b/lib/cli @@ -0,0 +1,4 @@ +#!/usr/bin/env php +getCliConfig()); +$cli->run($_SERVER['argv']); \ No newline at end of file diff --git a/lib/config.php.dist b/lib/config.php.dist new file mode 100644 index 000000000..2e2d11c06 --- /dev/null +++ b/lib/config.php.dist @@ -0,0 +1,57 @@ +. + */ +/** + * Config + * + * This is a sample implementation of Doctrine + * You can use the Doctrine_Config interface below to setup the basics. + * Or if you prefer you can setup your Doctrine configuration manually. + * + * @package Doctrine + * @subpackage Config + * @license http://www.opensource.org/licenses/lgpl-license.php LGPL + * @link www.phpdoctrine.com + * @since 1.0 + * @version $Revision: 2753 $ + * @author Konsta Vesterinen + * @author Jonathan H. Wage + */ + +// Load Doctrine +require_once('Doctrine.php'); +spl_autoload_register(array('Doctrine', 'autoload')); + +// New Doctrine Config +$config = new Doctrine_Config(); + +// Setup Connections +//$config->addConnection('mysql://user:pass@localhost/db_name', 'connection_1'); +//$config->addConnection(new PDO('dsn', 'username', 'password'), 'connection_2); + +// Bind components/models to connections +//$config->bindComponent('User', 'connection_1'); + +// Configure Doctrine Cli +// Normally these are arguments to the cli tasks but if they are set here the arguments will be auto-filled +//$config->addCliConfig('data_fixtures_path', '/path/to/your/data_fixtures'); +//$config->addCliConfig('models_path', '/path/to/your/models'); +//$config->addCliConfig('migrations_path', '/peth/to/your/migration/classes'); +//$config->addCliConfig('sql_path', '/path/to/your/exported/sql'); \ No newline at end of file