Example #1
0
 public function session()
 {
     $this->addPackage('Session');
     if (!$this->session) {
         $args = Kurogo::getSiteSection('authentication');
         //default session class
         $controllerClass = 'SessionFiles';
         //maintain previous config compatibility
         if (isset($args['AUTHENTICATION_USE_SESSION_DB']) && $args['AUTHENTICATION_USE_SESSION_DB']) {
             $controllerClass = 'SessionDB';
         }
         if (isset($args['AUTHENTICATION_SESSION_CLASS'])) {
             $controllerClass = $args['AUTHENTICATION_SESSION_CLASS'];
         }
         $this->session = Session::factory($controllerClass, $args);
     }
     return $this->session;
 }
Example #2
0
define('SITE_GEARS', SITE . DS . GEARS_FOLDER);
$cogear->config = new Config(SITE . DS . 'settings' . EXT);
define('DEVELOPMENT', $cogear->config->development);
$folder = basename(ROOT);
if (!in_array($folder, array($host, 'www', 'public_html', 'htdocs', SITE))) {
    define('SUBDIR', $folder);
    $host .= '/' . SUBDIR;
}
if (($port = $cogear->request->get('SERVER_PORT')) != 80) {
    $host .= ':' . $port;
}
define('SITE_URL', $host);
// Define uploads folder
defined('UPLOADS') or define('UPLOADS', SITE . DS . 'uploads');
// Set caches
$cogear->system_cache = new Cache(array('adapter' => 'Cache_Adapter_File', 'path' => SITE . DS . 'cache' . DS . 'system', 'enabled' => !DEVELOPMENT));
$cogear->cache = $cogear->config->cache ? new Cache($cogear->config->cache) : $cogear->system_cache;
if (!($options = $cogear->config->cookies)) {
    $options = array('name' => 'session', 'cookie_domain' => '.' . SITE_URL);
}
$cogear->router = new Router();
$cogear->assets = new Harvester();
$cogear->response = new Response();
$cogear->session = Session::factory('session', $options);
// Load current site settings if file exists
$cogear->config->load(SITE . DS . 'config' . EXT);
// Load gears
$cogear->loadGears();
event('ignite');
event('done');
event('exit');