0
我在學習學說。我通過Tarball下載配置教條2.2.0。現在在生成數據庫模式時會遇到麻煩。不能使用下面的代碼的命令行工具:學說控制檯程序
<?php
// doctrine.php - Put in your application root
use Doctrine\ORM\Tools\Setup;
use Doctrine\ORM\EntityManager;
use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper;
use Doctrine\DBAL\Tools\Console\Helper\EntityManagerHelper;
use Doctrine\ORM\Tools\Console\ConsoleRunner;
use Symfony\Component\Console\Helper\HelperSet;
$lib = "../DoctrineORM-2.2.0";
require $lib . '/Doctrine/ORM/Tools/Setup.php';
Setup::registerAutoloadDirectory($lib);
$paths = array("/path/to/entities-or-mapping-files");
$isDevMode = false;
$config = Setup::createAnnotationMetadataConfiguration($paths, $isDevMode);
$dbParams = array(
'dbname' => 'mydb',
'user' => 'root',
'password' => '',
'host' => '127.0.0.1',
'driver' => 'pdo_mysql'
);
$em = EntityManager::create($dbParams, $config);
$helperSet = new HelperSet(array(
'db' => new ConnectionHelper($em->getConnection()),
'em' => new EntityManagerHelper($em)
));
ConsoleRunner::run($helperSet);
這裏的錯誤。
Fatal error: Class 'Doctrine\DBAL\Tools\Console\Helper\EntityManagerHelper' not found in E:\wamp\www\project\doctrine.php on line 30
和DoctrineORM-2.2.0 \原則\ DBAL \ TOOLS下我無法找到EntityManagerHelper.php \控制檯\助手。
沒錯。如果你按照例子添加一些命令,那麼你會遇到更多的這些錯別字。但它最終會起作用。 – Cerad 2012-02-29 21:02:37