Using Zend Framework with Kohana
Posted by Fred Wu on November 14th, 2008 | Filed under Kohana, Zend Framework
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
Tags: integration, Kohana, Zend Framework
json_encode() for PHP4 and early PHP5
Posted by Scott Gruer on November 11th, 2008 | Filed under Javascript / AJAX, Testing
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! ;)
Related posts
Tags: AJAX, deployment, json, php4, php5, Testing
Cost, Quality or Speed - You Can Have 2
Posted by Scott Gruer on November 9th, 2008 | Filed under Business
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… ;)
Related posts
Tags: Business, cost, pricing, quality, quotes
Put Your Macbook Air in An Envelope, For Real!
Posted by Fred Wu on November 6th, 2008 | Filed under Hardware
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.
Related posts
Tags: envelope, Macbook Air, Shuky, sleeve
Windows 7 Build 6801, a Snappier Vista
Posted by Fred Wu on November 1st, 2008 | Filed under Windows
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.
Related posts
Tags: UAC, VMWare Fusion, Windows 7, Windows Firewall, Windows Vista
PHP Namespace - $this->sux
Posted by Scott Gruer on October 29th, 2008 | Filed under PHP
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)… :)
Related posts
Tags: namespace, naming conventions, PHP
















