Config files loaded twice, also How to separate Applications but share things |
Hello,
I'm using "Ion Auth". I want to have a different Application for Administration and another for Users /admin /application /system index.php (system and application folders) administration.php (system and admin folders) But I want to still use the same libraries and stuff in application folder (so when I update them, the administration area libraries/configs are also updated) For example for configs.php in admin app I did this: PHP Code: <?php I'm going to do the same for everything shared between them. I have two questions: 1. Is this the standard way of doing this (separating apps while sharing some files with require_once)? 2. require_once doesn't work! it seems config files (any new config file added to CI) are being loaded twice! and Ion Auth community thinks it's a CI issue (shouldn't CI avoid loading stuff if they are already loaded?) Issue on Github (Related to my #2 Question): https://github.com/benedmunds/CodeIgnite...ssues/1000 P.S. If you're wondering why I'm separating them, because those are 2 separate areas, I don't want any update to admin area cause unwanted issues for users or the other way around, also I can protect the administration.php file much better when it's separated, never to worry about Brute Force or anything like that.
CodeIgniter automatically loads the main config file ... https://www.codeigniter.com/user_guide/l...onfig-file
Your "require_once" conflicts with that. If you want to over-ride config items, perhaps https://www.codeigniter.com/user_guide/l...onfig-item Your admin vs application question is an entirely different issue ... I'm going to sit back and wait for the HMVC flame wars to reignite ![]()
Three application on a same platform:
https://github.com/ivantcholakov/starter...plications Common code and configuration that these applications share: https://github.com/ivantcholakov/starter...orm/common Good enough? You need to integrate Ion Auth alone though. (04-09-2017, 11:03 AM)ciadmin Wrote: CodeIgniter automatically loads the main config file ... https://www.codeigniter.com/user_guide/l...onfig-file Thank you for replying, So basically my assumption that CI checks if a config file is already loaded to prevent loading it again is wrong. (04-09-2017, 11:59 AM)ivantcholakov Wrote: Three application on a same platform: Thank you, Awesome Examples. |
Welcome Guest, Not a member yet? Register Sign In |