forked from CottageLabs/coar-notifications
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cli-config.php
29 lines (22 loc) · 851 Bytes
/
cli-config.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
require_once "vendor/autoload.php";
// Create a simple "default" Doctrine ORM configuration for Annotations
$isDevMode = true;
$proxyDir = null;
$cache = null;
$useSimpleAnnotationReader = false;
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__ . "/src/orm"),
$isDevMode, $proxyDir, $cache, $useSimpleAnnotationReader);
// the connection configuration
$conn = array('host' => getenv('MYSQL_HOST'),
'driver' => 'pdo_mysql',
'user' => getenv('MYSQL_USER'),
'password' => getenv('MYSQL_PASSWORD'),
'dbname' => getenv('MYSQL_DATABASE'),
);
// obtaining the entity manager
$entityManager = EntityManager::create($conn, $config);
return ConsoleRunner::createHelperSet($entityManager);