1
我想更新我的数据库架构,而不从symfony结构传递。 PHP斌/控制台学说:架构:更新--force学说:如何更新架构没有symfony
,因为我使用的是自定义的PHP应用程序 我有一个静态函数返回的实体管理器里面学说:
$paths = array("services/Entity");
$isDevMode = true;
// the connection configuration
$dbParams = array(
'host' => '',
'port' => '',
'driver' => '',
'user' => '',
'password' => '',
'dbname' => '',
'charset' => 'UTF8',
);
$config = \Doctrine\ORM\Tools\Setup::createConfiguration($isDevMode,"cache/Proxies");
$driver = new \Doctrine\ORM\Mapping\Driver\AnnotationDriver(new \Doctrine\Common\Annotations\AnnotationReader(), $paths);
// registering noop annotation autoloader - allow all annotations by default
\Doctrine\Common\Annotations\AnnotationRegistry::registerLoader('class_exists');
$config->setMetadataDriverImpl($driver);
//$entityManager = \Doctrine\ORM\EntityManager::create($dbParams, $config);
$entityManager = \Doctrine\ORM\EntityManager::create($dbParams, $config);
return $entityManager;
我使用的注释中我的实体。
感谢