Welcome Guest, Not a member yet? Register   Sign In
How to disable Codeigniter database support
#1

[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?
#2

[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
#3

[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.
#4

[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.
#5

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

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




Theme © iAndrew 2016 - Forum software by © MyBB