在HMVC结构中使用Ion Auth作为单独的模块
|
我对将ion auth用于在HMVC模式下运行的我的项目感兴趣。该应用程序是用Codeigniter编写的。
我遇到的问题是,将ion auth放置在/ app / modules / auth文件夹中后,当我尝试访问模块时,出现以下错误:
HTTP错误500(内部服务器错误):
服务器尝试满足请求时遇到了意外情况。
请在这里帮助我,我确定我遇到了某种配置/路径问题,但无法确定在哪里。
我只是从github下载ion_auth文件,并将提取的文件原样放置在模块文件夹中,所以我删除了所有用于加载库(如数据库,会话)的行,因为我已使用config自动加载它们。但是我离开了ion_auth库的加载。
在模块文件夹modules / auth中,我具有与模块特定的config,library等文件夹类似的应用程序结构。
让我知道我一定做错了什么,如果有任何运气,我将继续搜索并解决此问题并发布。
没有找到相关结果
已邀请:
6 个回复
混侩闯空坷
自动加载ion_auth-
在modules / users / library / ion_auth.php中编辑以下路径:
稳赣苍卯改
中得出
。 运行Ion Auth \的sql设置表。 在“ 7”中,将行更新为:
在
中将
中的行更新为:
在
中将
中的行更新为:
更改
控制器(
)以扩展
,而不是默认的
。 现在,在
中,确保将所有
更改为
-(请确保在下面阅读有关内容!!)。 将
中的文件和目录移动到
中,得到的
没有较低的
目录-(请确保在下面阅读有关内容!!)。 将routes.php文件添加到modules / auth / config并添加以下行:
现在,转到
,一切都应该很好! 陷阱 首先,不要在AUTO7ѭ文件中自动加载库或模型。用
在模块中明确显示它们,等等。 那一个让我很困扰。 我忘了提一下,在当前安装中,我已经从URL中删除了index.php,并且在安装的基础上有一个.htaccess文件。如果不起作用,则可能是这里的RewriteBase有问题。这是我使用的.htaccess文件:
================================ 当我更新modules / auth / controllers / auth.php以扩展MX_Controller而不是CI_Controller时,此后出现了一系列错误。这些错误中的第一个是:
为解决此错误,我将“ 19”控制器中的所有“ 20”更改为“ 21”。 解决此问题后,当我转到
时,会收到如下错误:
显然,它无法在自己的ѭ37目录中找到视图文件。啊考虑后,这并非完全正确。原因是因为它试图找到
,而
应该在
中!不在
!因此,我们需要将所有内容从
目录移到
目录中! 之后,一切正常!我可以在其他模块中交叉加载模型,库和控制器,并且可以在视图和其他所有模块中执行Modules :: run()! 我希望这可以帮助其他人。祝好运!
邪罗逢确胃
脾萌
眠皇
宦哨抹存胳