LicenseCommunicator
in package
Communicates with "the internet" to update a license
Tags
Table of Contents
Properties
- $instance : mixed
- $javascriptRegistered : mixed
- $lastUpdate : mixed
- $requestInterval : mixed
Methods
- __construct() : mixed
- addJsUpdateCode() : mixed
- Registers the javascript code to update a license
- getInstance() : LicenseCommunicator
- Singleton accessor
- isTimeToUpdate() : bool
- Tells wheter its time to update or not
- update() : null
- Updates the license
- fetchResponse() : mixed
Properties
$instance
private
static mixed
$instance
= null
$javascriptRegistered
private
static mixed
$javascriptRegistered
= false
$lastUpdate
private
mixed
$lastUpdate
$requestInterval
private
mixed
$requestInterval
= 1
Methods
__construct()
public
__construct(mixed &$_CONFIG) : mixed
Parameters
- $_CONFIG : mixed
addJsUpdateCode()
Registers the javascript code to update a license
public
addJsUpdateCode(array<string|int, mixed> &$_CORELANG, mixed $license[, mixed $intern = false ][, bool $autoexec = true ]) : mixed
Parameters
- $_CORELANG : array<string|int, mixed>
-
Core language array
- $license : mixed
- $intern : mixed = false
- $autoexec : bool = true
-
(optional) Wheter to perform update check automaticly or on form submit
getInstance()
Singleton accessor
public
static getInstance(mixed &$_CONFIG) : LicenseCommunicator
Parameters
- $_CONFIG : mixed
Return values
LicenseCommunicatorisTimeToUpdate()
Tells wheter its time to update or not
public
isTimeToUpdate() : bool
Return values
bool —True if license is outdated, false otherwise
update()
Updates the license
public
update(License &$license, array<string|int, mixed> $_CONFIG[, bool $forceUpdate = false ][, bool $forceTemplate = false ][, array<string|int, mixed> $_CORELANG = array() ][, string $response = '' ]) : null
Parameters
- $license : License
-
The license to update
- $_CONFIG : array<string|int, mixed>
-
The configuration array
- $forceUpdate : bool = false
-
(optional) If set to true, update is performed even if time to update is not reached yet
- $forceTemplate : bool = false
-
(optional) If set to true, the server is requested to send the template
- $_CORELANG : array<string|int, mixed> = array()
-
(optional) Core language array
- $response : string = ''
-
(optional) Server response as JSON. If this is set, no HTTP request is perfomed
Return values
nullfetchResponse()
protected
fetchResponse(mixed $license, mixed $_CONFIG, mixed $forceTemplate, mixed $_CORELANG) : mixed
Parameters
- $license : mixed
- $_CONFIG : mixed
- $forceTemplate : mixed
- $_CORELANG : mixed