PHP code example of ekino / tiny-png-sonata-media-bundle

1. Go to this page and download the library: Download ekino/tiny-png-sonata-media-bundle 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/ */

    

ekino / tiny-png-sonata-media-bundle example snippets




// app/AppKernel.php

public function registerBundles()
{
    $bundles = [
        // ...
        new Ekino\TinyPngSonataMediaBundle\EkinoTinyPngSonataMediaBundle(),
        // ...
    ];
}



// config/bundles.php

return [
    // ...
    Ekino\TinyPngSonataMediaBundle\EkinoTinyPngSonataMediaBundle::class => ['all' => true],
    // ...
];



$client->optimize($inputPath, $outputPath, $overwrite);