views:

58

answers:

3

Hi. I've started a CI project and I'm going to use it with Doctrine, there is benchmarking system for the latter and I'd like to remove the ability to use native CodeIgniter DB class, since it won't be benchmarked. I though about simply removing the corresponding files, but I'm afraid it could cause CI errors in other places. How can I remove the ability to use native CI DB class?

I personally would not do it. I just want to force the future developers with random level of qualification not to load it as well

+1  A: 

Don't load it in your controller.

Josh K
+3  A: 

I also use Doctrine in connection with CodeIgniter and there is no need to do anything with the CI DB class. Just ignore it and use Doctrine as you would do normally. If you don't use the DB classes or don't load it, they won't get benchmarked.

If you haven't already found it, look at the wiki, ot gives a good idea what to do with Doctrine

edit to your 1st comment: If you really want to disable the DB class, I see one way: either delete the core file(s)/folder(s) or rename it so that a loading just fails. Alternatively, change their code so they cannot be loaded. If you do so, it should be really well documented somewhere so that the error will be obvious to someone after you.

DrColossos
I personally would not do it. I just want to force the future developers with random level of qualification not to load it as well
roddik
see my edit above
DrColossos
if I just delete the core files, won't it affect other parts of CI?
roddik
It should not but just test it. If everythings runs like expected, you're good to go ;)
DrColossos
A: 

Theoretically, you could create a hook and disable CI's DB functionality. In the hook, you would extend the CI_DB class and the display an error message if the class gets loaded. I'm sorry I can't give specifics, but you'd probably have to inspect the system's database classes to see what would need to be altered.

At least that way, you wouldn't need to make changes to the CI core.

TerryMatula