Spiga

Cron jobs in Zend Framework

March 12, 09 by Gabi Solomon

Recently i had to implement a cronjob for a website that was build with zend framework, and to be honest i haven’t done this before. I did some googling and as a lot of times with zend framework there arent to many resources about this topic.

I did find some topics on stackoverflow.com about it ( found out about zend cli proposal wich sounds interesting ) but not really an answer. So i decided to go ahead and try a solution on my own. Read the rest of this entry »

Zend Framework Bootstrap file class

February 27, 09 by Gabi Solomon

After starting working with zend framework i found all sorts of examples of bootstrap files, but a lot of them seem pretty messy to me since all the calls to zend components were basically thrown in there.

So after a lot of looking around i came up with a bootstrap files that is more to my liking. I found the initial class on a blog post when i was looking around but i don’t remember where, so sorry for not giving it the credit.

Read the rest of this entry »

Optimizing Zend performance – small tip

January 29, 09 by Gabi Solomon

If you started working with Zend Framework you have notice that it is a bit slower then your regular php application.
This is due more or less to the double sword of having such a big framework to work with.

There are a lot of tips and tutorial out there on how to optimize your Zend Framework, and in all of them you will see the recommendation to remove the require_once from the library and to use Zend_Loader. Wich is a good advice since all those require_onces do put some stress on your application.

But after a bit of testing i camed to the conclusion that Zend_Loader isn't so fast. So i decided to go revert to a simple solution: writing my own autoloader.
I just put this small function at the top of my zend bootstrap file.

PHP:
  1. function __autoload($class) {
  2.     require str_replace('_', '/', $class) . '.php';
  3. }

And because i wrote all my application using Zend / Pear naming standard it works pretty good.

Hope you find this useful.
Cheers