2012-07-31 118 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(不是最新的!)