Skip to content

kormik/discovery

 
 

Repository files navigation

The Puli Discovery Component

Build Status Scrutinizer Code Quality SensioLabsInsight Latest Stable Version Total Downloads Dependency Status

Latest release: 1.0.0-beta7

PHP >= 5.3.9

The Puli Discovery Component supports binding of Puli resources to binding types. Binding types can be defined with the defineType() method of the EditableDiscovery interface:

use Puli\Discovery\InMemoryDiscovery;

// $repo is a Puli repository
$discovery = new InMemoryDiscovery($repo);

$discovery->defineType('doctrine/xml-mapping');

Resources in the repository can then be bound to the defined type with bind():

$discovery->bind('/app/config/doctrine/*.xml', 'doctrine/xml-mapping');

With findByType(), you can later retrieve all the bindings for the type:

foreach ($discovery->findByType('doctrine/xml-mapping') as $binding) {
    foreach ($binding->getResources() as $resource) {
        // do something...
    }
}

The following ResourceDiscovery implementations are currently supported:

Read the Resource Discovery guide in the Puli documentation to learn more about resource discovery.

Authors

Installation

Follow the Getting Started guide to install Puli in your project.

Documentation

Read the Puli Documentation to learn more about Puli.

Contribute

Contributions to Puli are always welcome!

Support

If you are having problems, send a mail to bschussek@gmail.com or shout out to @webmozart on Twitter.

License

All contents of this package are licensed under the MIT license.

About

Discovers Puli resources bound to predefined types.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%