-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcli-config.php
37 lines (30 loc) · 1.02 KB
/
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
30
31
32
33
34
35
36
37
<?php
/**
* This file is part of the Global Trading Technologies Ltd ad-poller package.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* (c) fduch <[email protected]>
*
* Date: 11.08.17
*/
use Doctrine\ORM\Tools\Setup;
require_once "vendor/autoload.php";
// Create a simple "default" Doctrine ORM configuration for annotations mapping
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration([__DIR__ . "/src/Entity"], $isDevMode, null, null, false);
// Configure database parameters
$conn = [
'driver' => 'mysqli',
'dbname' => 'adpoller',
'user' => 'YOURUSER',
'password' => 'YOURPASSWORD',
'host' => 'localhost',
];
// obtaining the entity manager
$entityManager = \Doctrine\ORM\EntityManager::create($conn, $config);
$helperSet = new \Symfony\Component\Console\Helper\HelperSet([
'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($entityManager)
]);
return $helperSet;