<?php
declare(strict_types=1);

header('Content-Type: application/json; charset=utf-8');

$autoload = __DIR__ . '/../vendor/autoload.php';
$autoloadExists = is_file($autoload);
if ($autoloadExists) {
    require_once $autoload;
}

echo json_encode([
    'php_version' => PHP_VERSION,
    'autoload' => $autoloadExists,
    'pdfparser' => class_exists(\Smalot\PdfParser\Parser::class),
    'extensions' => [
        'zip' => class_exists('ZipArchive'),
        'zlib' => extension_loaded('zlib'),
        'iconv' => extension_loaded('iconv'),
        'xml' => extension_loaded('xml'),
        'dom' => extension_loaded('dom'),
        'simplexml' => extension_loaded('SimpleXML'),
        'xmlreader' => extension_loaded('xmlreader'),
        'xmlwriter' => extension_loaded('xmlwriter'),
    ],
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
