diff --git a/composer.json b/composer.json index 87dcc7a..1bc71ce 100644 --- a/composer.json +++ b/composer.json @@ -11,7 +11,8 @@ "php": ">=5.5", "zendframework/zendframework": "2.5.3", "doctrine/doctrine-orm-module": "^0.10", - "doctrine/migrations": "^1.4" + "doctrine/migrations": "^1.4", + "robmorgan/phinx": "0.5.*" }, "repositories":[ { diff --git a/config/autoload/global.php b/config/autoload/global.php index eed30ce..d205663 100644 --- a/config/autoload/global.php +++ b/config/autoload/global.php @@ -11,6 +11,7 @@ * file. */ return array( + // DOCTRINE CONF 'doctrine' => array( 'connection' => array( 'orm_default' => array( @@ -20,7 +21,21 @@ return array( 'port' => 3306, 'user' => 'user', 'password' => 'password', - 'dbname' => 'monarc', + 'dbname' => 'monarc_common', + 'charset' => 'utf8', + 'driverOptions' => array( + PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', + ), + ), + ), + 'orm_cli' => array( + 'driverClass' => 'Doctrine\DBAL\Driver\PDOMySql\Driver', + 'params' => array( + 'host' => 'localhost', + 'port' => 3306, + 'user' => 'root', + 'password' => 'password', + 'dbname' => 'monarc_cli', 'charset' => 'utf8', 'driverOptions' => array( PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8', @@ -28,13 +43,62 @@ return array( ), ), ), - 'migrations_configuration' => array( + /*'migrations_configuration' => array( 'orm_default' => array( 'name' => 'Monarc Migrations', 'directory' => __DIR__."/../../migrations", 'namespace' => 'Monarc\Migrations', - 'table_name' => 'doctrine_migrations', + 'table' => 'migrations', + 'column' => 'version', + ), + 'orm_cli' => array( + 'name' => 'Monarc Common Migrations', + 'directory' => __DIR__."/../../migrations", + 'namespace' => 'MonarcCli\Migrations', + 'table' => 'migrations', + 'column' => 'version', + ), + ),*/ + 'entitymanager' => array( + 'orm_default' => array( + 'connection' => 'orm_default', + 'configuration' => 'orm_default' + ), + 'orm_cli' => array( + 'connection' => 'orm_cli', + 'configuration' => 'orm_cli', + ), + ), + 'configuration' => array( + 'orm_default' => array( + 'metadata_cache' => 'array', + 'query_cache' => 'array', + 'result_cache' => 'array', + 'driver' => 'orm_default', // This driver will be defined later + 'generate_proxies' => true, + 'proxy_dir' => 'data/DoctrineORMModule/Proxy', + 'proxy_namespace' => 'DoctrineORMModule\Proxy', + 'filters' => array(), + 'datetime_functions' => array(), + 'string_functions' => array(), + 'numeric_functions' => array(), + 'second_level_cache' => array(), + ), + 'orm_cli' => array( + 'metadata_cache' => 'array', + 'query_cache' => 'array', + 'result_cache' => 'array', + 'driver' => 'orm_cli', // This driver will be defined later + 'generate_proxies' => true, + 'proxy_dir' => 'data/DoctrineORMModule/Proxy', + 'proxy_namespace' => 'DoctrineORMModule\Proxy', + 'filters' => array(), + 'datetime_functions' => array(), + 'string_functions' => array(), + 'numeric_functions' => array(), + 'second_level_cache' => array(), ), ), ), + // END DOCTRINE CONF ); diff --git a/config/autoload/local.php.dist b/config/autoload/local.php.dist index 78145f3..6927e3c 100644 --- a/config/autoload/local.php.dist +++ b/config/autoload/local.php.dist @@ -12,4 +12,24 @@ */ return array( + 'doctrine' => array( + 'connection' => array( + 'orm_default' => array( + 'params' => array( + 'host' => 'localhost', + 'user' => 'root', + 'password' => 'password', + 'dbname' => 'monarc_common', + ), + ), + 'orm_cli' => array( + 'params' => array( + 'host' => 'localhost', + 'user' => 'root', + 'password' => 'password', + 'dbname' => 'monarc_cli', + ), + ), + ), + ), );