Plugins
extends Recorder
in package
Uses
ProjectConfigFields
Table of Contents
- $_isRecording : bool
- $logQueue : array<string|int, mixed>
- $settings : array<string|int, mixed>
- Old plugin settings
- emptyQueue() : mixed
- Empty the commited log queue, causing all the logs in the queue to be lost
- getConfigValues() : array<string|int, mixed>
- Get config values for a path
- getDirtyConfig() : array<string|int, mixed>
- Calculate dirty config, $newSettigns and $oldSettings are arrays of field handlers
- getIsRecording() : bool
- Is this recorder currently recording
- getQueue() : array<string|int, mixed>
- Get the log queue
- getQueuedLogByUid() : ActivityLog|null
- Get a queued log for an uid and type
- init() : mixed
- onChanged() : mixed
- onDisabled() : mixed
- Save a log when a plugin is disabled
- onEditionChanged() : mixed
- Save a log when a plugin edition is changed
- onEnabled() : mixed
- Save a log when a plugin is enabled
- onInstalled() : mixed
- Save a log when a plugin is installed
- onSettingsChanged() : mixed
- Save a log when a plugin settings are saved
- onUninstalled() : mixed
- Save a log when a plugin is uninstalled
- queueHasLogForUid() : bool
- Does a log related to an uid and type exists in the queue
- removeQueuedLogsByUid() : mixed
- Remove a queued log by uid and type
- saveLogs() : mixed
- Save all queued logs
- startRecording() : mixed
- Get this recorder to start recording
- stopRecording() : mixed
- Get this recorder to stop recording
- commitLog() : bool
- Commit a log to be saved, log will be added in the queue if $saveNow is false
- getHandler() : FieldHandler
- Get the handler for a path and a value
- getPathFieldHandler() : string
- Get the field handler for a path
- getTrackedFieldNames() : mixed
- getTrackedFieldTypings() : array<string|int, mixed>
- Get fields typing, must return an array :
- isTypeIgnored() : bool
- is a type ignored by the settings
- shouldSaveLog() : bool
- Should a log type be saved
- typeValue() : mixed
- Type a value by path
Properties
$_isRecording
protected
bool
$_isRecording
= true
$logQueue
protected
array<string|int, mixed>
$logQueue
= []
$settings
Old plugin settings
protected
array<string|int, mixed>
$settings
= []
Methods
emptyQueue()
Empty the commited log queue, causing all the logs in the queue to be lost
public
emptyQueue() : mixed
Return values
mixed —getConfigValues()
Get config values for a path
public
getConfigValues(string $basePath, array<string|int, mixed> $config) : array<string|int, mixed>
Parameters
- $basePath : string
- $config : array<string|int, mixed>
Return values
array<string|int, mixed> —getDirtyConfig()
Calculate dirty config, $newSettigns and $oldSettings are arrays of field handlers
public
getDirtyConfig(string $basePath, array<string|int, mixed> $newSettings, array<string|int, mixed> $oldSettings) : array<string|int, mixed>
Parameters
- $basePath : string
- $newSettings : array<string|int, mixed>
- $oldSettings : array<string|int, mixed>
Return values
array<string|int, mixed> —getIsRecording()
Is this recorder currently recording
public
getIsRecording() : bool
Return values
bool —getQueue()
Get the log queue
public
getQueue() : array<string|int, mixed>
Return values
array<string|int, mixed> —getQueuedLogByUid()
Get a queued log for an uid and type
public
getQueuedLogByUid(string $uid, string $type) : ActivityLog|null
Parameters
- $uid : string
- $type : string
Return values
ActivityLog|null —init()
public
init() : mixed
Tags
Return values
mixed —onChanged()
public
onChanged(Event $event) : mixed
Parameters
- $event : Event
Return values
mixed —onDisabled()
Save a log when a plugin is disabled
public
onDisabled(string $handle) : mixed
Parameters
- $handle : string
Return values
mixed —onEditionChanged()
Save a log when a plugin edition is changed
public
onEditionChanged(string $handle, string $newEdition, string $oldEdition) : mixed
Parameters
- $handle : string
- $newEdition : string
- $oldEdition : string
Return values
mixed —onEnabled()
Save a log when a plugin is enabled
public
onEnabled(string $handle) : mixed
Parameters
- $handle : string
Return values
mixed —onInstalled()
Save a log when a plugin is installed
public
onInstalled(Event $event) : mixed
Parameters
- $event : Event
Return values
mixed —onSettingsChanged()
Save a log when a plugin settings are saved
public
onSettingsChanged(string $handle, array<string|int, mixed> $dirty) : mixed
Parameters
- $handle : string
- $dirty : array<string|int, mixed>
Return values
mixed —onUninstalled()
Save a log when a plugin is uninstalled
public
onUninstalled(Event $event) : mixed
Parameters
- $event : Event
Return values
mixed —queueHasLogForUid()
Does a log related to an uid and type exists in the queue
public
queueHasLogForUid(string $uid, string $type) : bool
Parameters
- $uid : string
- $type : string
Return values
bool —removeQueuedLogsByUid()
Remove a queued log by uid and type
public
removeQueuedLogsByUid(string $uid, string $type) : mixed
Parameters
- $uid : string
- $type : string
Return values
mixed —saveLogs()
Save all queued logs
public
saveLogs() : mixed
Return values
mixed —startRecording()
Get this recorder to start recording
public
startRecording() : mixed
Return values
mixed —stopRecording()
Get this recorder to stop recording
public
stopRecording() : mixed
Return values
mixed —commitLog()
Commit a log to be saved, log will be added in the queue if $saveNow is false
protected
commitLog(string $type[, array<string|int, mixed> $params = [] ][, bool $saveNow = false ]) : bool
Parameters
- $type : string
- $params : array<string|int, mixed> = []
- $saveNow : bool = false
Return values
bool —getHandler()
Get the handler for a path and a value
protected
getHandler(string $baseName, string $path, array<string|int, mixed> $config, mixed $value) : FieldHandler
Parameters
- $baseName : string
- $path : string
- $config : array<string|int, mixed>
- $value : mixed
Return values
FieldHandler —getPathFieldHandler()
Get the field handler for a path
protected
getPathFieldHandler(string $path, array<string|int, mixed> $config) : string
Parameters
- $path : string
- $config : array<string|int, mixed>
Return values
string —getTrackedFieldNames()
protected
getTrackedFieldNames(array<string|int, mixed> $config) : mixed
Parameters
- $config : array<string|int, mixed>
Tags
Return values
mixed —getTrackedFieldTypings()
Get fields typing, must return an array :
protected
getTrackedFieldTypings(array<string|int, mixed> $config) : array<string|int, mixed>
[ 'field.path' => 'bool' ]
Valid typings are 'string', 'int', 'float' and 'bool'
Parameters
- $config : array<string|int, mixed>
Return values
array<string|int, mixed> —isTypeIgnored()
is a type ignored by the settings
protected
isTypeIgnored(string $type) : bool
Parameters
- $type : string
Return values
bool —shouldSaveLog()
Should a log type be saved
protected
shouldSaveLog(string $type) : bool
Parameters
- $type : string
Return values
bool —typeValue()
Type a value by path
protected
typeValue(array<string|int, mixed> $config, string $path, mixed $value) : mixed
Parameters
- $config : array<string|int, mixed>
- $path : string
- $value : mixed