Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

create_debug_log_override()

Description

Create a debug log override for a specified user or globally.

This function sets a debug override that enables debug logging for a specified user
or all users if `$debug_user` is -1. The override is set to expire after a specified
duration in seconds. Any existing override settings are removed before the new values
are inserted.

Parameters

ColumnTypeDefaultDescription
$debug_user int -1 The user ID for whom to enable debug logging (-1 for all users). Default is -1.
$debug_expires int 60 The time in seconds until the debug override expires, starting from the current time. Default is 60 seconds.

Return

void

Location

include/debug_functions.php lines 55 to 62

Definition

 
function create_debug_log_override($debug_user = -1$debug_expires 60)
    {
    
ps_query("DELETE FROM sysvars WHERE name='debug_override_user' OR name='debug_override_expires'",array());
    
$debug_expires += time();
    
ps_query("INSERT INTO sysvars VALUES ('debug_override_user',?), ('debug_override_expires',?)",
    array(
"s",$debug_user,"s",$debug_expires));
    
clear_query_cache("sysvars");
    }

This article was last updated 8th December 2024 08:35 Europe/London time based on the source file dated 13th November 2024 15:50 Europe/London time.