dflydev/psr0-resource-locator-composer

Composer PSR-0 Resource Locator

dev-master / 1.0.x-dev 2014-07-16 21:19 UTC

This package is auto-updated.

Last update: 2024-11-29 03:59:14 UTC


README

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.

Requirements

Installation

This library can installed by Composer.

Usage

<?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',
);

License

MIT, see LICENSE.

Community

If you have questions or want to help out, join us in the #dflydev channel on irc.freenode.net.