Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/246.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
Php Codeigniter升级问题_Php_Codeigniter 2_Codeigniter 3 - Fatal编程技术网

Php Codeigniter升级问题

Php Codeigniter升级问题,php,codeigniter-2,codeigniter-3,Php,Codeigniter 2,Codeigniter 3,我最近将我的codeigniter版本从2.2.0升级到了3.0.0,我遇到了一些问题。我在config/constants.php中有一段代码,它从数据库中获取配置数据并将值设置为常量。代码如下: require_once ( BASEPATH. 'database/DB'. EXT ); $db =& DB(); $query = $db->get_where ('settings_table', array('id' => '1')); $row = $query-&g

我最近将我的codeigniter版本从2.2.0升级到了3.0.0,我遇到了一些问题。我在config/constants.php中有一段代码,它从数据库中获取配置数据并将值设置为常量。代码如下:

require_once ( BASEPATH. 'database/DB'. EXT );
$db =& DB();
$query = $db->get_where ('settings_table', array('id' => '1'));
$row = $query->row_array();
define ("LOGO",$row["logo"]);
在我升级codeigniter之前,这段代码一直运行良好,现在出现了以下错误:注意:在path/config/constants.php文件中使用了未定义的常量“EXT”


原因可能是什么?我如何解决该问题

在CI 3.0中,index.php中未定义EXT常量

CI 2.2.2示例

// The PHP file extension
// this global constant is deprecated.
define('EXT', '.php');
要使其与脚本一起工作,只需将其更改为:

require_once ( BASEPATH. 'database/DB.php'); 
//or whatever the extension is for that file

我希望这能解决您的问题。

我已经做了更改,并出现以下错误:致命错误:在第375行的文件路径/system/database/DB_driver.php中调用未定义的函数log_message(),您是否用3.0更新中的新文件更新了系统目录中的所有文件?log_message函数应该自动加载。你能检查一下你能在系统目录中找到这个函数吗?它应该在System/Core/Common.phpI中。我想我可能知道这个问题,试着像这样访问DB对象<代码>$CI=&get_instance()$db=$CI->db是,该函数存在于文件中