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 --------------------------------------------------------
|
|
|
|
|
2009-05-21 20:43:09 +03:00
|
|
|
/**
|
|
|
|
* Set the default time zone.
|
2009-06-14 17:04:50 +03:00
|
|
|
*
|
2010-05-21 00:56:46 +03:00
|
|
|
* @see http://kohanaframework.org/guide/using.configuration
|
2009-05-21 20:43:09 +03:00
|
|
|
* @see http://php.net/timezones
|
|
|
|
*/
|
|
|
|
date_default_timezone_set('America/Chicago');
|
|
|
|
|
2009-11-24 03:20:48 +02:00
|
|
|
/**
|
|
|
|
* Set the default locale.
|
|
|
|
*
|
2010-05-21 00:56:46 +03:00
|
|
|
* @see http://kohanaframework.org/guide/using.configuration
|
2009-11-24 03:20:48 +02:00
|
|
|
* @see http://php.net/setlocale
|
|
|
|
*/
|
|
|
|
setlocale(LC_ALL, 'en_US.utf-8');
|
|
|
|
|
2009-05-20 22:13:02 +03:00
|
|
|
/**
|
|
|
|
* Enable the Kohana auto-loader.
|
2009-06-14 17:04:50 +03:00
|
|
|
*
|
2010-05-21 00:56:46 +03:00
|
|
|
* @see http://kohanaframework.org/guide/using.autoloading
|
2009-05-21 20:43:09 +03:00
|
|
|
* @see http://php.net/spl_autoload_register
|
2009-05-20 22:13:02 +03:00
|
|
|
*/
|
|
|
|
spl_autoload_register(array('Kohana', 'auto_load'));
|
|
|
|
|
2009-10-31 17:47:46 +02:00
|
|
|
/**
|
|
|
|
* Enable the Kohana auto-loader for unserialization.
|
|
|
|
*
|
|
|
|
* @see http://php.net/spl_autoload_call
|
|
|
|
* @see http://php.net/manual/var.configuration.php#unserialize-callback-func
|
|
|
|
*/
|
|
|
|
ini_set('unserialize_callback_func', 'spl_autoload_call');
|
|
|
|
|
2009-07-25 07:23:24 +03:00
|
|
|
//-- Configuration and initialization -----------------------------------------
|
2009-05-20 22:13:02 +03:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Initialize Kohana, setting the default options.
|
2009-06-14 17:04:50 +03:00
|
|
|
*
|
|
|
|
* The following options are available:
|
2009-07-08 01:02:20 +03:00
|
|
|
*
|
|
|
|
* - string base_url path, and optionally domain, of your application NULL
|
|
|
|
* - string index_file name of your index file, usually "index.php" index.php
|
|
|
|
* - string charset internal character set used for input and output utf-8
|
2009-07-26 02:10:52 +03:00
|
|
|
* - string cache_dir set the internal cache directory APPPATH/cache
|
2009-07-08 01:02:20 +03:00
|
|
|
* - boolean errors enable or disable error handling TRUE
|
2009-07-26 02:10:52 +03:00
|
|
|
* - boolean profile enable or disable internal profiling TRUE
|
2009-07-08 01:02:20 +03:00
|
|
|
* - boolean caching enable or disable internal caching FALSE
|
2009-05-20 22:13:02 +03:00
|
|
|
*/
|
2010-05-16 14:27:34 +03:00
|
|
|
Kohana::init(array(
|
|
|
|
'base_url' => '/',
|
|
|
|
'index_file' => FALSE,
|
|
|
|
));
|
2009-03-01 15:43:44 +02:00
|
|
|
|
2009-07-26 02:13:28 +03:00
|
|
|
/**
|
|
|
|
* Attach the file write to logging. Multiple writers are supported.
|
|
|
|
*/
|
|
|
|
Kohana::$log->attach(new Kohana_Log_File(APPPATH.'logs'));
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Attach a file reader to config. Multiple readers are supported.
|
|
|
|
*/
|
|
|
|
Kohana::$config->attach(new Kohana_Config_File);
|
|
|
|
|
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-08-24 22:08:38 +03:00
|
|
|
// 'auth' => MODPATH.'auth', // Basic authentication
|
2010-05-25 15:07:08 +03:00
|
|
|
// 'cache' => MODPATH.'cache', // Caching with multiple backends
|
2009-08-24 22:08:38 +03:00
|
|
|
// 'codebench' => MODPATH.'codebench', // Benchmarking tool
|
2010-05-25 15:07:08 +03:00
|
|
|
// 'database' => MODPATH.'database', // Database access
|
2009-07-03 20:32:25 +03:00
|
|
|
// 'image' => MODPATH.'image', // Image manipulation
|
2009-08-24 22:08:38 +03:00
|
|
|
// 'orm' => MODPATH.'orm', // Object Relationship Mapping
|
2009-07-03 20:32:25 +03:00
|
|
|
// 'pagination' => MODPATH.'pagination', // Paging of results
|
2010-05-25 15:07:08 +03:00
|
|
|
// 'userguide' => MODPATH.'userguide', // User guide and API documentation
|
2009-04-18 00:40:11 +03:00
|
|
|
));
|
|
|
|
|
2009-03-01 15:43:44 +02:00
|
|
|
/**
|
2009-06-14 17:04:50 +03:00
|
|
|
* Set the routes. Each route must have a minimum of a name, a URI and a set of
|
|
|
|
* defaults for the URI.
|
2009-03-01 15:43:44 +02:00
|
|
|
*/
|
2009-04-21 07:33:22 +03:00
|
|
|
Route::set('default', '(<controller>(/<action>(/<id>)))')
|
2009-02-24 09:13:09 +02:00
|
|
|
->defaults(array(
|
|
|
|
'controller' => 'welcome',
|
2009-07-08 01:02:20 +03:00
|
|
|
'action' => 'index',
|
|
|
|
));
|
2009-02-24 09:13:09 +02:00
|
|
|
|
2009-05-20 22:13:02 +03:00
|
|
|
/**
|
2009-08-24 22:08:38 +03:00
|
|
|
* Execute the main request. A source of the URI can be passed, eg: $_SERVER['PATH_INFO'].
|
|
|
|
* If no source is specified, the URI will be automatically detected.
|
2009-05-20 22:13:02 +03:00
|
|
|
*/
|
2009-07-25 07:23:24 +03:00
|
|
|
echo Request::instance()
|
2009-05-22 01:32:18 +03:00
|
|
|
->execute()
|
|
|
|
->send_headers()
|
|
|
|
->response;
|