AsyncPluginsInstallLogger
in package
implements
PluginsInstallLogger
A logger to log plugin installation progress in real time to an option.
Interfaces, Classes and Traits
- PluginsInstallLogger
- A logger used in PluginsHelper::install_plugins to log the installation progress.
Table of Contents
- $option_name : string
- Variable to store logs.
- __construct() : mixed
- Constructor.
- activated() : void
- Change status to activated.
- add_error() : void
- Add an error.
- complete() : void
- Record completed_time.
- get_timeframe() : string
- Returns time frame for a given time in milliseconds.
- install_requested() : void
- Add requested plugin.
- installed() : void
- Add installed plugin.
- get() : false|mixed|void
- Retreive the option.
- get_plugin_track_key() : mixed
- track() : mixed
- update() : bool
- Update the option.
Properties
$option_name
Variable to store logs.
private
string
$option_name
Methods
__construct()
Constructor.
public
__construct(string $option_name) : mixed
Parameters
- $option_name : string
-
option name.
Return values
mixed —activated()
Change status to activated.
public
activated(string $plugin_name) : void
Parameters
- $plugin_name : string
-
plugin name.
Return values
void —add_error()
Add an error.
public
add_error(string $plugin_name[, string|null $error_message = null ]) : void
Parameters
- $plugin_name : string
-
plugin name.
- $error_message : string|null = null
-
error message.
Return values
void —complete()
Record completed_time.
public
complete([array<string|int, mixed> $data = array() ]) : void
Parameters
- $data : array<string|int, mixed> = array()
-
return data from install_plugins().
Return values
void —get_timeframe()
Returns time frame for a given time in milliseconds.
public
get_timeframe(int $timeInMs) : string
Parameters
- $timeInMs : int
-
- time in milliseconds
Return values
string — - Time frame.install_requested()
Add requested plugin.
public
install_requested(string $plugin_name) : void
Parameters
- $plugin_name : string
-
plugin name.
Return values
void —installed()
Add installed plugin.
public
installed(string $plugin_name, int $duration) : void
Parameters
- $plugin_name : string
-
plugin name.
- $duration : int
-
time took to install plugin.
Return values
void —get()
Retreive the option.
private
get() : false|mixed|void
Return values
false|mixed|void —get_plugin_track_key()
private
get_plugin_track_key(mixed $id) : mixed
Parameters
- $id : mixed
Return values
mixed —track()
private
track(mixed $data) : mixed
Parameters
- $data : mixed
Return values
mixed —update()
Update the option.
private
update(array<string|int, mixed> $data) : bool
Parameters
- $data : array<string|int, mixed>
-
New data.