我不理解bundle體系結構的正確性。 我創建了一個父母是FOSUserBundle的包。我想在其他symfony2安裝中使用我創建的SHN/UserBundle。Bundle註冊在供應商包內
內部的目標應用程序,我收到一個
LogicException: Bundle "SHNUserBundle" extends bundle "FOSUserBundle", which is not registered.
我的意思是我向應自動註冊,因爲我SHN/UserBundle使用它的fosuserbundle?
我的思維錯誤在哪裏?
/src/SHN/UserBundle/composer.json:
"name" : "SHN/UserBundle",
"description" : "Overwrites the FOS Userbundle with some futures",
"type" : "symfony-bundle",
"authors" : [{
"name" : "Timo Linde",
"email" : "[email protected]",
"role" : "Developer"
}],
"keywords" : [
"fos-userbundle extend"
],
"license" : [
"proprietary"
],
"require" : {
"php": ">=5.3.3",
"friendsofsymfony/user-bundle": "~1.3"
},
"autoload" : {
"psr-0" : {
"SHN\\UserBundle" : ""
}
},
"target-dir" : "SHN/UserBundle",
好吧,然後我不想在我的目標應用程序的composer.json的require部分添加FOSUserBundle。因爲它已經在我的供應商軟件包SHN/Userbundle的供應商文件夾中。我如何從該位置註冊?我得到這個異常: 試圖從/var/www/shn/app/AppKernel.php第21行中的命名空間「FOS \ UserBundle」加載類「FOSUserBundle」。您是否需要從另一個命名空間「使用」它? – CoKe 2014-10-31 12:41:55
有沒有人有關於此的一個想法? – CoKe 2014-11-05 08:21:47
您是否使用作曲家安裝軟件包?如果是這樣,作曲家應該爲你做這個 – 2014-11-05 08:54:57