File tree Expand file tree Collapse file tree 3 files changed +44
-1
lines changed
Expand file tree Collapse file tree 3 files changed +44
-1
lines changed Original file line number Diff line number Diff line change 3737 return $ logger ;
3838};
3939
40+ // Doctrine
41+ $ container ['em ' ] = function ($ c ) {
42+ $ settings = $ c ->get ('settings ' );
43+ $ config = \Doctrine \ORM \Tools \Setup::createAnnotationMetadataConfiguration (
44+ $ settings ['doctrine ' ]['meta ' ]['entity_path ' ],
45+ $ settings ['doctrine ' ]['meta ' ]['auto_generate_proxies ' ],
46+ $ settings ['doctrine ' ]['meta ' ]['proxy_dir ' ],
47+ $ settings ['doctrine ' ]['meta ' ]['cache ' ],
48+ false
49+ );
50+ $ em = \Doctrine \ORM \EntityManager::create ($ settings ['doctrine ' ]['connection ' ], $ config );
51+
52+ $ helpers = new Symfony \Component \Console \Helper \HelperSet (array (
53+ 'db ' => new \Doctrine \DBAL \Tools \Console \Helper \ConnectionHelper ($ em ->getConnection ()),
54+ 'em ' => new \Doctrine \ORM \Tools \Console \Helper \EntityManagerHelper ($ em )
55+ ));
56+
57+ return $ em ;
58+ };
59+
60+
4061// -----------------------------------------------------------------------------
4162// Action factories
4263// -----------------------------------------------------------------------------
Original file line number Diff line number Diff line change 2020 'name ' => 'app ' ,
2121 'path ' => __DIR__ . '/../log/app.log ' ,
2222 ],
23+ 'doctrine ' => [
24+ 'meta ' => [
25+ 'entity_path ' => ['app/src/Entities/ ' ],
26+ 'auto_generate_proxies ' => true ,
27+ 'proxy_dir ' => __DIR__ .'/../cache/proxies ' ,
28+ 'cache ' => null ,
29+ ],
30+ 'connection ' => [
31+ 'driver ' => 'pdo_mysql ' ,
32+ 'host ' => 'localhost ' ,
33+ 'dbname ' => 'db-cms ' ,
34+ 'user ' => 'root ' ,
35+ 'password ' => 'root ' ,
36+ 'charset ' => 'utf8 ' ,
37+ 'driverOptions ' => array (
38+ 1002 => 'SET NAMES utf8 '
39+ )
40+ ]
41+ ]
2342 ],
2443];
Original file line number Diff line number Diff line change 2020 "slim/slim" : " ^3.0" ,
2121 "slim/twig-view" : " ^2.0" ,
2222 "slim/flash" : " ^0.1.0" ,
23- "monolog/monolog" : " ^1.13"
23+ "monolog/monolog" : " ^1.13" ,
24+ "doctrine/orm" : " ~2.5" ,
25+ "firephp/firephp-core" : " v0.4.0" ,
26+ "nochso/html-compress-twig" : " ^2.0"
2427 }
2528}
You can’t perform that action at this time.
0 commit comments