2017-01-24 13:57:28 +01:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Global Configuration Override
|
|
|
|
*
|
|
|
|
* You can use this file for overriding configuration values from modules, etc.
|
|
|
|
* You would place values in here that are agnostic to the environment and not
|
|
|
|
* sensitive to security.
|
|
|
|
*
|
|
|
|
* @NOTE: In practice, this file will typically be INCLUDED in your source
|
|
|
|
* control, so do not include passwords or other sensitive information in this
|
|
|
|
* file.
|
|
|
|
*/
|
2017-03-10 15:30:47 +01:00
|
|
|
|
2022-03-09 11:25:15 +01:00
|
|
|
use Doctrine\DBAL\Driver\PDO\MySQL\Driver;
|
2019-09-04 20:40:41 +02:00
|
|
|
use Monarc\Core\Service\DoctrineCacheServiceFactory;
|
|
|
|
use Monarc\Core\Service\DoctrineLoggerFactory;
|
|
|
|
|
2019-09-05 08:13:09 +02:00
|
|
|
$appconfdir = getenv('APP_CONF_DIR') ?? '';
|
2017-03-10 15:30:47 +01:00
|
|
|
|
|
|
|
$datapath = "data";
|
2022-03-08 12:59:30 +01:00
|
|
|
if (!empty($appconfdir)) {
|
|
|
|
$datapath = $appconfdir . '/data';
|
2017-03-10 15:30:47 +01:00
|
|
|
}
|
|
|
|
|
2017-01-24 13:57:28 +01:00
|
|
|
return array(
|
|
|
|
// DOCTRINE CONF
|
|
|
|
'service_manager' => array(
|
|
|
|
'factories' => array(
|
2019-09-04 20:40:41 +02:00
|
|
|
'doctrine.cache.mycache' => DoctrineCacheServiceFactory::class,
|
|
|
|
'doctrine.monarc_logger' => DoctrineLoggerFactory::class,
|
2017-01-24 13:57:28 +01:00
|
|
|
),
|
|
|
|
),
|
|
|
|
'doctrine' => array(
|
|
|
|
'connection' => array(
|
|
|
|
'orm_default' => array(
|
2019-10-30 10:53:05 +01:00
|
|
|
'driverClass' => Driver::class,
|
2017-01-24 13:57:28 +01:00
|
|
|
'params' => array(
|
|
|
|
'host' => 'localhost',
|
|
|
|
'port' => 3306,
|
|
|
|
'user' => 'root',
|
|
|
|
'password' => '',
|
|
|
|
'dbname' => 'monarc_common',
|
|
|
|
'charset' => 'utf8',
|
|
|
|
'driverOptions' => array(
|
|
|
|
PDO::ATTR_STRINGIFY_FETCHES => false,
|
|
|
|
PDO::ATTR_EMULATE_PREPARES => false,
|
|
|
|
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
'orm_cli' => array(
|
2019-10-30 10:53:05 +01:00
|
|
|
'driverClass' => Driver::class,
|
2017-01-24 13:57:28 +01:00
|
|
|
'params' => array(
|
|
|
|
'host' => 'localhost',
|
|
|
|
'port' => 3306,
|
|
|
|
'user' => 'root',
|
|
|
|
'password' => '',
|
|
|
|
'dbname' => 'monarc_cli',
|
|
|
|
'charset' => 'utf8',
|
|
|
|
'driverOptions' => array(
|
|
|
|
PDO::ATTR_STRINGIFY_FETCHES => false,
|
|
|
|
PDO::ATTR_EMULATE_PREPARES => false,
|
|
|
|
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
/*'migrations_configuration' => array(
|
|
|
|
'orm_default' => array(
|
|
|
|
'name' => 'Monarc Migrations',
|
|
|
|
'directory' => __DIR__."/../../migrations",
|
|
|
|
'namespace' => 'Monarc\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',
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// https://github.com/beberlei/DoctrineExtensions/blob/master/config/mysql.yml
|
|
|
|
'configuration' => array(
|
|
|
|
'orm_default' => array(
|
|
|
|
'metadata_cache' => 'mycache',
|
|
|
|
'query_cache' => 'mycache',
|
|
|
|
'result_cache' => 'mycache',
|
|
|
|
'driver' => 'orm_default', // This driver will be defined later
|
|
|
|
'generate_proxies' => true,
|
2017-03-10 15:30:47 +01:00
|
|
|
'proxy_dir' => $datapath.'/DoctrineORMModule/Proxy',
|
2017-01-24 13:57:28 +01:00
|
|
|
'proxy_namespace' => 'DoctrineORMModule\Proxy',
|
|
|
|
'filters' => array(),
|
|
|
|
'datetime_functions' => array(),
|
|
|
|
'string_functions' => array(),
|
|
|
|
'numeric_functions' => array(),
|
|
|
|
'second_level_cache' => array(),
|
2017-02-01 11:09:21 +01:00
|
|
|
'sql_logger' => 'doctrine.monarc_logger',
|
2017-01-24 13:57:28 +01:00
|
|
|
),
|
|
|
|
'orm_cli' => array(
|
|
|
|
'metadata_cache' => 'mycache',
|
|
|
|
'query_cache' => 'mycache',
|
|
|
|
'result_cache' => 'mycache',
|
|
|
|
'driver' => 'orm_cli', // This driver will be defined later
|
|
|
|
'generate_proxies' => true,
|
2017-03-10 15:30:47 +01:00
|
|
|
'proxy_dir' => $datapath.'/DoctrineORMModule/Proxy',
|
2017-01-24 13:57:28 +01:00
|
|
|
'proxy_namespace' => 'DoctrineORMModule\Proxy',
|
|
|
|
'filters' => array(),
|
|
|
|
'datetime_functions' => array(),
|
|
|
|
'string_functions' => array(),
|
|
|
|
'numeric_functions' => array(),
|
|
|
|
'second_level_cache' => array(),
|
2017-02-01 11:09:21 +01:00
|
|
|
'sql_logger' => 'doctrine.monarc_logger',
|
2017-01-24 13:57:28 +01:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
// END DOCTRINE CONF
|
|
|
|
);
|