简体   繁体   中英

Codeigniter upgrade issues

I recently upgraded my version of codeigniter from 2.2.0 to version 3.0.0 and I am experiencing some issues. I have a piece of code in config/constants.php which fetches configuration data from the database and sets the values to the constants. The code is as below:

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"]);

This code was working well until I upgraded codeigniter and now i get this error: Notice: Use of undefined constant 'EXT' in file-path/config/constants.php .

What could be the reason for it and how do I resolve the issue?

In CI 3.0 the EXT constant is not defined in the index.php

CI 2.2.2 example

// The PHP file extension
// this global constant is deprecated.
define('EXT', '.php');

To get this to work with your script just change it to:

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

I hope this solves your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM