Documentation

Log extends Instanceable
in package

Log handling class.

Tags
author

Timothy Gibbons

version
2.0.0-pr13
license

MIT

Table of Contents

Properties

$_actions  : array<string|int, mixed>
$_db  : DB
$_instances  : array<class-string, static>
Stores instances of classes with their class name as key.

Methods

__construct()  : mixed
Action()  : string|array<string|int, mixed>
Get an action from the Action array.
getInstance()  : static
Get or make an instance of the class this was called on.
log()  : bool
Logs an action.

Properties

$_actions

private static array<string|int, mixed> $_actions = ['admin' => ['login' => 'acp_login', 'core' => ['general' => 'acp_core_update', 'avatar' => 'acp_avatar_update', 'profile' => ['add' => 'acp_core_profile_add', 'delete' => 'acp_core_profile_delete', 'update' => 'acp_core_profile_update'], 'maintenance' => ['enable' => 'acp_maintenance_enable', 'disable' => 'acp_maintenance_disable', 'update' => 'acp_maintenance_update'], 'email' => ['update' => 'acp_email_update', 'test' => 'acp_email_test', 'mass_message' => 'acp_email_mass_message'], 'nav' => 'admin_nav_update', 'reaction' => ['update' => 'acp_reaction_update', 'add' => 'acp_reaction_add', 'delete' => 'acp_reaction_remove'], 'social' => 'acp_social_update', 'term' => 'acp_term_update', 'queue' => ['cancel_task' => 'acp_cancel_task', 'requeue_task' => 'acp_requeue_task']], 'api' => ['change' => 'acp_api_change'], 'group' => ['create' => 'acp_group_create', 'update' => 'acp_group_update', 'delete' => 'acp_group_delte'], 'bgimage' => ['submit' => 'acp_bgimage_submit', 'reset' => 'acp_bgimage_reset'], 'mc' => ['update' => 'acp_mc_update'], 'authme' => ['update' => 'acp_authme_update'], 'server' => ['update' => 'acp_server_update', 'delete' => 'acp_server_delete', 'add' => 'acp_server_add', 'default' => 'acp_server_default_update', 'banner' => 'acp_server_banner_update'], 'module' => ['install' => 'acp_module_install', 'enable' => 'acp_module_enable', 'disable' => 'acp_module_disable'], 'pages' => ['new' => 'acp_pages_new', 'edit' => 'acp_pages_edit', 'delete' => 'acp_pages_delete'], 'template' => ['update' => 'acp_template_update', 'install' => 'acp_template_install', 'default' => 'acp_template_default_change', 'activate' => 'acp_template_activate', 'deactivate' => 'acp_template_deactivate', 'delete' => 'acp_template_delete'], 'user' => ['create' => 'acp_user_add', 'delete' => 'acp_user_remove', 'update' => 'acp_user_update', 'register' => 'acp_register_change'], 'widget' => ['update' => 'acp_widget_update']], 'mod' => ['iplookup' => 'mcp_ip_lookup', 'punishment' => ['create' => 'mcp_punishment_create', 'revoke' => 'mcp_punishment_revoke'], 'report' => ['comment' => 'mcp_report_comment', 'open' => 'mcp_report_open', 'close' => 'mcp_report_close']], 'user' => ['login' => 'user_login', 'logout' => 'user_logout', 'register' => 'user_register', 'acknowledge' => 'user_acknowledge', 'ucp' => ['update' => 'ucp_update'], 'tfa' => ['key' => ['sent' => 'tfa_key_sent']]], 'forums' => ['topic' => ['delete' => 'forums_topic_delete', 'edit' => 'forums_topic_edit', 'lock' => 'forums_topic_lock', 'create' => 'forums_topic_create', 'search' => 'forums_topic_search', 'stick' => 'forums_topic_stick', 'view' => 'forums_topic_view', 'move' => 'forums_topic_move', 'merge' => 'forums_topic_merge', 'react' => 'forums_topic_react', 'unstick' => 'forum_topic_unstick'], 'post' => ['delete' => 'forums_post_delete', 'edit' => 'forums_post_edit', 'lock' => 'forums_post_lock', 'create' => 'forums_post_create', 'search' => 'forums_post_search', 'stick' => 'forums_post_stick', 'unstick' => 'forum_topic_unstick', 'view' => 'forums_post_view', 'move' => 'forums_post_move', 'merge' => 'forums_post_merge', 'react' => 'forums_post_react'], 'delete' => 'forum_delete', 'edit' => 'forum_edit', 'lock' => 'forum_lock', 'create' => 'forum_create', 'search' => 'forum_search', 'stick' => 'forum_stick', 'view' => 'forum_view', 'move' => 'forum_move', 'merge' => 'forum_merge', 'react' => 'forum_react'], 'misc' => ['report' => 'report', 'curl_error' => 'curl_error'], 'api' => [], 'discord' => ['bot_request_failed' => 'discord_bot_request_failed', 'role_set' => 'discord_role_set'], 'mc_group_sync' => ['role_set' => 'mc_group_sync_set']]

Mapping of log Actions to their language key

$_instances

Stores instances of classes with their class name as key.

private static array<class-string, static> $_instances = []

Methods

__construct()

public __construct() : mixed

Action()

Get an action from the Action array.

public static Action(string $path) : string|array<string|int, mixed>
Parameters
$path : string

The path to the action.

Return values
string|array<string|int, mixed>

The keys

getInstance()

Get or make an instance of the class this was called on.

public final static getInstance() : static
Return values
static

Instance of the class this was called on.

log()

Logs an action.

public log(string $action[, string $info = '' ][, int|null $user = null ]) : bool
Parameters
$action : string

The action being logged

$info : string = ''

Some more information about what the action is about

$user : int|null = null

The User ID who is doing the action

Return values
bool

Return true or false if inserted into the database.


        
On this page

Search results