这是基本布局:
mywebsite
shared
bundles
MyWebsite
CoreBundle
src
MyWebsite
MyProduct
ABundle
shared
是一个子模块(git),但我需要 Symfony 能够在同一命名空间下找到共享包,即:
namespace MyWebsite\MyProduct\ABundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use MyWebsite\CoreBundle as Core;
class Recipe extends Core\Entity\SimpleEntity {}
我尝试更改 composer.json 文件以添加新目录:
"autoload": {
"psr-0": { "": [ "src/", "shared/bundles/" ] }
},
这可能吗?还是我只是错过了什么?