Welcome Guest, Not a member yet? Register   Sign In
why won't CI pick up my new config file?
#1

[eluser]bill19[/eluser]
Hi everyone,

I am trying to modify my program to detect the environment it is in and load configuration files accordingly.

in my index.php file I have placed
Code:
define('ENVIRONMENT', isset($_SERVER['SERVER_NAME'])=='my/production/server.com' ? 'production' : 'development');

I have placed a new folder called production, in application/config.

I have placed the database settings for my production server inside this in database.php:

Code:
$active_group = 'default';
$active_record = TRUE;

$db['default']['hostname'] = 'localhost';
//$db['default']['username'] = 'root';
$db['default']['username'] = '*******';
//$db['default']['password'] = '';
$db['default']['password'] = '*******';
$db['default']['database'] = '********';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';

It looks to me that the program is looking for or loading the other database.php file which is for the local wamp and which is in application/config.

Any idea why its not loading the right file?

Thanks in advance,

Bill
#2

[eluser]wiredesignz[/eluser]
isset() returns TRUE if var exists and has value other than NULL, FALSE otherwise.

http://php.net/manual/en/function.isset.php




Theme © iAndrew 2016 - Forum software by © MyBB