-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug.php
More file actions
42 lines (36 loc) · 1.25 KB
/
debug.php
File metadata and controls
42 lines (36 loc) · 1.25 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
<?php
// Debug script for UnicornXMedia
header('Content-Type: text/plain');
echo "UnicornXMedia Debugger\n";
echo "----------------------\n";
$config_file = __DIR__ . '/config.php';
if (file_exists($config_file)) {
echo "[PASS] config.php found.\n";
$config = require $config_file;
$data_dir = dirname($config['json_path']);
if (is_dir($data_dir)) {
echo "[PASS] Data directory found: $data_dir\n";
if (is_writable($data_dir)) {
echo "[PASS] Data directory is WRITABLE.\n";
} else {
echo "[FAIL] Data directory is NOT WRITABLE. Please set permissions to 777.\n";
}
} else {
echo "[FAIL] Data directory NOT FOUND: $data_dir\n";
}
if (file_exists($config['json_path'])) {
echo "[INFO] submissions.json exists.\n";
if (is_writable($config['json_path'])) {
echo "[PASS] submissions.json is WRITABLE.\n";
} else {
echo "[FAIL] submissions.json is NOT WRITABLE.\n";
}
} else {
echo "[INFO] submissions.json does not exist yet.\n";
}
} else {
echo "[FAIL] config.php NOT FOUND at $config_file\n";
}
echo "\nServer User: " . get_current_user() . "\n";
echo "PHP Version: " . phpversion() . "\n";
?>