brenodouglas / doctrineconfig
Utility config doctrine
dev-master / 1.3.x-dev
2015-08-01 18:24 UTC
Requires
- php: >=5.3
- composer/composer: 1.0.*@dev
- doctrine/common: 2.5.*
- doctrine/dbal: 2.5.*
- doctrine/orm: 2.5.*
- symfony/dependency-injection: 2.6.*@dev
- symfony/yaml: 2.*
This package is not auto-updated.
Last update: 2024-12-21 17:33:02 UTC
README
Integration doctrine in project Respect/Rest
Require PHP >= 5.3
In index.php
require 'autoload.php';
\RespectDoctrine\Doctrine\Doctrine::setConfigDir("config.php");
$doctrine = new Doctrine();
$em = $doctrine->getEntityManager();
In config.php
return [
'database' => [
'default' => 'mysql',
'mysql' => [
'dbname' => "application",
'user' => 'root',
'port' => null,
'password' => '',
'host' => 'localhost',
'driver' => 'pdo_mysql'
],
'pgsql' => [
'dbname' => "application",
'user' => 'root',
'port' => 5232,
'password' => '',
'host' => 'localhost',
'driver' => 'pdo_pgsql'
]
],
'doctrine' => [
/** Namespaces on Entity mapped */
'entity' => [
__DIR__."/Api/Entity"
],
/** Dir of metadatas generate */
'metadata' => __DIR__."/../cache/doctrine"
]
];