Why is my config item not populating from my getenv() entry in codeigniter?
<p>I am using phpdotenv with Codeigniter. Codeigniter's environment setup doesn't quite work for this project.</p>

<p>I'm trying to set this in my config.php file:</p>

<pre><code>$config['site_id'] = getenv('APP_ID');
</code></pre>

<p>phpdotenv is being loaded via the pre_system hook and getenv('APP_ID') is available throughout the app. I've also checked in the core and this fires well before loading config items.</p>

<pre><code>$hook['pre_system'] = function() {
 $dotenv = new Dotenv\Dotenv(APPPATH);
 $dotenv-&gt;load();
};
</code></pre>

<p>The value of <code>$this-config-&gt;item('site_id')</code> is always <code>NULL</code></p>

<p>Any advice as to why this is happening would be really appreciated.</p>

<p>Thanks in advance.</p>