xlabs / hwcdnbundle
HighWinds CDN 套件
1.0.5
2023-05-15 08:36 UTC
Requires
- php: >=5.3.9
- symfony/symfony: ^2.8|^3.4
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
}) }}