Recommend this page to a friend! |
Classes of Kushal Pogul | PHP CDN Upload Functions | README.md | Download |
|
DownloadCdnFunctions pluginAbout pluginCdnFunctions plugin contains 3 important functions which allows a file to copy on CDN, Delete a file from CDN & Downloading all files from directory of CDN. Requirements1) CakePHP 3 2) PHP 5.4 3) SSH2 4) CDN Server Including Plugin??In bootstrap.php file of application, add below line to include plugin into application Plugin::load('CdnFunctions', ['autoload' => true]); ??In Controller file, add below line in initialize() function to load plugin in controller. $this->loadComponent('CdnFunctions.Cdn' ); Configuring CDN??In Component file of plugin, specify details of CDN. ??File: \plugins\CdnFunctions\src\Controller\Component\CdnComponent.php
Functions in Plugin1) sendFile($src, $dst) : ??This function sends file to CDN server. ??Usage: ??In controller file of your application,
2) deleteFile($file): ??This Function delete file from CDN Server. ??Usage: ??In controller file of your application,
3) downloadAllFiles($localDir, $remoteDir): ??This function downloads all files present in directory of CDN. ??Usage: ??In controller file of your application,
?? $remoteDir = '/path/on/cdn/'; // path on cdn from where we dowload all files
|