New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ion Auth config is being loaded twice #1000
Comments
Are you maybe autoloading it as well as loading it directly? |
@benedmunds No sir, no auto-load, but to be sure I just downloaded CI and IonAuth again for a fresh setup (nothing edited other than sess_save_path config) It is still loading twice. |
If you have two applications, does that mean that you have two ion_auth libraries installed? Or what do you mean by "two applications"? |
@avenirer @benedmunds Let's forget that (2 application) part for a second, I installed a fresh copy of CI + Ion Auth (single unmodified installation, not 2 applications) Now this config file is loaded twice (I see 2 Now is this normal? because I had heard that CI would not load things twice, and every other config file is loaded once, not sure why ion_auth config is loaded twice. And about that two applications part (which is on another installation, this loading twice happens on clean installation as I explained above) , I have this:
I just wanted to share configs between the two apps, so in I did the same for config.php and database.php , they both work fine and load once, but as Ion_auth config file is loaded twice, |
I've verified and indeed it loads twice. I will also look into it. |
further testing inside the library showed me that the first time it is loaded is not loaded by the library. If i put this in the constructor of the library: public function __construct()
{
echo '<h2>before requesting</h2>';
$this->load->config('ion_auth', TRUE);
echo '<h2>just requested</h2>';
... The resulted output is: loaded |
Looking at a library i've developed (Postal for CI), I see the same behaviour. Most likely it is because the library is calling the CI object in order to use the framework's libraries, which is also calling the libraries and configs again. |
Thank you for working on this, I also removed both config loads from library and module but it's still loading, but then even tho it's loaded, I cannot access the configs! |
@avenirer So I should close this and report it in CI? and Thanks again for investigating this. |
In my opinion it is not related to the library. You should report it to the CodeIgniter repo, but by using another library, maybe a "dummy" library which only loads a "dummy" config. |
Every config file in CodeIgniter is loaded once except for Ion Auth,
Not sure if that's Ion Auth issue or CI's.
To test simply put this in config/ion_auth and open /auth/login
echo 'loaded<br>';
I have two applications in single CI install, to separate user and admin, wanted to share Ion Auth config so did a require_once() to load users' app's config in the admins' app. that's when I realized this (it wouldn't run with require_once).
Also I am honored to post the 1000th issue here, Where can I receive my golden potato?
The text was updated successfully, but these errors were encountered: