Example #1
0
<?php

require_once __DIR__ . '/vendor/autoload.php';
use App\Application, App\config\Config, App\config\reader\PhpConfigReader;
try {
    $configReader = new PhpConfigReader(__DIR__ . '/config/main.php');
    $config = new Config($configReader);
    if (!$config->validate()) {
        throw new \Exception($config->getErrorMessage());
    }
    Application::getInstance($config)->run();
} catch (\Exception $e) {
    echo "ERROR\n";
    echo $e->getMessage() . "\n";
}