【发布时间】:2013-09-02 07:07:59
【问题描述】:
我从教义开始,想从表中创建一个 db 或 php 类。
首先我尝试创建数据库。我的 bootstrap.php:
<?php
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
require_once "vendor/autoload.php";
require_once "src/BugRepository.php";
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src"), $isDevMode);
$conn = array(
'driver' => 'pdo_pgsql',
'user' => 'postgres',
'password' => '123456',
'host' => 'localhost',
'dbname' =>'testdata',
);
$entityManager = EntityManager::create($conn, $config);
我愿意:
php vendor/bin/doctrine doctrine:database:create
我的输出:
SRC_DIR="`pwd`"
cd "`dirname "$0"`"
cd "../doctrine/orm/bin"
BIN_TARGET="`pwd`/doctrine"
cd "$SRC_DIR"
"$BIN_TARGET" "$@"
但是 db testdata没有创建。
与从表中创建 php 类相同:
php vendor/bin/doctrine doctrine:mapping:import YourAppBundle yml --filter="bugs"
但未创建 yml 文件。
有什么问题吗?
【问题讨论】:
标签: php doctrine-orm doctrine