-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev-platform_startup.inc
More file actions
47 lines (40 loc) · 1.45 KB
/
Copy pathdev-platform_startup.inc
File metadata and controls
47 lines (40 loc) · 1.45 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
42
43
44
45
46
47
<?PHP
global $__module, $db, $redis, $redis_write, $session, $fs_root, $url_root, $log_level, $debug;
if (isset($debug)) {
if ($debug['master_disable']) {
header("HTTP/1.0 500 $__module: $debug[master_disable]");
echo "500 / $__module: $debug[master_disable]\n";
exit;
}
if ($debug['total_debug']) {
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
} // Assume that PHP has reporting right for production
if ($debug['enable_redis_debug']) {
require_once($fs_root."/fwlib/tsredis.inc");
connect_redis();
$dbg=$redis->smembers('debug_session.'.$session);
if ($dbg) {
if (in_array('master_disable', $dbg)) {
header("HTTP/1.0 500 $__module: $debug[master_disable]");
echo "500 / $__module: $debug[master_disable]\n";
exit;
}
if (in_array('total_debug', $dbg)) {
error_reporting(E_ALL);
ini_set('display_errors', TRUE);
ini_set('display_startup_errors', TRUE);
} // Assume that PHP has reporting right for production
if (in_array('devel', $dbg)) $debug['devel_prefix']='dev-';
if (in_array('lib-devel', $dbg)) $debug['lib_devel_prefix']='dev-';
if (in_array('brutlog_requests', $dbg)) $debug['brutlog_requests']=TRUE;
}
}
if ($debug['brutlog_requests']) {
$brutlog=var_export($_REQUEST, true);
$brutlog=str_replace("\n", " ", $brutlog);
file_put_contents( "/tmp/brutlog-$__module.log", $_SERVER['REMOTE_ADDR'].": $brutlog\n", FILE_APPEND);
}
}
?>