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
composer
Yes, it cannot load more
vendor
Directory
But I see a lotlaravel
Ofworkbench
You can load yourself.vendor
File
Thenlaravel
Ofphp artisan dump-autoload
Command loaded in. I am not very familiarlaravel
.
Pleaselaravel
!! Thank you.
Reply content:
As far as I knowcomposer
Yes, it cannot load morevendor
Directory
But I see a lotlaravel
Ofworkbench
You can load yourself.vendor
File
Thenlaravel
Ofphp artisan dump-autoload
Command 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 difficulties
Many 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 Otwell
This.NET
When 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.php
The 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 interpreterinclude
It. System dependent on Composerinclude
/vendor/autoload.php
This file is used to maintain the table. This table can be manually maintained.
Laravel supports bothpsr-0
Andpsr-4
Automatically 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> File
The corresponding table, added several rows.