Welcome Guest, Not a member yet? Register   Sign In
The version 4.5.0 cause problems with loading dotEnv
#1

Hello,
I develop applications whose code is shared by multiple instances on the same platform (multiple URLs, with separate parameters for each). To do that, I've modified the index.php
code with:
Code:
if (is_file($file = $_SERVER["envPath"] . DIRECTORY_SEPARATOR . ".env") && is_readable($file)) {
    (new CodeIgniter\Config\DotEnv($_SERVER["envPath"],".env"))->load();
The envPath variable is assigned in apache2 vhost, each instance has its own vhost file.
But in the last version (4.5.0), this code as migrated to the core of CodeIgniter. If I can change the Boot.php file to insert it, a
Code:
composer upgrade
will overwrite it.
Have you a solution to avoid this overwrite?
Thanks,
Eric Q.
Reply
#2

Could you possible put the index.php code in a BaseController or use a Filter?
index.php changes often - in many CI version updates.
Mike
Reply
#3

Extend "CodeIgniter\Boot", and use your Boot in "index.php".
Reply




Theme © iAndrew 2016 - Forum software by © MyBB