1 2 3 4 5 6 7 8 9 10 11
<?php class Config{ function __construct($base_path, $config_filename){ $handle = fopen($base_path.'/'.$config_filename, "r"); while (($line = fgets($handle)) !== false) { putenv(trim(preg_replace('/\s+/', ' ', $line))); } fclose($handle); } } ?>