PHP code example of necromant2005 / cdn

1. Go to this page and download the library: Download necromant2005/cdn 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/ */

    

necromant2005 / cdn example snippets


    
    return array(
        'modules' => array(
            // ...
            'TweeCdn',
        ),
        // ...
    );
    

    
    return array(
        'di' => array(
            'instance' => array(
                'TweeCdn\View\Helper\Cdn' => array(
                    'parameters' => array(
                        // simple configuration
                        'type'    => 'simple',
                        'options' => array(
                            'public_dir' => __DIR__ . '/../../../../public',
                            'mappings' => array(
                                '/js/jquery.js' => '//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js'
                            ),
                        ),
                    ),
                ),
            ),
        ),
    );
    

    
    return array(
        'di' => array(
            'instance' => array(
                'TweeCdn\View\Helper\Cdn' => array(
                    'parameters' => array(
                        // simple configuration
                        'release'    => 'release',
                        'options' => array(
                            'public_dir' => __DIR__ . '/../../../../public',
                            'release' => trim(file_get_contents(__DIR__ . '/../../../../REVISION')),
                        ),
                    ),
                ),
            ),
        ),
    );
    

    
    return array(
        'di' => array(
            'instance' => array(
                'TweeCdn\View\Helper\Cdn' => array(
                    'parameters' => array(
                        // simple configuration
                        'release'    => 'hash',
                        'options' => array(
                            'public_dir' => __DIR__ . '/../../../../public',
                            'hostnames' => array('http://cdn-0.coockieless.domain.com', 'http://cdn-1.coockieless.domain.com'),
                            'hashes' => (file_exists(__DIR__ . '/../tmp/hashes.php')) ? 
bash
    $ php composer.phar update
    
bash
    vendor/bin/hash_collector.php