Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
407 views
in Technique[技术] by (71.8m points)

php - Using Ion Auth as a separate module in the HMVC structure

I am interested in using ion auth for a project of mine which is running on the HMVC pattern. The application is written in Codeigniter.

The problem I face is once the ion auth is placed in the /app/modules/auth folder, when I try to access the module I get the below error:

HTTP Error 500 (Internal Server Error):
An unexpected condition was encountered while the server was attempting to fulfill the request.

Please help me out here, I am sure that I am having some sort of a configuration/path problem but just can't figure out where.

I have simply downloaded the ion_auth files from github and placed the extracted files as it is in the module folder I removed all the lines where it loads the libraries such as database, session since I have used the config to auto load them. But I left the loading of the ion_auth library.

In the module folder modules/auth I have a similar application structure with the module specific config, libraries, etc folders.

Let me know where I must have done wrong, I will continue to search and fix this problem and post if I have any luck.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Try this:

  1. Get: codeigniter.zip (CI2.0)
  2. Extract, make sure it is running, set config/config.php
  3. Get Modular Extension : HMVC
  4. Install - Copy MY_Loader & MY_Router to /core, MX to third party folder Do not copy MY_Controller - this is for Modular Separation and not Extensions
  5. Get Ion_auth
  6. Install the SQL for the Ion_auth
  7. Put Ion_auth into a modules folder /application/modules/users
  8. Add route in config/routes.php : $route['auth/(.*)'] = 'users/auth/$1';

  9. Autoload ion_auth - $autoload['libraries'] = array('database','session','users/ion_auth');

  10. Edit following paths in modules/users/library/ion_auth.php :

    $this->ci->load->config('users/ion_auth', TRUE);
    $this->ci->load->library('email');
    $this->ci->load->library('session');
    $this->ci->lang->load('users/ion_auth');
    $this->ci->load->model('users/ion_auth_model');
    

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...