\CDNFile
- Author: <marcus@symbiote.com.au>
- License: BSD License http://www.silverstripe.org/bsd-license
Synopsis
class CDNFile
extends DataExtension
{
- // constants
- const ANYONE_PERM = 'Anyone';
- const MAX_FILE_PATH_LENGTH = 1024;
- // members
- private static array $db = ;
- private static array $dependencies = ;
- public ContentService $contentService;
- // methods
- public void validate()
- public ContentReader reader()
- public ContentWriter writer()
- public void targetStore()
- public void Size()
- public void getCDNStore()
- public void getCDNWriter()
- public null updateURL()
- public void getCdnLink()
- public String getSecureControllerLink()
- public String getSecureURL()
- public String getViewType()
- public void onAfterWrite()
- public void updateChildFolderLinks()
- public void onBeforeDelete()
- public void onAfterDelete()
- public void onAfterUpload()
- public void ensureLocalFile()
- public void localFileExists()
- public void downloadFromContentService()
- public void uploadToContentService()
- public void deleteLocalIfExistsOnContentService()
- public void moveToCdn()
- public void updateCMSFields()
Hierarchy
Extends
- DataExtension
Constants
Name | Value |
---|---|
ANYONE_PERM | 'Anyone' |
MAX_FILE_PATH_LENGTH | 1024 |
Members
Methods
public
- Size()
- deleteLocalIfExistsOnContentService() — Added so that a file can be brought down from CDN to be manipulated/examined and then removed safely if it already exists on CDN.
- downloadFromContentService()
- ensureLocalFile() — Ensures there's a local assets path to the required file
- getCDNStore() — Handles FileVersion interaction
- getCDNWriter()
- getCdnLink()
- getSecureControllerLink() — Return a link to the S3SecureFileController with the id of this file appended allowing for secure link resolution at page load, including on cached pages
- getSecureURL() — Return a secure url for the file. Currently we expect all secure urls are time limited but other limiting methods nay be supported in the future
- getViewType() — Climbs the folder hierarchy until there's a CanViewType that does not equal Inherit
- localFileExists()
- moveToCdn() — Moves this file to its same path on the named CDN
- onAfterDelete()
- onAfterUpload()
- onAfterWrite() — Ensure update_filesystem is set to FALSE if we're writing something to do with a CDN File/Folder
- onBeforeDelete() — And if deleting don't do so
- reader()
- targetStore() — Return the CDN store that this file should be stored into, based on its parent setting, if no parent is found the ContentService default is returned
- updateCMSFields()
- updateChildFolderLinks()
- updateURL() — Update the URL used for a file in various locations
- uploadToContentService() — Upload this content asset to the configured CDN
- validate()
- writer()