-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdisable_debug.php
More file actions
41 lines (32 loc) · 1.15 KB
/
disable_debug.php
File metadata and controls
41 lines (32 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/usr/bin/env php
<?php
/**
* Disable debug mode and performance info in Moodle
*/
define('CLI_SCRIPT', true);
require(__DIR__ . '/config.php');
require_once($CFG->libdir.'/clilib.php');
global $DB, $CFG;
echo "Current debug settings:\n";
echo "- debug: " . ($CFG->debug ?? 'not set') . "\n";
echo "- debugdisplay: " . ($CFG->debugdisplay ?? 'not set') . "\n";
echo "- perfdebug: " . ($CFG->perfdebug ?? 'not set') . "\n";
echo "- perfinfo: " . ($CFG->perfinfo ?? 'not set') . "\n\n";
echo "Setting debug to NONE and disabling performance info...\n";
// Set debug to NONE (0)
set_config('debug', 0);
set_config('debugdisplay', 0);
// Disable performance info
set_config('perfdebug', 0);
set_config('perfinfo', 0);
echo "\nNew debug settings:\n";
$debug = get_config('core', 'debug');
$debugdisplay = get_config('core', 'debugdisplay');
$perfdebug = get_config('core', 'perfdebug');
$perfinfo = get_config('core', 'perfinfo');
echo "- debug: $debug (0 = NONE)\n";
echo "- debugdisplay: $debugdisplay\n";
echo "- perfdebug: $perfdebug\n";
echo "- perfinfo: $perfinfo\n";
echo "\nDone! Debug footer should no longer appear.\n";
echo "Refresh any Moodle page to verify.\n";