pointybeard/keycdnasset 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

pointybeard/keycdnasset

Composer 安装命令:

composer require pointybeard/keycdnasset

包简介

Library for pushing assets to KeyCDN, generating links, and checking availablity.

README 文档

README

Latest Stable Version License

Library for checking availability of assets and pushing new assets to KeyCDN.

Installation

KeyCDN Asset is installed via Composer. To install, use composer require pointybeard/keycdnasset or add "pointybeard/keycdnasset": "~1.0" to your composer.json file.

Usage Example

Here is a quick example of how to use this group of classes


include "vendor/autoload.php";
use pointybeard\KeyCDNAsset\Lib;

$zone = new Lib\Zone(
    "myzone",
    "https://myzone-90f.kxcdn.com",
    Lib\Zone::FLAG_SECURE
);

$credentials = new Lib\Credentials(
    "my-username",
    "my-secure-token-key"
)

$asset = new Lib\Asset(
    $credentials,
    "/path/to/asset/on/this/zone/file.zip",
    $zone
)

### CHECKING AVAILABILITY ###
var_dump($asset->available());

### GENERATING A LINK TO THE ASSET ###
print (string)$asset->link();

### PUSHING AN ASSET ###

try{
    $result = NULL;

    //This ensures when the file is pushed, it doesn't retain all the source path info.
    chdir('/some/local/assets');

    $asset = Lib\Asset::push(
        $credentials,
        "file.zip",
        $zone,
        NULL, //Specify a different KeyCDN Host value here
        $result
    );
    var_dump($asset, $asset->available());

} catch (Lib\Exceptions\KeyCDNFailedToSyncException $ex) {
    print "Looks like pushing to CDN has failed - {$ex->getMessage()}";
    exit;

} finally {
    var_dump($result);
}

Support

If you believe you have found a bug, please report it using the GitHub issue tracker, or better yet, fork the library and submit a pull request.

Contributing

We encourage you to contribute to this project. Please check out the Contributing documentation for guidelines about how to get involved.

License

"KeyCDN Asset" is released under the MIT License.

统计信息

  • 总下载量: 36
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-08

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固