Categories
PHP

Update Kohana 3.2.x to 3.3.x

So few days ago I was wondering what to do with OC and the version of KO.

At the end I’ve managed to update to 3.3.2. was a bit messy and I do not follow PSR-0 although the autoloader is compatible.

This are the steps I’ve followed

  • Moved 332 to oc/kohana
  • Modified index.php to point to kohana see file.
  • Modified bootstrap.php to use the class classes/Kohana/Core and use auto_load_lowercase see file.
  • Modified classes/koahana.php to overwrite the autoload, so will search for lowercases see file.
  • Modified oc/classes/kohana/exception.php see file.
  • Replaced COUNT(” to replace with DB::expr(‘COUNT(“
  • Class install modified classes/Kohana
  • Removed function count_all() from classes/orm.php (was an old bug fixed on the core of 3.3 by me)
  • Replaced $this->request->redirect( for $this->redirect(
  • Replaced Request::current()->redirect( for HTTP::redirect(
  • Remember redirect throws an exception so may cause errors if you did a redirect inside a try/catch block
  • Replaced Model_Content::get( with Model_Content::get_by_title(
  • Deleted oc/classes/image/gd.php
  • Create /classes/HTTP/Exception.php see here , should load all the theme with the not found message, while all the others just a plain error message, see /classes/HTTP/Exception/404.php
  • Replace throw new HTTP_Exception_XX( for HTTP_Exception::factory(

So far seems to be working great in production and have already moved Open eShop to 3.3.2 also.