<?php
declare(strict_types=1);

echo "EasyChair System Check\n";
echo "======================\n";

$checks = [
    'PHP >= 8.1' => version_compare(PHP_VERSION, '8.1.0', '>='),
    'pdo_mysql' => extension_loaded('pdo_mysql'),
    'zip' => extension_loaded('zip'),
    'mbstring' => extension_loaded('mbstring'),
    'storage dir exists' => is_dir('/var/www/html/easychair/storage'),
    'storage dir writable' => is_writable('/var/www/html/easychair/storage'),
    'public index exists' => is_file('/var/www/html/easychair/public/index.php'),
    'routes file exists' => is_file('/var/www/html/easychair/config/routes.php'),
];

foreach ($checks as $label => $ok) {
    echo str_pad($label, 28) . ': ' . ($ok ? "OK" : "FAIL") . "\n";
}
