FileAccess Orion

MyMaxCDN
in package
implements ContentDeliveryNetwork

Implement CDN Handler based on StackPath

Note: Formerly MaxCDN

Tags
category

Interface function

author

Tobias Teichner webmaster@teichner.biz

since

File available since v0.84

Interfaces, Classes, Traits and Enums

ContentDeliveryNetwork
Define CDN Handler

Table of Contents

$api  : string
$config_file  : string|null
$extensions  : array<string|int, mixed>|null
List of extensions
$preset_file  : string
$settings  : stdClass|null
The configuration The resolved configuration object.
$token  : stdClass|null
Token buffer
__construct()  : mixed
Build the CDN abstraction layer
BuildLink()  : string
Build link Build a link to cdn based on the given local link
DeleteAll()  : Result
purge all values delete all files in a specific zone of the CDN
DeleteSingle()  : Result
delete single delete a single file from cache
ExtractPathFromLink()  : string
clear link remove the cdn domain from the link
GetFormPreset()  : Result
Get settings form Load the settings form setup
GetSettings()  : Result
Get settings Load the settings file
IsActive()  : bool
Ist aktiv?
StackInfo()  : Result
StoreSettings()  : Result
Save settings form Save the settings of the form setup
callDelete()  : Result
API Call delete in zone
callStackInfo()  : Result
connect()  : stdClass|null
Get connection and the jwt token
filterExtensions()  : array<string|int, mixed>|null
List extension we cover
loadLocalSettings()  : void
load settings object from local storage

Properties

$api

private string $api = 'https://gateway.stackpath.com'

$config_file

private string|null $config_file

$extensions

List of extensions

private array<string|int, mixed>|null $extensions = null

$preset_file

private string $preset_file = FAA_PATHS_LIBABS . 'handler/cdn/maxcdn.json'

$settings

The configuration The resolved configuration object.

private stdClass|null $settings = null

A resolved configuration object

$token

Token buffer

private stdClass|null $token = null

Methods

__construct()

Build the CDN abstraction layer

public __construct() : mixed
Return values
mixed

Build link Build a link to cdn based on the given local link

public BuildLink(string $url[, bool $https = false ]) : string
Parameters
$url : string

The url to map

$https : bool = false

Use https protocol

Tags
inheritDoc
Return values
string

The mapped link to the configured cdn

DeleteAll()

purge all values delete all files in a specific zone of the CDN

public DeleteAll() : Result
Tags
inheritDoc
Return values
Result

A default result object

DeleteSingle()

delete single delete a single file from cache

public DeleteSingle(string $file) : Result
Parameters
$file : string

The path to a stored cache file

Tags
inheritDoc
Return values
Result

A system result object

clear link remove the cdn domain from the link

public ExtractPathFromLink(string $url) : string
Parameters
$url : string

The path to a stored cache file

Tags
inheritDoc
Return values
string

A parsed url without absolute domain and protocol or the original url

GetFormPreset()

Get settings form Load the settings form setup

public GetFormPreset() : Result
Tags
inheritDoc
Return values
Result

System result object

GetSettings()

Get settings Load the settings file

public GetSettings() : Result
Tags
inheritDoc
Return values
Result

System result object

IsActive()

Ist aktiv?

public IsActive() : bool
Return values
bool

StoreSettings()

Save settings form Save the settings of the form setup

public StoreSettings(array<string|int, mixed> $values) : Result
Parameters
$values : array<string|int, mixed>

The update values

Tags
inheritDoc
Return values
Result

System result object

callDelete()

API Call delete in zone

private callDelete(string $token, array<string|int, mixed> $params) : Result
Parameters
$token : string
$params : array<string|int, mixed>
Return values
Result

callStackInfo()

private callStackInfo(string $token) : Result
Parameters
$token : string
Return values
Result

connect()

Get connection and the jwt token

private connect() : stdClass|null
Return values
stdClass|null

filterExtensions()

List extension we cover

private filterExtensions() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|null

loadLocalSettings()

load settings object from local storage

private loadLocalSettings() : void
Return values
void

Search results