...

World Wide Web Server 2012-07-04 16:05:13 -07:00
parent 76b6a511e0
commit 5316cd91e8

@ -32,7 +32,7 @@ Doctrine_Manager::connection('mysql://root:root@127.0.0.1/test');
Doctrine_Manager::getInstance()->setAttribute('model_loading', 'conservative');
[/code]
This is pieced together from the sandbox example and uses the default MAMP database settings. You'll probably need to change at least the MySQL settings but possibly the paths as well.
This is pieced together from the sandbox example and uses the default MAMP database settings. You'll probably need to change at least the MySQL settings but possibly the paths as well. Additionally if you plan on using the CLI then you'll want to replace out all instances of `APPPATH` with the full path.
[h3]3. Install the custom loader[/h3]
@ -106,7 +106,28 @@ class Welcome extends Controller {
[h3]5. Using Migrations[/h3]
First up you'll need to create a database table to store the current migrated version, so run this query on your CI database:
First you'll need to set up the command line interface of Doctrine by creating a file named `doctrine` in your system/application directory. In it place the following:
[code]
#!/usr/bin/env php
<?php
chdir(dirname(__FILE__));
require_once('config/doctrine.php');
// Configure Doctrine Cli
// Normally these are arguments to the cli tasks but if they are set here the arguments will be auto-filled
$config = array('data_fixtures_path' => DATA_FIXTURES_PATH,
'models_path' => MODELS_PATH,
'migrations_path' => MIGRATIONS_PATH,
'sql_path' => SQL_PATH,
'yaml_schema_path' => YAML_SCHEMA_PATH);
$cli = new Doctrine_Cli($config);
$cli->run($_SERVER['argv']);
[/code]
Then you'll need to create a database table to store the current migrated version, so run this query on your CI database:
[code]
CREATE TABLE `migration_version` (