dev-master
9999999-devComposer Autoload Tools
MIT
The Development Requires
composer
v1.0.0-alpha1
1.0.0.0-alpha1Composer Autoload Tools
MIT
The Development Requires
composer
Wallogit.com
2017 © Pedro Peláez
Composer Autoload Tools
Provide a standard interface for accessing and reading Composer autoloaders., (*1)
WARNING: This API is not yet stable and may be subject to change., (*2)
While it is generally not considered best practice for an application to be aware of underlying autoloaders, accessing the autoloader is sometimes a necessity., (*3)
The primary use case behind the creation of this library was providing a Composer implementation of the PSR-0 Resource Locator., (*4)
<?php use Dflydev\Composer\Autoload\ClassLoaderLocator; $locator = new ClassLoaderLocator; $reader = $locator->getReader(); // Get access to all of the prefixes registered to all of // the Composer Class Loaders in one array. $prefixes = $reader->getPrefixes();
Through Composer as dflydev/composer-autoload., (*5)
Direct access to Composer Class Loaders., (*6)
Access to underlying Class Loaders through the Class Loader Reader Interface., (*7)
ClassLoaderReaderInterface getReader(): Get a ClassLoader Reader., (*8)
If multiple ClassLoaders or no Class Loaders are registered a Composite Class Loader Reader will be returned., (*9)
init(): Initialize static instance., (*10)
Can be used to ensure that everything is setup before it is actually used at a later time. For example, if something may be going to modify the list of registered autoloaders, this will ensure that the Composer ones can be found and recorded right away., (*11)
reset(): Reset the static instance., (*12)
This effectively clears the located Class Loader instances. The next time something tries to access the class loaders the list of registered autoloaders will be scanned again., (*13)
set(array $classLoaders): Set the list of Class Loaders., (*14)
This is here primarily for testing purposes., (*15)
Mimics the data methods from Composer\Autoload\ClassLoader., (*16)
array getPrefixes(): Get namespace to directory mapping, (*17)
array getFallbackDirs(): Get list of fallback directories, (*18)
array getClassMap(): Get class mapping, (*19)
string|null findFile($class): Find the file for a specific class., (*20)
In some cases Composer's Class Loader may be replaced by another
autoload implementation. The common example for this is when a
specialized Debug Class Loader is registered on top of Composer.
In these cases it is advised to call init() immediately after
autload.php is required to ensure that Composer's Class Loader can
be located., (*21)
<?php Dflydev\Composer\Autoload\ClassLoaderLocator::init();
MIT, see LICENSE., (*22)
If you have questions or want to help out, join us in the #dflydev channel on irc.freenode.net., (*23)
Composer Autoload Tools
MIT
composer
Composer Autoload Tools
MIT
composer