<?php
/**
 * Minimal Test - No dependencies
 */

echo "<h1>Minimal System Test</h1>";

echo "<h2>Server Information</h2>";
echo "<pre>";
echo "Document Root: " . $_SERVER['DOCUMENT_ROOT'] . "\n";
echo "Script Path: " . __DIR__ . "\n";
echo "PHP Version: " . phpversion() . "\n";
echo "Server Software: " . $_SERVER['SERVER_SOFTWARE'] . "\n";
echo "</pre>";

echo "<h2>Directory Structure</h2>";
echo "<pre>";
$check_dirs = [
    'config' => is_dir(__DIR__ . '/config'),
    'config/config.php' => file_exists(__DIR__ . '/config/config.php'),
    'config/database.php' => file_exists(__DIR__ . '/config/database.php'),
    'public' => is_dir(__DIR__ . '/public'),
    'public/dashboard.php' => file_exists(__DIR__ . '/public/dashboard.php'),
    'uploads' => is_dir(__DIR__ . '/uploads'),
    'logs' => is_dir(__DIR__ . '/logs'),
];

foreach ($check_dirs as $name => $exists) {
    echo $name . ": " . ($exists ? "✅ Found" : "❌ Not Found") . "\n";
}
echo "</pre>";

echo "<h2>Permissions</h2>";
echo "<pre>";
foreach (['config', 'public', 'uploads', 'logs'] as $dir) {
    $path = __DIR__ . '/' . $dir;
    if (is_dir($path)) {
        echo $dir . ": " . substr(sprintf('%o', fileperms($path)), -4) . "\n";
    }
}
echo "</pre>";