簡體   English   中英

Codeigniter升級問題

[英]Codeigniter upgrade issues

我最近將我的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之前,這段代碼一直運行良好,現在出現此錯誤: 注意:在file-path / config / constants.php中使用了未定義的常量'EXT'

原因可能是什么?如何解決該問題?

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

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

我希望這能解決您的問題。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM