Laravel module autoload policy confusion

When executing

   php artisan workbench user/asset 

additional dependency(module) placed to

   workbench/user/asset/vendor/illuminate/support.

Then framework autoload this module( illuminate/support ) from workbench/user/asset/vendor/* , but i think it must load it from /vendor/laravel/framework/src/Illuminate/

So we have confusion here - some classes are loaded from framework( vendor/laravel/* ) and some classes are loaded from workbench/[vendor]/[module] . Is that supposed to work that way? Or is it a bug?


Yes and No.

During development of your package it will work that way, because the whole structure is inside /workbench . It also helps you working in different versions of packages, develop using Laravel 4.1 while your app is still on 4.0.

After you finish working on your package, it's better to create a real Composer package. You can create a private one and then, yeah, once you install it via Composer it will be placed in /vendor .

链接地址: http://www.djcxy.com/p/88636.html

上一篇: 作曲家,Laravel和本地包

下一篇: Laravel模块autoload策略混淆