0

我正在关注教程。当我使用命令时

php app/console doctrine:fixtures:load

然后我收到一个错误

C:\wamp\www\Symfony>php app/console doctrine:fixtures:load
'stty' is not recognized as an internal or external command,
operable program or batch file.

  [RuntimeException]

  The autoloader expected class "Symfony\Bundle\DoctrineFixturesBundle\DoctrineF
ixturesBundle" to be defined in file "C:\wamp\www\Symfony\app/../vendor/bundles\
Symfony\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle.php". The file was
found but the class was not in it, the class name or namespace probably has a ty
po.

我是 symfony2 的新手。

4

1 回答 1

2

我注意到的第一个问题是您没有使用DoctrineFixturesBundle. 我建议你更新图书馆。

警告:命名空间已更改

此捆绑包以前位于Symfony\Bundle命名空间下,现在已移至Doctrine\Bundle命名空间。

其次,你需要声明DoctrineFixturesBundle你的AppKernel.

// ...
public function registerBundles()
{
    $bundles = array(
        // ...
        // Be carefull with the namespace!
        new \Doctrine\Bundle\DoctrineFixturesBundle\DoctrineFixturesBundle(),
        // ...
    );
    // ...
}

您可以在此处找到更多信息:(DoctrineFixturesBundles不是最新的!)

于 2012-07-31T08:32:02.467 回答