Beispiel #1
0
 /**
  * @covers Lang::getCurrent
  */
 public function testGetCurrent()
 {
     $this->markTestIncomplete('Not yet implemented.');
     // todo -- implement testGetCurrent
     $result = $this->model->getCurrent();
     $this->assertEquals('todo', $result);
 }
Beispiel #2
0
    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();