The essence of the aravel framework is also made up of a bunch of excellent components. To understand the laravel framework, you need to understand the various components used in the laravel framework.
Among the various component libraries in php, the two most important ones are Packagist PEAR
Among them, Packagist cooperates with Composer. Composer can be used to install components in packagist and complete automatic loading.
After using composer to download the components locally, two files, composer.json and composer.lock, will be generated. The composer.lock file will list all the PHP components of the project and the specific version numbers of the components. This locks the version and allows the project to only Ability to use specific versions of PHP components. The advantage of this is that composer will download the specific version listed in this file, regardless of the latest version available in Packagist. You should put the composer.lock file into version control so that team members use the same PHP version as you. If local development and the server use the same PHP component version, bugs caused by different component versions can be minimized.
Composer's automatic loading is actually a file named autoload.php, which is saved in the vendor directory. When Composer downloads each PHP component, it will check the composer.json file of each component to determine how to load the component. After getting this information, Composer will create a kimono PSR standard autoloader locally for this component. This way we can instantiate any PHP component in the project. These components need to be loaded automatically.
Statement:
All resources on this website are contributed and published by netizens, or reprinted by major download sites. Please check the integrity of the software yourself! All resources on this website are for learning and reference only. Please do not use them for commercial purposes, otherwise you will be responsible for all consequences incurred! If there is any infringement, please contact us to delete and remove it. Contact information: admin@php.cn