/** * @covers Lang::getDefault * @expectedException Model\AppException */ public function testGetDefaultThrowsException() { $this->markTestIncomplete('Not yet implemented.'); // todo -- implement testGetDefaultThrowsException $this->model->getDefault(); }
header('HTTP/1.1 301 Moved Permanently'); header('Location: https://' . str_replace('www.', '', $_SERVER['HTTP_HOST']) . $_SERVER['REQUEST_URI']); exit; } require '../app/bootstrap.php'; use Model\Config; use Model\StuartMcLeanWebsite; use Model\Lang; use Model\AppException; use Model\Monologger; Config::addConfigFromPath(__DIR__ . '/../app/Config/config_default.php'); Config::addConfigFromPath(__DIR__ . '/../app/Config/config_local.php'); $logger = new Monologger('exception_log'); try { $app = new StuartMcLeanWebsite(Config::getParam(Config::SLIM)); $app->addLogger($logger); $lang = new Lang(Config::getParam(Config::LN)); $lang->detectLang($app); } catch (AppException $e) { $logger->addError($e); if (Config::getParam(Config::SLIM)['debug']) { die($e); } } // todo:: redirect to same url in different language if (!$lang->isInUrl()) { $app->redirect('/' . $lang->getDefault() . $app->getUri(), 301); } $ln = $lang->getCurrent(); Config::setLn($ln); $app->setupRouting()->run();