2012-07-31 123 views
0

我在关注the tutorial。当我使用命令symfony2错误,stty无法识别

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。

+0

什么版本的Symfony2您使用的是? – Florent 2012-07-31 08:18:57

+0

@Florent 2.0.16 – 2012-07-31 08:20:02

回答

2

我注意到的第一个问题是您不使用DoctrineFixturesBundle的正确名称空间。我建议你更新图书馆。

警告:命名空间改变

这包是以前Symfony\Bundle命名空间下,现在转移到Doctrine\Bundle命名空间。

其次,您需要在AppKernel内声明DoctrineFixturesBundle

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

你可以在这里找到更多的信息:DoctrineFixturesBundles(不是最新的!)