getContainer(); $config = Config::getInstance(); if ($config->uglyUrls) { $container['router'] = new UglyRouter(); } $container['view'] = ViewFactory::create($container); if (!class_exists('Locale')) { die('You need to install the intl extension for PHP.'); } $container['locale'] = new LocaleManager($_COOKIE); $app->add(new LocaleMiddleware($container)); $controller = new FrontController($container, null, $_COOKIE); $container['errorHandler'] = [$controller, 'error']; $app->get( '/', [$controller, 'index'] )->setName('index'); $app->get( '/extractors', [$controller, 'extractors'] )->setName('extractors'); $app->any( '/video', [$controller, 'video'] )->setName('video'); $app->get( '/redirect', [$controller, 'redirect'] )->setName('redirect'); $app->get( '/locale/{locale}', [$controller, 'locale'] )->setName('locale'); try { $app->run(); } catch (SmartyException $e) { die('Smarty could not compile the template file: '.$e->getMessage()); }