Last updated on Sunday the 16th of January 2011
Common things to look out for when upgrading from Kohana 3.0 to 3.1
(Request $request, Response $response) over just (Request $request)Kohana::exception_handler($e) has been moved to Kohana_Exception::handler($e)save() and check() now have a Validation argument, make sure you update any child classes to ensure you don’t break strict compatibility.$_db_group over $_db$this->request->controller, action, directory are now methods: $this->request->controller(), action(), directory()$this->response->body('content') over $this->request->response = 'content';Http_Exception_400 to Http_Exception_505Valid and Validation. The former houses all the rules and the latter has the logic for checking, messages, etc …filter() no longer exists. Either filter manually or use Arr::map if you need to filter on all values.<?php
// Filtering post values using a lambda function.
Arr::map(function($value)
{
return trim($value);
},
$_POST);
callback() has gone. Instead, rule()'s 2nd argument can take any valid PHP callback. The 3rd argument is an array containing the arguments to pass to the callback.<?php $validation->rule('email', array($this, 'email_available'), array(':validation', ':field'));
array('function' => $params) to array('function', $params).