Repository navigation
Expand file tree
/
Copy pathdebug.php
More file actions
89 lines (77 loc) · 2.42 KB
/
Copy pathdebug.php
File metadata and controls
89 lines (77 loc) · 2.42 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
<?php
echo "=== PHP Debug Information ===\n";
echo "PHP Version: " . phpversion() . "\n";
echo "Current Directory: " . __DIR__ . "\n";
echo "Script Name: " . __FILE__ . "\n\n";
echo "=== File System Check ===\n";
// Check if vendor/autoload.php exists
$autoloadPath = __DIR__ . '/vendor/autoload.php';
if (file_exists($autoloadPath)) {
echo "✓ vendor/autoload.php exists\n";
} else {
echo "✗ vendor/autoload.php NOT found\n";
}
// Check if config/env.php exists
$configPath = __DIR__ . '/config/env.php';
if (file_exists($configPath)) {
echo "✓ config/env.php exists\n";
} else {
echo "✗ config/env.php NOT found\n";
}
// Check if public/index.php exists
$indexPath = __DIR__ . '/public/index.php';
if (file_exists($indexPath)) {
echo "✓ public/index.php exists\n";
} else {
echo "✗ public/index.php NOT found\n";
}
// Check if templates directory exists
$templatesPath = __DIR__ . '/templates';
if (is_dir($templatesPath)) {
echo "✓ templates/ directory exists\n";
} else {
echo "✗ templates/ directory NOT found\n";
}
echo "\n=== Directory Listing ===\n";
$files = scandir(__DIR__);
foreach ($files as $file) {
if ($file !== '.' && $file !== '..') {
echo "- $file\n";
}
}
echo "\n=== Public Directory Listing ===\n";
if (is_dir(__DIR__ . '/public')) {
$publicFiles = scandir(__DIR__ . '/public');
foreach ($publicFiles as $file) {
if ($file !== '.' && $file !== '..') {
echo "- public/$file\n";
}
}
}
echo "\n=== Attempting to Load Config ===\n";
try {
if (file_exists($configPath)) {
$config = require $configPath;
echo "✓ Config loaded successfully\n";
echo "App URL: " . ($config['app']['url'] ?? 'not set') . "\n";
echo "Environment: " . ($config['app']['env'] ?? 'not set') . "\n";
}
} catch (Exception $e) {
echo "✗ Config load failed: " . $e->getMessage() . "\n";
}
echo "\n=== Testing Autoloader ===\n";
try {
if (file_exists($autoloadPath)) {
require $autoloadPath;
echo "✓ Autoloader loaded successfully\n";
// Test if classes can be loaded
if (class_exists('Slim\Factory\AppFactory')) {
echo "✓ Slim Framework classes available\n";
} else {
echo "✗ Slim Framework classes NOT available\n";
}
}
} catch (Exception $e) {
echo "✗ Autoloader failed: " . $e->getMessage() . "\n";
}
echo "\n=== End Debug ===\n";