CodeIgniter Forums
Twice loading config's files - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Best Practices (https://forum.codeigniter.com/forumdisplay.php?fid=12)
+--- Thread: Twice loading config's files (/showthread.php?tid=80406)



Twice loading config's files - Detest - 10-28-2021

Hello, help please

1. We traced php process which works on Code Igniter and we get data:
access("/var/www/name.com/apps_files/config/config.php", F_OK) = 0
access("/var/www/name.com/apps_files/config/production/config.php", F_OK) = -1 ENOENT (No such file or directory)

2. We fix it and created symlink /production/config.php to /config/config.php and look: is it will enought if it will find file from first time and we get next data
access("/var/www/name.com/apps_files/config/config.php", F_OK) = 0
access("/var/www/name.com/apps_files/config/production/config.php", F_OK) = 0

 Problem that core CI load twice same config file, how we can fix it? 


RE: Twice loading config's files - includebeer - 10-28-2021

It was working fine before you broke it. Of course it load twice now that you created a symlink to the same file! Why did you do that? The second file is there to set configuration for a specific environment to override the global configuration.