Skip to main content


Showing posts from November, 2012

Route default is not defined

Working this long with Zend Framework makes me do things that have become a real routine and I don't pay much attention to it. So when I just add few custom routes to my Zend Framework application, I don't make a big fuss out of it. But apparently people do struggle with it. They get messages like this:

Zend_Controller_Router_Exception: Route default is not defined
Apparently when you create custom routes, Zend Framework "forgets" about the default route, causing this error to appear.

To quickly resolve this issue, you just open up application/Bootstrap.php and add the following to your routines:

protected function _initDefaultRoutes() { $frontController = Zend_Controller_Front::getInstance(); $frontController->getRouter()->addDefaultRoutes(); }
If you already have routine for loading routes, just ensure you add the default routes!

protected function _initRouteSetup() { $frontController = Zend_Controller_Front…

Learning lessons at ZendUncon

In my previous post I already mentioned Sebastian Jerzy WilczyƄski (@dj_sebastian_w) and his uncon session "Unit Testing for Databases using fixtures and phpunit". It made me wonder how much difference it would make if you use fixtures instead of testing database interactions using predefined sets of data.

Since I work a lot with Zend Framework I was looking at how I could use fixtures and mock objects to follow Sebastian's guidelines. So I gave it a try. This is what I came up with.

I use the domain model design pattern for accessing data storages with Zend Framework so this means I have a model (Order_Model_Order) which is the representation of my data object, a mapper (Order_Model_OrderMapper) to connect my model with an underlying data storage backend and a table gateway object (Order_Model_DbTable_Order) to link everything to the database. The object we're going to focus on is Order_Model_OrderMapper as this is the link that connects my model to the database.


ZendCon 2012

October is often the month where all PHP businesses look towards sunny California, because it's ZendCon time! This year was no exception and it was a true blast. And ZendCon means not just 4 days of PHP goodness but also 2 days and a half of Uncon power. And this year I had the honour and pleasure to be in charge of the ZendUncon sessions.

Because my involvement in those uncon sessions, I missed most of the regular tracks. But on the bright side I was able to discover new speakers and was sitting in a few awesome sessions I would like to recommend here.

Let me explain the idea behind uncon sessions first, so you at least have a good grasp of the importance of these sessions. An uncon session is different from regular conference sessions because they are not scheduled and can be given by anybody. It's a great way for conference attendees to give a talk or a round table discussion. For the first situation, people can learn how to speak in public and get their first steps in talk…