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.
Follow the Getting Started guide to install Puli in your project.
Read the Puli Documentation to learn more about Puli.
Contributions to Puli are always welcome!
- Report any bugs or issues you find on the issue tracker.
- You can grab the source code at Puli’s Git repository.
If you are having problems, send a mail to bschussek@gmail.com or shout out to @webmozart on Twitter.
All contents of this package are licensed under the MIT license.