Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
classmap
instead of files
for global __
Composer supports having two different mechanisms for autoloading, [`classmap`][composer-classmap] or [`files`][composer-files]. The `files` option is intended to be used for PHP files which define functions in the global namespace. Any classes that need to be in the global namespace should happen via the `classmap` option. In situations where you try using `__` inside of a Composer callback [script][composer-script], you would receive a 'Class "__" not found' message. This is due to the fact that `files` are not autoloaded in Composer scripts. > Callbacks can only autoload classes from psr-0, psr-4 and classmap > definitions. If a defined callback relies on functions defined outside > of a class, the callback itself is responsible for loading the file > containing these functions. [composer-script]: https://getcomposer.org/doc/articles/scripts.md#defining-scripts [composer-classmap]: https://getcomposer.org/doc/04-schema.md#classmap [composer-files]: https://getcomposer.org/doc/04-schema.md#files
- Loading branch information