Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Model has a deprecated constructor
发现php7.0之后将不再支持与类名相同的构造方法,构造方法统一使用 __construct()。
class Model
{
var $dsql;
var $db;
// 析构函数
function Model()
{
global $dsql;
if ($GLOBALS['cfg_mysql_type'] == 'mysqli')
{
$this->dsql = $this->db = isset($dsql)? $dsql : new DedeSqli(FALSE);
} else {
$this->dsql = $this->db = isset($dsql)? $dsql : new DedeSql(FALSE);
}
}
改成这样就行了
class Model
{
var $dsql;
var $db;
// 析构函数
function __construct()
{
global $dsql;
if ($GLOBALS['cfg_mysql_type'] == 'mysqli')
{
$this->dsql = $this->db = isset($dsql)? $dsql : new DedeSqli(FALSE);
} else {
$this->dsql = $this->db = isset($dsql)? $dsql : new DedeSql(FALSE);
}
}