Read the latest web development and design tips at Fred Wu's new blog! :-)
Poke me on GitHub

Posts Tagged ‘Kohana’

Authlite 2.0 for Kohana 3.0 Alpha Testing

If you are using Kohana 2.x, please use Authlite 1.x, otherwise, you are welcome to check out the new code tailored for Kohana 3.0.

Please check out the code on Github.

So far I’ve only spent a little bit of time to make it work on Kohana 3.0, but I will be addressing some known issues and adding more features in the next few days. :)

Related posts

Using Zend Framework 1.8+ with Kohana

Even though the method outlined in my previous post would still work, I thought I’d post a cleaner one to handle the auto-load of Zend Framework classes in Kohana.

The code works with Zend Framework 1.8+, where a new Autoloader class has been introduced.

You can put the code in an appropriate place in your application, it could be in the base controller, or if you’re using Kohana 3.0, in the bootstrap file.

You now no longer need to manually ‘include/require’ Zend Framework files. :)

if ($path = Kohana::find_file('vendors', 'Zend/Loader'))
{
	ini_set('include_path',
	ini_get('include_path').PATH_SEPARATOR.dirname(dirname($path)));

	require_once 'Zend/Loader/Autoloader.php';
	Zend_Loader_Autoloader::getInstance();
}

Related posts

Yii Kohana Bridge updated: full Kohana flavour now added!

I have just pushed some updates to the Git repository.

The entire Kohana distribution is now included. The bridging class is now renamed to ‘Kbridge’.

Not all helpers and libraries will work at the moment, especially the ones that reference Kohana core classes. I am however planning to bridge the core classes and configuration files for tighter integration.

If you have any suggestions please let me know. :)

Related posts

Choosing a PHP Framework Round 2: Yii vs Kohana vs CodeIgniter

It was over a year ago that I wrote the article that compares CodeIgniter and Kohana. Since then both CodeIgniter and Kohana have seen major progress with the release of CodeIgniter 1.7.0 and Kohana 2.3.

In December 2008, a new PHP framework called Yii has been released to the public with a stable 1.0. There were a lot of new PHP framework released in 2008, but Yii was one of the more recognised ones because:

Before I start this round of comparison, let me briefly list my experience with these frameworks, so you may interpret this article with your own judgement.

CodeIgniter: I started using CodeIgniter since its version 1.2.x from a few years ago. During the past few years I have worked on projects mainly using version 1.5.x and 1.6.x. I have now stopped using CodeIgniter in favour of using other PHP 5 only frameworks.

Kohana: I first started using Kohana when it was called BlueFlame back when it was first forked out of CodeIgniter. Since then I have lurked and participated in the Kohana community. All of my recent projects are done in Kohana.

Yii: The 1.0 release of Yii had my attention, but I didn’t really dive into it until about now. However, most of my impressions on Yii are based on its documentation and this article by Daniel.

Let’s see how they compare with each other.

Same notes as before: Grading scale: Limited < Fair < Good < Excellent. If a feature is not available in the distributed package, but is available via 3rd party libraries, I will state that in the comparison. If a feature is available both in the distributed package and via 3rd party libraries, only the official one will get assessed.

(more…)

Related posts

Release: [Kohana Module] Authlite, for User Authentication

Latest release: v1.2.3

Initially I was going to wait for my Layerful Framework (a transparent layering framework for Kohana) to mature before releasing its bundled modules. However, since this Authlite module can be used independently to Layerful, I am releasing it now.

What is Authlite

Authlite is a user authentication module for Kohana.

What’s the difference between Authlite and Auth?

Kohana comes with an official Auth module which does exactly what was described in the last paragraph, so why another module then?

It is because Authlite offers greater flexibilty. Please read the features outlined below to find more.

Features

  • Legacy database compatibility
  • Configurable database columns
  • Multiple instances of Authlite
  • Does not enforce user roles
  • Auth-like syntax and usage
  • Lightweight

(more…)

Related posts

Using Zend Framework with Kohana

Since my previous post on this topic, Kohana has evolved and changed quite a bit, to the point that the instructions provided are no longer applicable.

So here are the updated instructions for those who would like to integrate Zend Framework into Kohana.

1) Put the ‘Zend’ folder in your application’s ‘vendors’ directory.

2) Put the following code into an appropriate place in your application, it could be in the base controller.

if ($path = Kohana::find_file('vendors', 'Zend/Exception'))
{
	ini_set('include_path',
	ini_get('include_path').PATH_SEPARATOR.dirname(dirname($path)));
}

3) Instanciate the Zend library with the following code:

require_once 'Zend/Mail.php';
$mail = new Zend_Mail;

That’s it! How simple is that? :)

Related posts