开发者

Cannot autoload/crossload libraries

I’m getting error when trying to autoload ion_auth library

application/config/autoload.php

$autoload['libraries'] = array('database', 'template', 'asset', 'ion_auth/i开发者_运维问答on_auth'); 

folder structure:

application/
  ...
  modules/
    ion_auth/
      ...
      config/
        ion_auth.php
      ...
    tester/
      controllers/
        tester.php 

I try to var_dump($this->ion_auth) on tester.php and get error message:

The configuration file ion_auth.php does not exist.

I try to $this->load->library('ion_auth/ion_auth') from tester.php and remove the ionauth from autoload, It still error. How to solve this?

I download codeigniter from link on codeigniter.com and download Modular Extension from bitbucket


It's not an issue with Modular Extensions. You need to put the config file for Ion Auth into the main application's config folder, not in the Ion Auth directory.

Just move it from application/modules/ion_auth/config/ion_auth.php to application/config/ion_auth.php. That will take care of the config error, but you'll probably need to move the entire Ion Auth library into application/libraries.


I don't use Modular Extensions, but from the looks of your code, I'd venture to guess that CI doesn't know to look in the ion_auth folder for the config folder.

If Modular Extensions has a config option, make sure to set it to look in the extension's folder for a config folder. If it doesn't, you'll need to either tell CI directly about the config folder, or put the ion_auth config file into a recognized config folder.


I'm doing exactly the same as you, HMVC from wiredesignz, CI and Ion_auth and I had the same problem. I solved it loading the config file PRIOR the library, :P, I don't know if this would be your problem, but I also had exactly the same error message. My construct method with Ion_auth looks like

class Auth extends MY_Controller {

function __construct()
{
    parent::__construct();

    // THIS LINE BEFORE LOAD THE LIBRARY:
    $this->load->config('auth/ion_auth', TRUE);

    $this->load->library('ion_auth');
    $this->load->library('session');
    $this->load->library('form_validation');
    $this->form_validation->CI = & $this;
    $this->load->database();
    $this->load->helper('url');
    $this->load->helper('cookie');

    $this->load->library('email');
    $this->load->library('session');
    $this->lang->load('auth/ion_auth');
    $this->load->model('auth/ion_auth_model');      
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜