Zend Framework and Doctrine

doctrine_iconWell it’s looking like Doctrine is the heavy weight data mapping solution of the lot. Zend Framework was often criticized for having no serious Model methods. Models was just sort of where you put your nuts and bolts database code. Some folks like the structure of the Active Record model that you see in Rails some other PHP frameworks. Sure it makes it dead easy when your tables map pretty straightforwardly onto your objects but makes it harder to have complex objects involving many tables. Zend was working on their own Zend_Entity package to remedy this, but they have abandoned it in favor of integrating Doctrine. The Zend Roadmap for the future calls for tight integration of Doctrine with the framework, so there will probably be some additional automatic linkage, with the view to the framework user’s code being smaller. But both ZF 2.0 and Doctrine 2.? are for PHP5.3, which is some time down the pike for ordinary folks. On the ZF Wiki there is a proposal to integrate current versions, at least to some extent. The symfony camp are hollering that Doctrine automatically “just works” in symfony, and that’s great. But for now you do have to do a little work to integrate it with ZF.
Continue Reading…

Listen to this post Listen to this post

Alternatives to Zend Framework

I am currently feeling very conflicted about Zend and everything associated with it. I heard a statement the other night by a guy who was talking about CakePHP that hit the nail on the head. Paraphrasing what he said,

“There is nothing wrong with Zend Framework, but you just get this feeling with Zend that there will come the day when it’s going to become painful for you if you don’t shell out big bucks to them.”

Shades of Microsoft…. BLEAH! I am afraid the day has come. I was a big proponent of Zend. It’s difficult to eat a bit of crow and do a 180 on something you’ve taken a stand on, but when I examine things rationally, I’ve been increasingly disillusioned with Zend. There are several sticking points, elaborated below:
Continue Reading…

Listen to this post Listen to this post

OW! Zend Framework bit me OR Careful with that config

zf Ouch! I just solved a puzzling error in Zend Framework. It was telling me that I had an illegal file name. While the trace never did point to the exact line in my code that triggered it, it clearly had something to do with a PDO_SQL database.

I checked the database file and indeed the permissions were OK and the name of the file seemed as legal as anything else I had that worked.

What it turned out to be was that I used the wrong kind of quotes. Double quotes work, and also no quotes work. But don’t try to use single quotes (apostrophes) around a value in the config file. Here is the line in application.ini that caused the error:

DOESN’T WORK

resources.db.adapter         = 'PDO_SQLITE'

Here is the same config from another project that worked fine. To my eyes there was no difference between this one and the one before it. It’s not like I had variable interpolation in it or anything!!

resources.db.adapter         ="PDO_SQLITE"

And I got beyond this error and on to the next one by doing it thusly:

resources.db.adapter         = PDO_SQLITE
Listen to this post Listen to this post
|