As far as I know, composer cannot load the multi-vendor directory, but I have seen that many laravel workbench can load their own vendor files and then load them through the laravel phpartisandump-autoload command. I am not very familiar with laravel's mechanism. I would like to ask laravel's high... as far as I know
composerYes, it cannot load more
vendorDirectory
But I see a lotlaravelOfworkbenchYou can load yourself.vendorFile
ThenlaravelOfphp artisan dump-autoloadCommand loaded in. I am not very familiarlaravel.
Pleaselaravel!! Thank you.
Reply content:
As far as I knowcomposerYes, it cannot load morevendorDirectory
But I see a lotlaravelOfworkbenchYou can load yourself.vendorFile
ThenlaravelOfphp artisan dump-autoloadCommand loaded in. I am not very familiarlaravel.
Pleaselaravel!! Thank you.
First, this is basically irrelevant to Laravel.
Why do many people find that Laravel has many new features after using Laravel, because the code and framework on the market are bothAccumulating difficultiesMany PHP experts are used to the powerful functions and usage in the PHP4 era. They prefer and don't want to use PHP's new object-oriented features.Taylor OtwellThis.NETWhen programmers looked at the official PHP document and invented Laravel, everyone was shocked. PHP could still write like this!
So not Laravel is powerful, but PHP itself is very powerful, but it was not used in the past. In fact, PHP's language features are rigorous, and it is not as easy as Ruby to make a DSL (domain-specific language ).
PHP's file loading mechanism is very simple and free, that isinclude 'fuck.php';The logic behindfuck.phpThe code in is copied and put here.
To facilitate the introduction of other files, PHP introducesAutomatic Loading, Official documentation in: http://php.net/manual/zh/language.oop5.autoload.php
The logic for automatic loading is also very simple, that is, to maintain a table, which class is written in which file to facilitate the PHP interpreterincludeIt. System dependent on Composerinclude /vendor/autoload.phpThis file is used to maintain the table. This table can be manually maintained.
Laravel supports bothpsr-0Andpsr-4Automatically load the specifications and their documentation in the http://www.php-fig.org/bottom right corner.
This problem is solved because the workbench package has been modified.
Class> FileThe corresponding table, added several rows.