/* * * 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