-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap.php
executable file
·35 lines (29 loc) · 1.01 KB
/
bootstrap.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
<?php /** @noinspection PhpUnhandledExceptionInspection */
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Tools\Setup;
require_once __DIR__ . '/vendor/autoload.php';
$config = Setup::createAnnotationMetadataConfiguration([__DIR__ . "/src/DBEntity"], true);
$conn = [
'driver' => 'pdo_mysql',
'dbname' => 'Sysbot',
'user' => 'user',
'password' => 'password',
'host' => 'localhost'
];
/* //use this if you don't want to install MySQL (please, install it)
$conn = [
'driver' => 'pdo_sqlite',
'path' => __DIR__ . '/db.sqlite'
];
*/
/* //use this if you plan to use Redis as caching system (improves speed)
$redis = new Redis();
$redis->connect('localhost');
$redis->auth('foobared');
$cache_driver = new Doctrine\Common\Cache\RedisCache();
$cache_driver->setRedis($redis);
$config->setQueryCacheImpl($cache_driver);
$config->setResultCacheImpl($cache_driver);
$config->setMetadataCacheImpl($cache_driver);
*/
$entity_manager = EntityManager::create($conn, $config);