<?php
header('Content-Type: application/json');
$info = [
    '__DIR__' => __DIR__,
    'config_exists' => file_exists(__DIR__ . '/../config.php'),
    'config_path' => __DIR__ . '/../config.php',
    'php_version' => PHP_VERSION,
];
// Try to include config
if (file_exists(__DIR__ . '/../config.php')) {
    try {
        require_once __DIR__ . '/../config.php';
        $info['config_loaded'] = true;
        $info['getDB_exists'] = function_exists('getDB');
        $info['auth_exists'] = function_exists('auth');
    } catch (Throwable $e) {
        $info['config_error'] = $e->getMessage();
    }
}
echo json_encode($info);
