CodeIgniter Forums

Full Version: How to disable Codeigniter database support
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]smcjock[/eluser]
I would like to disable database support in my instance of codeigniter. I do not want to use Codeigniter to handle any database connections, no active record e.t.c. I handle connections to Oracle myself using the PhP OCI8 extension.

My problem is that CI still seems to be trying to access the database configuration file 'database.php' and I see from my logs that CI is throwing the error:

Severity: Warning --> ocilogon() [0function.ocilogon0]: ORA-12162: TNS:net service name is incorrectly specified /****/****/****/system/database/drivers/oci8/oci8_driver.php 78

My application is working fine other than that. How can I stop CI attempting to connect to a db??

I've tried: setting $db['default']['db_debug'] = FALSE; $active_record = FALSE;

I've also tried commenting out the entire db configuration in database.php.

Any suggestions?

El Forum

[eluser]Jamie Rumbelow[/eluser]
Just never load the Database class. Don't put it in your autoload.php or load it directly in your code. CI won't go near it until you tell it to.

Jamie

El Forum

[eluser]smcjock[/eluser]
Thanks for your reply.

I forgot to mention that I did not add 'database' to the autoload['libraries'] array in autoload.php. I will double check to make sure all db activity is handled through my own OCI8 connection - I'm sure it is though as I checked previously.

El Forum

[eluser]smcjock[/eluser]
Hi Jamie,

My mistake. I did in fact actually still have one function in a db model which invoked database->load.

Removed it and problem solved.

Thanks for your suggestion.

El Forum

[eluser]jdfwarrior[/eluser]
Just... wow..

El Forum

[eluser]smcjock[/eluser]
I know! mind blowing!!