Using the Zend Framework Without PDO
David Coallier (#phpc regular) has posted a quickie tutorial on his site about using the Zend Framework without PDO. In it he discusses how to use MDB2 with the Zend Framework instead of the Zend_DB and PDO. Here’s a quick quote to wrap your head around.
For those who wanted to use the Zend Framework on server but didn’t have all the access to install PDO or such will now be able to do so. I have a fix that now MDB2 (PHP5 Only) can be used instead of PDO.
If you are a MDB2 fan but still want to use the Zend Framework or wanting to use the Zend Framework but didn’t have access to PDO, this is a good read. David has laid out a lot of code for you to peruse.
SIDE NOTE: Another option if you want to bypass PDO but use the Zend Framework is to use the new MySQLi adapter in the incubator.
=C=

Comments
Seriously, currently I'm redisigning the classes in order to make them fully compatible with ZF.
If anyone is interested, I can keep you up to date with the answer and news I get from the zend mailing list.
Thanks :-)
I am planning on having it ready by Thursday (Thurs Jan, 10, 2007) to be usuable.
I currently have converted mysql/postgre/sqlite
I have a local version of mssql and I will be adding it tonight to the main tar.
However I have the first version here:
http://dev.agoraproduction.com/zend/ --> (0.0.4)
But I will be adding daily to this as I am converting new drivers.
You have to put the Php/ directory into Zend/Db/Adapter/
And the Db.php file in Zend/ . The only thing that changed in the Db.php factory is adding an elseif that handles the PHP_* driver call. Nothing more.
Let me know how it went.
D
You can get the Zend/Db.php file there:
http://dev.agoraproduction.com/zend/Db.php
and you can get the Zend/Db/Adapter/Php directory there:
http://dev.agoraproduction.com/zend/Php-0.0.6.tar
This version has a new *structure* and support mysql/mssql/pgsql/oci8/sqlite
I still see some design problems and maintainability hell coming up but it should work until the next release.
Next one (tonight or tmrw) will have the main functions to query, etc.
Thanks
By main functions I mean:
fetchAll() (Already Done)
fetchCol() (Already Done)
fetchRow() (Already Done)
fetchOne() (Already Done)
setFetchMode (Already Done)
query() (Already Done)
insert() (Done but Untested - fixing today)
update() (Done but Untested - fixing today)
select() (Implementing today)
quote() (Implementing today)
etc.
<a href="http://dev.agoraproduction.com/zend/Php-0.0.7.tar">http://dev.agoraproduction.com/zend/Php-0.0.7.tar</a>
The next versions will have many changes as such as describeTable, and database management methods.
This version seems a little more stable than the other ones but might still be breaking at some point.
I am also planning on using Zend_Db_Exception for errors.
Thanks :-)
Next it will go beta:
http://dev.agoraproduction.com/zend/Php-0.0.9.tar
For further releases just look at:
http://dev.agoraproduction.com/zend/
and use the latest version of Php-x.y.z.tar :-)
P.S. You can also stay updated there:
http://blog.agoraproduction.com/index.php?/archives/15-Zend-Framework-Without-PDO.html
Enjoy all!
Thanks
http://blog.agoraproduction.com/index.php?/archives/17-Zend-Framework-Without-PDO.html
Sorry the other address is wrong.
D
I find that PDO for MSSQL 2005 driver not supported in zend framework 1.x.x.
Otherwise I find the SQL Server 2005 Driver for PHP in Microsoft website at here :
http://msdn.microsoft.com/en-us/library/cc296221.aspx
so can u implement the MDB2 Driver for sqlsrv Driver?
I am very happy if u can make the Driver soon.
-regards
Hendrayana