• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How modules need load Config?

#1
Hello!

I install https://github.com/benedmunds/CodeIgniter-Ion-Auth/tree/4/ with composer, now I want edit IonAuth config file, but i not want edit file in vendor directory, because it not tracked with Git.

IonAuth loads config by function config('IonAuth\\Config\\IonAuth');
In autoload I setted IonAuth to COMPOSER_DIR . '/benedmunds/codeigniter-ion-auth'.

How need IonAuth loads config with two conditions:
1. If config file \App\Config\IonAuth.php exists - load it
2. If not exists - load from \IonAuth\Config\IonAuth.php

Now CI4 check config files only App and System dir.
Now if use config('IonAuth\\Config\\IonAuth') - CI4 dont see \App, but if use config('\\Config\\IonAuth'), CI4 dont see \IonAuth if \App file not exists
Reply

#2
You want the config() command, that does precisely that.

$config = config(‘IonAuth’);
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.