Example #1
0
                echo sprintf("[%s] %s\n", $error['property'], $error['message']);
            }
            exit;
        }
    }
}
// Start loading config files
try {
    $config = Configurator::load($config_files);
} catch (Exception $e) {
    // TODO: show nice error page
    echo $e->getMessage();
    exit;
}
// Pass on the configuration
app\core\Config::setConfig($config);
// General getallheaders function
if (!function_exists("getallheaders")) {
    function getallheaders()
    {
        foreach ($_SERVER as $name => $value) {
            if (substr($name, 0, 5) == "HTTP_") {
                $headers[str_replace(" ", "-", ucwords(strtolower(str_replace("_", " ", substr($name, 5)))))] = $value;
            } else {
                if ($name == "CONTENT_TYPE") {
                    $headers["Content-Type"] = $value;
                } else {
                    if ($name == "CONTENT_LENGTH") {
                        $headers["Content-Length"] = $value;
                    }
                }