2009-02-24 09:13:09 +02:00
|
|
|
<?php defined('SYSPATH') or die('No direct script access.');
|
|
|
|
|
2009-05-20 22:13:02 +03:00
|
|
|
//-- Environment setup --------------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable the Kohana auto-loader.
|
|
|
|
*/
|
|
|
|
spl_autoload_register(array('Kohana', 'auto_load'));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Enable Kohana exception handling, adds stack traces and error source.
|
|
|
|
*/
|
|
|
|
set_exception_handler(array('Kohana', 'exception_handler'));
|
|
|
|
|
2009-03-01 15:43:44 +02:00
|
|
|
/**
|
2009-05-20 22:13:02 +03:00
|
|
|
* Enable Kohana error handling, converts all PHP errors to exceptions.
|
2009-03-01 15:43:44 +02:00
|
|
|
*/
|
2009-05-20 22:13:02 +03:00
|
|
|
set_error_handler(array('Kohana', 'error_handler'));
|
|
|
|
|
|
|
|
//-- Kohana configuration -----------------------------------------------------
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize Kohana, setting the default options.
|
|
|
|
*/
|
|
|
|
Kohana::init(array('charset' => 'utf-8', 'base_url' => '/ko3/index.php/'));
|
2009-03-01 15:43:44 +02:00
|
|
|
|
2009-02-24 09:13:09 +02:00
|
|
|
/**
|
2009-05-20 22:13:02 +03:00
|
|
|
* Enable modules. Modules are referenced by a relative or absolute path.
|
2009-02-24 09:13:09 +02:00
|
|
|
*/
|
|
|
|
Kohana::modules(array(
|
2009-04-18 00:40:11 +03:00
|
|
|
// 'orm' => MODPATH.'orm',
|
2009-05-20 22:13:02 +03:00
|
|
|
'database' => MODPATH.'database',
|
2009-04-18 00:40:11 +03:00
|
|
|
'todoist' => MODPATH.'todoist',
|
|
|
|
));
|
|
|
|
|
|
|
|
/**
|
2009-05-20 22:13:02 +03:00
|
|
|
* Attach the file write to logging. Any Kohana_Log object can be attached,
|
|
|
|
* and multiple writers are supported.
|
2009-04-18 00:40:11 +03:00
|
|
|
*/
|
|
|
|
Kohana::$log->attach(new Kohana_Log_File(APPPATH.'logs'));
|
2009-02-24 09:13:09 +02:00
|
|
|
|
|
|
|
/**
|
2009-03-01 15:43:44 +02:00
|
|
|
* Set the language to use for translating.
|
2009-02-24 09:13:09 +02:00
|
|
|
*/
|
2009-03-01 15:43:44 +02:00
|
|
|
i18n::$lang = 'en_US';
|
2009-02-24 09:13:09 +02:00
|
|
|
|
2009-05-20 22:13:02 +03:00
|
|
|
//-- Routing and execution ----------------------------------------------------
|
|
|
|
|
2009-03-01 15:43:44 +02:00
|
|
|
/**
|
|
|
|
* Set the routes.
|
|
|
|
*/
|
2009-04-21 07:33:22 +03:00
|
|
|
|
|
|
|
Route::set('test', 'test/(<controller>(/<action>))')
|
|
|
|
->defaults(array(
|
|
|
|
'directory' => 'test',
|
|
|
|
'controller' => 'list',
|
|
|
|
'action' => 'index'));
|
|
|
|
|
|
|
|
Route::set('default', '(<controller>(/<action>(/<id>)))')
|
2009-02-24 09:13:09 +02:00
|
|
|
->defaults(array(
|
|
|
|
'controller' => 'welcome',
|
|
|
|
'action' => 'index',
|
|
|
|
'id' => NULL));
|
|
|
|
|
2009-05-20 22:13:02 +03:00
|
|
|
/**
|
|
|
|
* Execute the main request using PATH_INFO. If no URI source is specified,
|
|
|
|
* the URI will be automatically detected.
|
|
|
|
*
|
|
|
|
* To return the output of the request instead of displaying it, specify
|
|
|
|
* TRUE for execute().
|
|
|
|
*/
|
|
|
|
Request::instance($_SERVER['PATH_INFO'])
|
|
|
|
->execute(FALSE);
|