xlabs/hwcdnbundle

HighWinds CDN bundle

Installs: 663

Dependents: 4

Suggesters: 0

Security: 0

Type:symfony-bundle

1.0.5 2023-05-15 08:36 UTC

This package is auto-updated.

Last update: 2024-11-15 12:22:52 UTC


README

A redis driven like engine.

Installation

Install through composer:

php -d memory_limit=-1 composer.phar require xlabs/hwcdnbundle

In your AppKernel

public function registerbundles()
{
    return [
    	...
    	...
    	new XLabs\HWCDNBundle\XLabsHWCDNBundle(),
    ];
}

Configuration sample

Default values are shown below:

# app/config/config.yml

x_labs_hwcdn:
    public_url: 'https://public.domain.ext'
    tokenized_url: 'https://signed.domain.ext'
    account: ############
    secretKey: ############
    expiration_ttl: 7200
    api_username: ############
    api_password: ############

Usage

Instantiate the service from a Controller by:

$this->get('xlabs_hwcdn')->...

Usage (TWIG)

Instantiate the service from a Controller by:

{{ getCDNResource({
    'media_path' => '...',
    'tokenize' => false, // protect resource with token
    'expiration_ttl' => 7200,
    'force_download' => false // create a CDN download link
}) }}