require ‘vendor/autoload.php’; $puliClass = PULI_FACTORY_CLASS; $puli = new $puliClass(); $repo = $puli->createRepository(); Simplify access to resources How to use Puli?
echo $repo->get('/app/views/index.html.twig') ->getBody(); echo $repo->get('/app/views/index.html.twig') ->getFilesystemPath(); echo $repo->get('/custom-library'. '/views/index.html.twig') ->getFilesystemPath(); Simplify access to resources How to use Puli?
// your app puli.json { "resources": { "/app": "app", "/res": "app/Resources" }, "provide": { "/app/config/services.yml": "symfony/services", "/res/translations/*.yml": "symfony/translations" } } Autoload specialized files Defined by Symfony to load your files using Puli $discovery->findBindings('...') How to use Puli?
// /vendor/acme/custom-library/puli.json { "resources": { "/config": "res/config", "/translations": "res/translations" }, "provide": { "/config/symfony-services.yml": "symfony/services", "/config/pimple-services.yml": "pimple/services", "/config/php-di-services.yml": "php-di/services" } } Autoload specialized files Usable by libraries Binding are not necessarily used by the “consumer” How to use Puli?
$ composer require acme/custom-library => Services available in your container => Translations available in your translator => Doctrine entities, Twig extensions, ... Autoload specialized files Plug’n’Play (even more than bundles!) How to use Puli?