Пример #1
0
EpiCache::employ($configObj->get('epi')->cache);
$sessionParams = array($configObj->get('epi')->session);
if ($configObj->get('epiSessionParams')) {
    $sessionParams = array_merge($sessionParams, (array) $configObj->get('epiSessionParams'));
    // for TLDs we need to override the cookie domain if specified
    if (isset($sessionParams['domain']) && stristr($_SERVER['HTTP_HOST'], $sessionParams['domain']) === false) {
        $sessionParams['domain'] = $_SERVER['HTTP_HOST'];
    }
    $sessionParams = array_values($sessionParams);
    // reset keys
}
EpiSession::employ($sessionParams);
getSession();
// load theme after everything is initialized
// this initializes user which extends BaseModel and gets session, config and cache objects
$userConfigObj->loadTheme();
// determine if this is a login endpoint
$loginEndpoint = $assetEndpoint = false;
if (isset($_GET['__route__']) && preg_match('#/user/(.*)(login|logout)#', $_GET['__route__'])) {
    $loginEndpoint = true;
}
if (isset($_GET['__route__']) && preg_match('#^/assets#', $_GET['__route__'])) {
    $assetEndpoint = true;
}
// determine if this is a setup endpoint
$runSetup = false;
if ($hasConfig && isset($_SERVER['REQUEST_URI']) && strpos($_SERVER['REQUEST_URI'], '/setup') !== false && isset($_GET['edit'])) {
    $runSetup = true;
}
// if the config file exists and we're not running the setup, proceed as normal
if ($hasConfig && !$runSetup) {