I'm just getting started with Composer. I want to make sure I correctly understand what Composer does when it downloads and installs packages from Packagist using Composer's defaults. Is this correct:
- The "Require" section of the
composer.jsonfile specifies the packages that will be downloaded and installed from Packagist. Only those packages listed in the "Require" section will be downloaded and installed. - During the download and install process in Step #1, an
autoload_namespaces.phpfile is created within the defaultvendorfolder (which is created in the root of the project during downloading and installation). This file contains a namespace definition for each downloaded and installed package which is mapped to a folder on the file system - The classes contained within the files downloaded in Step #1 are only accessible via
autoload_namespaces.php'snamespaces IF EACH DOWNLOADED FILE CONTAINS A NAMESPACE DEFINITION THAT MATCHES ONE OFautoload_namespaces.php'sNAMESPACES. If no namespace definition is present within a downloaded file the classes within the file are assigned to the GLOBAL namespace. - The "Autoloader" section of the composer.json file is ONLY used to define custom namespaces and map those custom namespaces to a folder on the file system. Downloaded and installed package namespaces are defined only in the
autoload_namespaces.phpfile AND ARE NOT AFFECTED IN ANY WAY BY THE "Autoloader" SECTION ofcomposer.json, ASSUMING THAT A NAMESPACE PRESENT WITHIN THEautoload_namespaces.phpFILE IS NOT DUPLICATED IN THEcomposer.json"Autoloader" SECTION.
Is my understanding about the above items correct? If not, would you please correct me?
Thanks In Advance -
Aucun commentaire:
Enregistrer un commentaire