Welcome Guest, Not a member yet? Register   Sign In
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




Theme © iAndrew 2016 - Forum software by © MyBB