PHP code example of weboptic / flysystem-bunnycdn

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

    

weboptic / flysystem-bunnycdn example snippets


use BunnyCDN\Storage\BunnyCDNClient;
use League\Flysystem\Filesystem;
use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNAdapter;
use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNRegion;

$adapter = new BunnyCDNAdapter(
    new BunnyCDNClient(
        'storage-zone', 
        'api-key', 
        BunnyCDNRegion::FALKENSTEIN
    )
);

$filesystem = new Filesystem($adapter);

use BunnyCDN\Storage\BunnyCDNClient;
use League\Flysystem\Filesystem;
use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNAdapter;
use PlatformCommunity\Flysystem\BunnyCDN\BunnyCDNRegion;

$adapter = new BunnyCDNAdapter(
    new BunnyCDNClient(
        'storage-zone',
        'api-key',
        BunnyCDNRegion::FALKENSTEIN
    ),
    'https://testing.b-cdn.net/' # Pull Zone URL
);
$filesystem = new Filesystem($adapter);

BunnyCDNRegion::FALKENSTEIN = 'de';
BunnyCDNRegion::NEW_YORK = 'ny';
BunnyCDNRegion::LOS_ANGELAS = 'la';
BunnyCDNRegion::SINGAPORE = 'sg';
BunnyCDNRegion::SYDNEY = 'syd';
BuunyCDNRegion::UNITED_KINGDOM = 'uk';