Jump to content
Larry Ullman's Book Forums

Is Yii Framework The Right Framework For Me?


MazzaC
 Share

Recommended Posts

Dear All,

 

I'm after some advice here, I hope you can help me.

 

My company is an IBM iSeries (Mainframe) software company who are recently in the process of upgrading our old legacy code to use more modern solutions. One of our solutions is to use PHP along with some third party APIs to call applications written in the legacy code (RPG) and access the DB2 database.

 

We have a working version of this now but we are looking to standardise our code and make it clearer by using a PHP framework so I have been analysing different frameworks and this is how I have ended up on this excellent site.

 

So my question for you is:-

 

As we are calling a DB2 database via SQL and using APIs to access functions in a different language, can Yii still be used as the framework?

 

Looking at the tutorials etc, there is lots of examples of setting up code in MySQL etc and so I was wondering how rigid this is.

Can we plug in our own classes etc for our model into Yii and how easy is it to do this?

 

In other words, we want to use some of the features of the framework (MVC, front controller etc) but not everything. Is this possible?

 

Hopefully this make sense and I am not just waffling on!

 

Thanks in advance for any help you can give me.

 

 

Martin C

Link to comment
Share on other sites

Without having extensive knowledge of Yii myself, I've seen that Yii has both Active Records and an object-oriented QueryBuilder class. You should have a lot of flexibility there.

 

From a general point of view, why should using you own Database classes be a problem? :)

 

Looked it up for you:

 

Working with Database:

(...) Built on top of the PHP Data Objects (PDO) extension. (..) Applications developed using Yii DAO can be easily switched to use a different DBMS without the need to modify the data accessing code.

 

Although the included Yii database features can handle nearly all database-related tasks, you can still use your own database libraries in your Yii application. As a matter of fact, Yii framework is carefully designed to be used together with other third-party libraries.

 

Here is also information about including 3-party libraries: http://www.yiiframework.com/doc/guide/1.1/en/extension.integration

 

Generally I would say this looks like a good alternative without knowing your specifics. You are the only one knowing what you need.

Link to comment
Share on other sites

I don't think Yii supports DB2. I could be wrong, but it doesn't come up immediately, which would suggest to me Yii isn't a good choice for you. I believe CodeIgniter supports DB2, and I've heard great things about CodeIgniter.

 

All that being said, it would probably still be possible to use Yii with DB2, but if you're thinking about making a big change like this, I'd be inclined to get direct support first. It'll be easier to develop in the long run.

Link to comment
Share on other sites

I did some research, and neither does CodeIgniter. You need to download drivers for both frameworks. (Both has one available)

 

Just assuming, but I think that is why he wondered about using their own DB classes. That should be very much possible in Yii. I haven't seen CI stating the same, but I'm sure it shouldn't be a problem.

Link to comment
Share on other sites

Thanks eveybody for the quick responses.

 

I'jj just try and clarify a bit.

 

I am completely new to the world of PHP frameworks - but not to the world of PHP.

 

We already have our own working classes to call the RPG apis and to connect to the iSeries (DB2) and so don't need any pre written ones.

 

My question is simply can I use these classes in combination with the Yii framework as we do want to use the other aspects of the Yii Framwork.

 

I don't know if Yii forces you to connect in a certain way in the model or if I can write my own model that uses our existing classes.

 

This is just my ignorance of frameworks in general. I assume that I can do this but I thought it would be best to check in case the framework prohibits this and I get too far down the line before realising this. I have heard that certain frameworks force you to do things a certain way and so this has made me a bit nervous.

 

Hopefully this is clearer for everyone now.

 

Thanks in advance

 

Martin C

 

PS. I am very impressed with the quick responses on this forum and this is also an important factor for me in chosing a framework to use!

Link to comment
Share on other sites

You can use your own classes with Yii, it's just a matter of how much work that will be to integrate. Have you checked out the Yii support forums, too? Someone there might have already encountered and solved this problem.

Link to comment
Share on other sites

 Share

×
×
  • Create New...