^Status|Draft| ====== 2.1 to 2.2 Upgrading ====== ===== Core ===== All functionality from the ''Config'' and ''Log'' classes has moved to the core ''Kohana'' class. See [[core:kohana|Kohana]] Replace these in your code: * ''Config::item'' with ''Kohana::config'' * ''Config::set'' with ''Kohana::config_set'' * ''Config::load'' with ''Kohana::config_load'' * ''Config::clear'' with ''Kohana::config_clear'' * ''Log::add'' with ''Kohana::log'' * ''Log::write'' with ''Kohana::log_save'' * ''Log::directory'' with ''Kohana::log_directory'' ===== Configuration ===== * Changes to config/config.php: * ''site_domain'' - Changed. Defaults to ''kohana/'' You may need to change this to a full domain ''localhost/kohana/'' * ''internal_cache'' - New. Defaults is ''FALSE'' * ''enable_hooks'' - New. Default is ''FALSE'' Moved from ''config/hooks.php'' * ''log_threshold'' - New. Default is ''1'' Moved from ''config/log.php'' * ''log_directory'' - New. Default is ''APPPATH.logs'' Moved from ''config/log.php'' * ''preload'' - Removed. You need to manually instance any libraries you had listed. * Changes to config/cookie.php: * ''prefix'' - Removed. * Changes to config/session.php: * ''storage'' - Changed. You need to pass parameters for the ''database'' and ''cache'' drivers. See [[libraries:session|Session]] * Changes to config/database.php: * ''connection'' - Changed. Parameters are passed as an array with discrete entries. The old ''DSN'' style may still be used. * ''escape'' - New. Default is ''TRUE'' Switch query builder automatic escaping on or off. * Changes to config/routes.php: * ''_allowed'' - Removed. * Shortcuts are removed, use a regular expression. See [[general:routing|Routing]] Note1: Config files ''config/log.php'' and ''config/hooks.php'' are removed. Now configured in core ''config'' ===== Controllers ===== ''media'' controller has been removed. Special Methods ''_default'' and ''_remap'' are replace by ''_ _call($method, $arguments)'' see [[general:controllers|Controllers]] By default, a ''404'' error will be triggered if a non-existent controller method is called, and ''_ _call'' is defined. You may override this behaviour in your method. To simulate ''_remap'' The _call method should be the only method in the controller. ===== Libraries ===== ''Loader'' library has been removed. ''$this->load('something')'' syntax is obsolete and invalid. Libraries and models must now be created using the following syntax: ''$example = new Example();'' and ''$example = new Example_Model();'' Where possible and applicable, use Factories to instance libraries, and reference library objects via their instance: * ''$template = View::factory('admin')->set('title', $title')->render();'' * ''$myname = Session::instance()->get('myname')'' ==== Library Changes ==== * Pagination - ''create_links()'' method has been renamed to ''render()'' * Validation - Completely new implementation, new docs in progress, for now see http://forum.kohanaphp.com/comments.php?DiscussionID=872&page=1#Item_0 * ORM - A new implementation, new docs in progress.