A simple cached loader for PHP dotenv.
First, install Composer.
curl -sS https://getcomposer.org/installer | phpNext, add phpdotenvcache:
php composer.phar require claas/phpdotenvcache
Then, include Composer's autoloader:
require'vendor/autoload.php';Finally, you can use the PHP dotenv cache:
$dotenv = newDotenv\CachedDotenv();
$dotenv->load(__DIR__);
// Alternatively, only load to $_ENV or $_SERVER globals:// $dotenv->loadToEnv(__DIR__);// $dotenv->loadToServer(__DIR__);