Yii Framework passing driver options via PDO (iSeries)

Dear all,

I am very new to the Yii framework - I started looking at it last week! - so apologies in advance if I ask anything obvious or I have posted in the wrong place or anything.

MY company are IBM iSeries specialsts and we are looking to use Yii Framework as the framwork for our PHP applications on the iSeries (AS400).

I have worked through the tutorials and had some success so far - first impressions are very good - but I have hit a few sticking points.

So hopefully someone here will be able to help me.

I have attempted to use IBM_PDO to connect to the iSeries and I have now got this working in a limited capacity. In order to do this I have had to take the existing IBM DB2 database schema and hack around with it a bit!

The problem I have seems to be with limitations in the IBM_PDO. Under the covers I believe this is using IBM_DB2 to make the connections etc. On the db2_connect (or pconnect) function of IBM_DB2, there is an option i5_naming which I need to set to DB2_I5_NAMING_ON. This is very important for us as it enables us to use iSeries library list functionality with our existing databases. Now I cannot see anyway to get this option passed through from PDO.

Does anyone know if this is possible? Is is possible with some sort of adapter?

If it is not possible then we need to look at maybe not using PDO but directly using the IBM_DB2 package. In the documentation for Yii Framework it says that it is easy to use third party applications instead of PDO.

So my questions would be - what is the correct way to bypass PDO in yii framework and use our own data access classes?

Hopefully this all make sense to everyone and I haven’t been waffling on too much!

Let me know if you need any mroe information.

Thanks in advance.

Martin C

There’s been some ongoing work to bring DB2 and Yii together. However, I don’t know how far this went. Consulting the PDO manual I couldn’t find a constant for said option, so you cannot set it via CDbConnection.setAttributes(). A last resort would be to see if you can pass that option via the DSN string.

If you want to override the usage of PDO in Yii, it is certainly possible: Some people started to connect to MongoDB and stuff. But I’ll leave this to others as I’ve never done this myself :rolleyes:

Hm, this might be of interest to you: https://github.com/rmanola/Db2-schema-for-Yii

Thnaks for the responses Da:Sourcerer.

The link you posted is the link I used to get the DB2 schema. This is the schema that I have played around with to get it working in a limited capacity.

My extension for IBM DB2: YiiDB2