【问题标题】:symfony2 error, stty not recognizedsymfony2 错误,stty 无法识别
【发布时间】:2012-07-31 08:17:03
【问题描述】:

我关注the tutorial。当我使用命令时

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 的新手。

【问题讨论】:

  • 你使用的是什么版本的 Symfony2?

标签: symfony stty


【解决方案1】:

我注意到的第一个问题是您没有使用DoctrineFixturesBundle 的正确命名空间。我建议你更新库。

警告:命名空间已更改

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

其次,您需要在您的AppKernel 中声明DoctrineFixturesBundle

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-04-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-12-13
    • 2013-07-24
    • 1970-01-01
    相关资源
    最近更新 更多