Using CodeIgniter's DB engine in a non-CI project

I'm using CI for a number of new projects, but I have a few legacy projects that I won't be converting to CI. I do have some libraries that I'd like to use for both, though, and one major issue is the DB calls. If I could use CI's DB layer within a non-CI project, that would very much help portability for me.

Can this be done? Can I move some files around and do the equivalent of $this->load->database() within a non-CI project and get all the DB interaction methods supported in CI? If so, how?


I think u should have a look on this :

I've thought about this too. A php Active Record class should be pretty useful but if you're determined to use CI's implementation instead this may help:

Another post from this forum, with some answers:

Ok, thanks. That other thread looks like it has some good info. I'm kinda surprised that so few people apparently have this need, though. It's pretty annoying to use different DB layers in different projects, and I'm sure many people on this board are maintaining both CI and non-CI code.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.