31 lines
800 B
PHP
31 lines
800 B
PHP
<?php
|
|
|
|
use Jgut\Slim\Doctrine\ManagerBuilder;
|
|
|
|
require __DIR__ . '/vendor/autoload.php';
|
|
$settings = [
|
|
'default' => [
|
|
'annotation_autoloaders' => ['class_exists'],
|
|
'connection' => [
|
|
'driver' => 'pdo_mysql',
|
|
'user' => 'doughnut',
|
|
'password' => 'doughnut',
|
|
'dbname' => 'doughnut',
|
|
'host' => 'mysql',
|
|
],
|
|
'metadata_mapping' => [
|
|
[
|
|
'type' => ManagerBuilder::METADATA_MAPPING_ANNOTATION,
|
|
'path' => [__DIR__ . '/src/Sikofitt/App/Entity'],
|
|
],
|
|
],
|
|
],
|
|
];
|
|
|
|
$managerBuilder = new ManagerBuilder([ManagerBuilder::RELATIONAL_MANAGER_KEY => 'default']);
|
|
$managerBuilder->loadSettings($settings);
|
|
return $managerBuilder->getManager('entityManager');
|
|
|
|
|
|
|