<?php

declare(strict_types=1);

require_once __DIR__ . '/../src/config.php';
require_once __DIR__ . '/../lib/crest/crest.php';

header('Content-Type: text/html; charset=utf-8');

try {
    $result = CRest::installApp();
    echo '<pre>';
    print_r($result);
    echo '</pre>';
} catch (Throwable $exception) {
    http_response_code(500);
    echo '<pre>Install failed: ' . htmlspecialchars($exception->getMessage(), ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8') . '</pre>';
}
