1
0
Fork 0

Document files autoloading order, fixes #10509

pull/10828/head
Jordi Boggiano 2022-06-07 15:27:43 +02:00
parent 7cf3b01631
commit e9b44b4499
No known key found for this signature in database
GPG Key ID: 7BBD42C429EC80BC
1 changed files with 12 additions and 1 deletions

View File

@ -646,6 +646,17 @@ Example:
}
```
Files autoload rules are included whenever `vendor/autoload.php` is included, right after
the autoloader is registered. The order of inclusion depends on package dependencies so that
if package A depends on B, files in package B will be included first to ensure package B is fully
initialized and ready to be used when files from package A are included.
If two packages have the same amount of dependents or no dependencies, the order is alphabetical.
Files from the root package are always loaded last, and you cannot use files autoloading
yourself to override functions from your dependencies. If you want to achieve that we recommend
you include your own functions *before* including Composer's `vendor/autoload.php`.
#### Exclude files from classmaps
If you want to exclude some files or folders from the classmap you can use the `exclude-from-classmap` property.