xlabs/hwcdnbundle

HighWinds CDN 套件

安装: 662

依赖: 4

建议者: 0

安全: 0

类型:symfony-bundle

1.0.5 2023-05-15 08:36 UTC

This package is auto-updated.

Last update: 2024-09-15 11:46:44 UTC


README

一个类似 Redis 的引擎。

安装

通过 composer 安装

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

在你的 AppKernel 中

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

配置示例

以下显示默认值

# 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: ############

用法

通过控制器实例化服务

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

用法 (TWIG)

通过控制器实例化服务

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