mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-21 15:45:36 +08:00
19 lines
422 B
PHP
19 lines
422 B
PHP
<?php
|
|
// TODO 配置 ORM
|
|
use Doctrine\ORM\Tools\Setup;
|
|
use Doctrine\ORM\EntityManager;
|
|
|
|
$paths = array();
|
|
$isDevMode = false;
|
|
|
|
// the connection configuration
|
|
$dbParams = array(
|
|
'driver' => 'pdo_mysql',
|
|
'user' => 'root',
|
|
'password' => '',
|
|
'dbname' => 'foo',
|
|
);
|
|
|
|
$config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
|
|
$entityManager = EntityManager::create($dbParams, $config);
|