[PHP] The idea of using Composer components globally

Source: Internet
Author: User
Tags composer install

/* * * Steps to use the composer component globally: * * 1. Build a project that contains all the composer packages that need to be used globally. *      such as: globalvendor/*      composer Init initialization *      Composer Install installation * * 2. php.ini Specify Auto_prepend_file = '/PATH/TO/GL obalvendor/vendor/autoload.php ' *      ** *

Note Composer Each item has a different Autoloader, but registers the automatic loading of the class with the same name, which overrides the former.

PHP configuration Auto_prepend_file can be a relative path or an absolute path.

In the case of a relative path, the path specified in Include_path is looked up and its value is viewed with Php-r "echo ini_get (' include_path ');"

The results are as follows.:/ usr/local/php-7.1.4/lib/php

source:https://github.com/farwish/php-lab/blob/master/globalvendor.php

Link:http://www.cnblogs.com/farwish/p/7296686.html

[PHP] The idea of using Composer components globally

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.