Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
database.php中的codeigniter access config.php_Php_Codeigniter_Configuration Files - Fatal编程技术网

database.php中的codeigniter access config.php

database.php中的codeigniter access config.php,php,codeigniter,configuration-files,Php,Codeigniter,Configuration Files,在我的工作中,我们有一个典型的设置 在本地主机上开发 分期测试 以生产为生 我们正在使用codeigniter 很明显,每次我们移动它们时都要更改所有设置,这真是一种痛苦 我想做的是 在config.php中有$config['env']='localhost';//'测试“;/”生产", 然后在我的database.php和email.php中 如何执行此操作?在1.7.x中,您可以执行以下操作: 在database.php中: $CI = get_instance(); $active_gr

在我的工作中,我们有一个典型的设置

在本地主机上开发 分期测试 以生产为生

我们正在使用codeigniter

很明显,每次我们移动它们时都要更改所有设置,这真是一种痛苦

我想做的是

在config.php中有$config['env']='localhost';//'测试“;/”生产",

然后在我的database.php和email.php中


如何执行此操作?

在1.7.x中,您可以执行以下操作:

在database.php中:

$CI = get_instance();
$active_group = $CI->config->item("active_group");
因此,在config.php中,您可以:

$config['active_group'] = 'development'; // production, staging, etc
$config['active_group'] = 'development'; // production, staging, etc