PHP code example of puli / composer-plugin

1. Go to this page and download the library: Download puli/composer-plugin library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

puli / composer-plugin example snippets


$factoryClass = PULI_FACTORY_CLASS;
$factory = new $factoryClass();

// Fetch resources from the repository
$repo = $factory->createRepository();

echo $repo->get('/acme/blog/config/config.yml')->getBody();

// Find resources by binding type
$discovery = $factory->createFactory($repo);

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