Exemplo n.º 1
0
Kohana::init(array('base_url' => '/', 'caching' => TRUE, 'profile' => FALSE, 'index_file' => FALSE));
/**
 * Attach the file write to logging. Multiple writers are supported.
 */
Kohana::$log->attach(new Log_File(APPPATH . 'logs'));
/**
 * Attach a file reader to config. Multiple readers are supported.
 */
Kohana::$config->attach(new Config_File());
/**
 * Enable modules. Modules are referenced by a relative or absolute path.
 */
Kohana::modules(array('auth' => MODPATH . 'auth', 'cache' => MODPATH . 'cache', 'codebench' => MODPATH . 'codebench', 'database' => MODPATH . 'database', 'image' => MODPATH . 'image', 'minion' => MODPATH . 'minion', 'unittest' => MODPATH . 'unittest', 'userguide' => MODPATH . 'userguide', 'cms' => MODPATH . 'cms', 'tbl' => MODPATH . 'tbl', 'tpl' => MODPATH . 'tpl', 'pgn' => MODPATH . 'pgn', 'notice' => MODPATH . 'notice', 'email' => MODPATH . 'email', 'mysqli' => MODPATH . 'mysqli'));
/**
 * Get settings
 */
// Kohx
$settings = (object) Tbl::factory('settings')->read()->as_array('key', 'value');
// Set timezoon
date_default_timezone_set($settings->timezoon);
Cookie::$salt = $settings->cooki_salt;
Cookie::$expiration = Cms_Helper::sec($settings->cooki_expiration);
Session::$default = 'database';
/**
 * Set the routes. Each route must have a minimum of a name, a URI and a set of
 * defaults for the URI.
 */
// Kohx
Cms_Route::write();
// Default
Route::set('default', '(<controller>(/<action>(/<id>)))')->defaults(array('controller' => 'home', 'action' => 'index'));
Exemplo n.º 2
0
<?php

defined('SYSPATH') or die('No direct access allowed.');
$settings = (object) Tbl::factory('settings')->or_where('key', '=', 'auth_hash_method')->or_where('key', '=', 'auth_hash_key')->or_where('key', '=', 'auth_lifetime')->or_where('key', '=', 'auth_session_key')->read()->as_array('key', 'value');
return array('driver' => 'Database', 'hash_method' => $settings->auth_hash_method, 'hash_key' => $settings->auth_hash_key, 'lifetime' => Cms_Helper::sec($settings->auth_lifetime), 'session_type' => Session::$default, 'session_key' => $settings->auth_session_key);