public static function employ() { if (func_num_args() === 1) { self::$employ = func_get_arg(0); } return self::$employ; }
<?php date_default_timezone_set('America/Los_Angeles'); $basePath = dirname(dirname(__FILE__)); $libraryPath = sprintf('%s/libraries', $basePath); $epiPath = sprintf('%s/epi', $libraryPath); require sprintf('%s/Epi.php', $epiPath); Epi::setPath('base', $epiPath); Epi::setPath('view', sprintf('%s/templates', $basePath)); Epi::setSetting('exceptions', true); Epi::init('api', 'cache', 'config', 'logger', 'route', 'session', 'template', 'database'); EpiSession::employ(EpiSession::PHP); require sprintf('%s/initialize.php', $libraryPath); getRoute()->run();
// loads configs and dependencies $userConfigObj = new UserConfig(); $hasConfig = $userConfigObj->load(); $configObj = getConfig(); 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'])) {