How is Laravel compatible with the composer package of workbench?

Source: Internet
Author: User
Tags autoload
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.