Php 点火器代码:油箱认证配置自动初始化
Iam使用储罐认证安装的默认设置。当我在控制器中尝试以下语句时:Php 点火器代码:油箱认证配置自动初始化,php,codeigniter,Php,Codeigniter,Iam使用储罐认证安装的默认设置。当我在控制器中尝试以下语句时: $this->load->library('tank_auth'); 它显示以下输出: This is Tank Auth Conf This is Tank Auth Library-INITIAL This is Tank Auth Library-BEFORE This is Tank Auth Conf This is Tank Auth Library-AFTER This is login pag
$this->load->library('tank_auth');
它显示以下输出:
This is Tank Auth Conf
This is Tank Auth Library-INITIAL
This is Tank Auth Library-BEFORE
This is Tank Auth Conf
This is Tank Auth Library-AFTER
This is login page in User Folder after USER_CONTROLLER-2
以下是来自tank_auth库文件的u构造函数:
function __construct()
{
echo '<br>This is Tank Auth Library-INITIAL<br>';
$this->ci =& get_instance();
echo '<br>This is Tank Auth Library-BEFORE<br>';
$this->ci->load->config('tank_auth', TRUE);
$this->ci->load->library('session');
$this->ci->load->database();
$this->ci->load->model('tank_auth/users');
// Try to autologin
$this->autologin();
echo '<br>This is Tank Auth Library-AFTER<br>';
}
echo '<br>This is Tank Auth Conf<br>';
函数uuu构造()
{
echo'
这是坦克认证库的首字母
;
$this->ci=&get_instance();
echo“
这是
之前的坦克验证库”;
$this->ci->load->config('tank\u auth',TRUE);
$this->ci->load->library('session');
$this->ci->load->database();
$this->ci->load->model('tank_auth/users');
//试着去喝点酒
$this->autologin();
echo“
这是
之后的坦克验证库”;
}
在储罐认证的配置文件中添加了以下行:
function __construct()
{
echo '<br>This is Tank Auth Library-INITIAL<br>';
$this->ci =& get_instance();
echo '<br>This is Tank Auth Library-BEFORE<br>';
$this->ci->load->config('tank_auth', TRUE);
$this->ci->load->library('session');
$this->ci->load->database();
$this->ci->load->model('tank_auth/users');
// Try to autologin
$this->autologin();
echo '<br>This is Tank Auth Library-AFTER<br>';
}
echo '<br>This is Tank Auth Conf<br>';
echo'
这是坦克验证配置
;
有人能告诉我为什么配置文件要初始化两次吗
注意:自动加载文件中没有条目。
坦克认证版本:1.0.9。
代码点火器版本:2.0.2
提前感谢CI在加载库之前自动加载相应的配置文件(如果存在)。请参阅
\u ci\u init\u class
函数(Loader.php,第919行)
如代码所示,Tank Auth在其构造函数中第二次加载配置文件,但该配置文件是冗余的,因为CI会自动加载该配置文件。CI会在加载库之前自动加载相应的配置文件(如果存在)。请参阅
\u ci\u init\u class
函数(Loader.php,第919行)
正如您的代码所示,Tank Auth在其构造函数中第二次加载配置文件,但该配置文件是冗余的,因为CI会自动加载配置文件