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

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? :)

  • Digg
  • DZone
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • Twitter

Related posts

Tags: , ,

Comments Section

11 Responses to “Using Zend Framework with Kohana”

Sidebar might be covered by comments ... consider it a feature! ;)
  1. 1

    Awesome! So simple… love it. Thanks

  2. 9

    So simple!!! Same~ way we can include other classes as well (for example I am used to phpmailer). Wouldn’t it be better to use an autoload functionality (steill new to those frameworks…), so that you include only necessary files and optimise performance? How would this be possible?

  3. 11

    good tips.I’ve used CI before,and I’am dout to use Kohana , Yii or ZF ,read some of your articles,I think I should try Konaha.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>