Attach a file reader to Kohana::$config in bootstrap

This commit is contained in:
Woody Gilk 2009-07-24 23:23:24 -05:00
parent 17a30537c8
commit a0370c628e

View file

@ -27,7 +27,7 @@ date_default_timezone_set('America/Chicago');
*/ */
spl_autoload_register(array('Kohana', 'auto_load')); spl_autoload_register(array('Kohana', 'auto_load'));
//-- Kohana configuration ----------------------------------------------------- //-- Configuration and initialization -----------------------------------------
/** /**
* Initialize Kohana, setting the default options. * Initialize Kohana, setting the default options.
@ -59,11 +59,15 @@ Kohana::modules(array(
)); ));
/** /**
* Attach the file write to logging. Any Kohana_Log object can be attached, * Attach the file write to logging. Multiple writers are supported.
* and multiple writers are supported.
*/ */
Kohana::$log->attach(new Kohana_Log_File(APPPATH.'logs')); 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);
/** /**
* Set the routes. Each route must have a minimum of a name, a URI and a set of * Set the routes. Each route must have a minimum of a name, a URI and a set of
* defaults for the URI. * defaults for the URI.
@ -78,7 +82,7 @@ Route::set('default', '(<controller>(/<action>(/<id>)))')
* Execute the main request using PATH_INFO. If no URI source is specified, * Execute the main request using PATH_INFO. If no URI source is specified,
* the URI will be automatically detected. * the URI will be automatically detected.
*/ */
echo Request::instance($_SERVER['PATH_INFO']) echo Request::instance()
->execute() ->execute()
->send_headers() ->send_headers()
->response; ->response;