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
  • description
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb

Related posts

Tags: , ,

json_encode() for PHP4 and early PHP5

Had a beauty today. There I was ready to deploy some nicely polished code to the server. After some thorough local testing it looked like it’d be a smooth process. So the code went up, but all my funky AJAX stuff stopped working on the server. How could that be? It was perfect locally… :)

It took a little while but in the end I realised what was going on - json_encode wasn’t working. The server was running PHP 5.1.6 and json_encode only became “standard” with PHP 5.2.0 onward.

I needed a solution fast. No time to recompile a newer version of PHP, add libraries or anything fancy like that. I just needed the function json_encode to work right now. Thankfully, the solution was as easy as adding replacement a function a user kindly submitted from the PHP site itself:

http://au.php.net/manual/en/function.json-encode.php#82904

I blindly assumed PHP 5 was PHP 5. I wasn’t using any extremely fancy commands or anything, but I still came unstuck. So the moral of today is check your server specification right down to every last decimal point! ;)

  • Digg
  • description
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb

Related posts

Tags: , , , , ,

Cost, Quality or Speed - You Can Have 2

Came across a nice little statement which I believe is generally quite true in business on Swish Design’s blog:

Cost - Quality - Speed … Pick two

Meaning:

  • If you want something fast AND high quality - you can’t expect it to be cheap.
  • If you want something cheap AND high quality - you can’t expect to get it quickly.
  • And if you want something to be cheap AND you want it done quickly … you’re going to sacrifice quality.

Of course, if you work with Fred or myself you get all 3… ;)

  • Digg
  • description
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb

Related posts

Tags: , , , ,

Put Your Macbook Air in An Envelope, For Real!

I assume everyone is already familiar with Apple’s Macbook Air commercial. :)

I just bought a nice companion for my Macbook Air, a lovely ‘envelope’ as seen on TV. :D

The moment I saw this sleeve, I smiled and immediately placed an order. It was designed by an Australian designer: Shuky. (Disclaimer: We are not affiliated with them in any way.)

A few photos of this lovely, creative piece and my Macbook Air.

Two more photos after the break.

Read the rest of this entry »

  • Digg
  • description
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb

Related posts

Tags: , , ,

Windows 7 Build 6801, a Snappier Vista

When Windows Vista was first released, I was disgusted by its bugs and general unstableness. I mean, copying only a few hundreds of files causing memory overflow was seriously not cool, not to mention the awkward software and hardware compatibility at that time. Windows Vista, when it was first released, was a beta software at best.

Things have been improved since then. I know quite a few people who are happily using Vista without any glitches. For the others including myself, it was too little too late. Some people chose to downgrade to XP, and I chose to fully migrate to OS X.

This is not a post about OS X vs Windows though.

It’s all about Windows.

Read the rest of this entry »

  • Digg
  • description
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb

Related posts

Tags: , , , ,

PHP Namespace - $this->sux

Federico makes an interesting point about the PHP Namespaces Controversy on his PHP::Impact blog. I never thought about the mess that is PHP until I saw his comparison table:

Java:
Attribute/Method access: foo.bar
Static method access:    Foo.bar
Package access:          foo.bar.baz

C#:
Attribute/Method access: foo.bar
Static method access:    Foo.bar
Namespace access:        foo.bar.baz

Python:
Attribute/Method access: foo.bar
Static method access:    Foo.bar
Module access:           foo.bar.baz

PHP:
Attribute/Method access: $foo->bar
Static method access:    Foo::bar
Namespace access:        C:\foo\bar\baz

I guess I can’t complain though as the syntax of PHP is still a lot closer to more “traditional” languages than something like Ruby (not talking about the namespace, just the language in general)… :)

  • Digg
  • description
  • del.icio.us
  • Facebook
  • Mixx
  • Google
  • Furl
  • LinkedIn
  • Live
  • Reddit
  • Slashdot
  • Spurl
  • StumbleUpon
  • Technorati
  • TwitThis
  • YahooMyWeb

Related posts

Tags: , ,

© Copyright 2008 Beyond Coding
Design by: styleshout | Colourise by: Theme Lab and Search Marketing | Customised by BeyondCoding.com
Powered by WordPress