Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pointybeard/keycdnasset
Library for checking availability of assets and pushing new assets to KeyCDN (https://www.keycdn.com/)
https://github.com/pointybeard/keycdnasset
Last synced: 9 days ago
JSON representation
Library for checking availability of assets and pushing new assets to KeyCDN (https://www.keycdn.com/)
- Host: GitHub
- URL: https://github.com/pointybeard/keycdnasset
- Owner: pointybeard
- License: other
- Created: 2018-10-08T00:32:49.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2018-10-23T18:44:09.000Z (about 6 years ago)
- Last Synced: 2024-10-12T06:21:06.540Z (about 1 month ago)
- Language: PHP
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
Awesome Lists containing this project
README
# KeyCDN Asset
- Version: v1.0.0
- Date: Oct 08 2018
- [Release notes](https://github.com/pointybeard/keycdnasset/blob/master/CHANGELOG.md)
- [GitHub repository](https://github.com/pointybeard/keycdnasset)[![Latest Stable Version](https://poser.pugx.org/pointybeard/keycdnasset/version)](https://packagist.org/packages/pointybeard/keycdnasset) [![License](https://poser.pugx.org/pointybeard/keycdnasset/license)](https://packagist.org/packages/pointybeard/keycdnasset)
Library for checking availability of assets and pushing new assets to [KeyCDN](https://www.keycdn.com/).
## Installation
KeyCDN Asset is installed via [Composer](http://getcomposer.org/). 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
```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](https://github.com/pointybeard/keycdnasset/issues),
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](https://github.com/pointybeard/keycdnasset/blob/master/CONTRIBUTING.md) for guidelines about how to get involved.
## License
"KeyCDN Asset" is released under the [MIT License](http://www.opensource.org/licenses/MIT).