$locale = $result[0]; include './i18n/lang.' . $result[0] . '.php'; extract($MESSAGES, EXTR_PREFIX_ALL | EXTR_OVERWRITE, "message"); //echo $locale; } } } $page = NULL; if (isValidGet("q")) { header("Location: /"); } if (isValidGet("locale")) { $locale = $_GET["locale"]; } if (isValidGet("COUNTRY_id")) { setCountry($_GET["COUNTRY_id"]); } if (isValidGet("PROPERTY_id")) { $PROPERTY_id = $_GET["PROPERTY_id"]; } if (isValidGet("OFFER_id")) { $OFFER_id = $_GET["OFFER_id"]; } if (isValidGet("page")) { $page = $_GET["page"]; } include './i18n/lang.' . $locale . '.php'; extract($MESSAGES, EXTR_PREFIX_ALL | EXTR_OVERWRITE, "message"); /* * //$mysqli = new mysqli("localhost", "valutext", "valutextreversehorse", "valutext"); //if ($mysqli->connect_errno) {
$app->get('/' . $locale, function () use($app, $aInit, $locale) { _setLocale($aInit, $locale); setLanguage($aInit, substr($locale, 0, 2)); // reload the page with the last loaded page require_once "libs/contentManager.php"; $oRequest = new stdClass(); $oRequest->request = $aInit['session']->last_request; $aInit['session']->request = $oRequest; $html = _getPage($aInit, $oRequest->request); echo $html; })->setName('/' . $locale); } $countries = $aInit['memcache']->get(APP_ID . '_countries'); foreach ($countries as $country) { $app->get('/' . $country, function () use($app, $aInit, $country) { setCountry($aInit, $country); // reload the page with the last loaded page require_once "libs/contentManager.php"; $oRequest = new stdClass(); $oRequest->request = $aInit['session']->last_request; $aInit['session']->request = $oRequest; $html = _getPage($aInit, $oRequest->request); echo $html; })->setName('/' . $country); } } $app->get('/command/:command', function ($command) use($aInit) { switch ($command) { case 'mc-reset-startup-tables': clearStartupTables($aInit); break;