<?php

use App\Kernel;

require_once dirname(__DIR__).'/vendor/autoload_runtime.php';

if (array_key_exists('HTTP_X_ORIGINAL_FORWARDED_FOR', $_SERVER)) {
    $_SERVER['HTTP_X_FORWARDED_PROTO'] = $_SERVER['HTTP_X_ORIGINAL_FORWARDED_FOR'];
}

return function (array $context) {
    return new Kernel($context['APP_ENV'], (bool) $context['APP_DEBUG']);
};
