The Composer PSR-0 Resource Locator implementation leverages dflydev/composer-autoload to locate the effective Composer autoloader in use at runtime and accesses its namespace map.
See dflydev/psr0-resource-locator for more information on the PSR-0 Resource Locator interface.
This library can installed by Composer.
<?php
use Dflydev\Psr0ResourceLocator\Composer\ComposerResourceLocator;
$resourceLocator = new ComposerResourceLocator;
// Search all PSR-0 namespaces registered by Composer
// to find the first directory found looking like:
// "/Vendor/Project/Resources/mappings"
$mappingDirectory = $resourceLocator->findFirstDirectory(
'Vendor\Project\Resources\mappings'
);
// Search all PSR-0 namespaces registered by Composer
// to find all templates directories looking like:
// "/Vendor/Project/Resources/templates"
$templateDirs = $resourceLocator->findDirectories(
'Vendor\Project\Resources\templates',
);
MIT, see LICENSE.
If you have questions or want to help out, join us in the #dflydev channel on irc.freenode.net.