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

#1
[eluser]robustus[/eluser]
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?

Thanks.

#2
[eluser]mi6crazyheart[/eluser]
I think u should have a look on this : http://www.doctrine-project.org/

#3
[eluser]Sire[/eluser]
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:
http://hasin.wordpress.com/2007/06/13/us...deigniter/

Another post from this forum, with some answers:
http://ellislab.com/forums/viewthread/101097/#759422

#4
[eluser]robustus[/eluser]
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-2020 MyBB Group.