PHP code example of mi / metadata-puli-file-locator

1. Go to this page and download the library: Download mi/metadata-puli-file-locator 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/ */

    

mi / metadata-puli-file-locator example snippets


$serializer =
JMS\Serializer\SerializerBuilder::create()
    ->setMetadataDriverFactory(new Mi\Puli\Serializer\Builder\PuliDiscoveryDriverFactory($puliDiscovery))
    ...
    ->build();

$serializer =
JMS\Serializer\SerializerBuilder::create()
    ->addMetadataDir('/puli/path/to/file', 'Vendor\Namespace\Prefix')
    ->setMetadataDriverFactory(new Mi\Puli\Serializer\Builder\PuliRepositoryDriverFactory($puliRepository))
    ...
    ->build();
bash
php puli.phar bind /puli/path/to/file/*.xml jms/serializer-metadata --param extension="xml" \
--namespace-prefix="Vendor\Namespace\Prefix"