Private GIT

Skip to content
Snippets Groups Projects
Unverified Commit 0ba2fd95 authored by Gary Allan's avatar Gary Allan
Browse files

Docker: Add IPAM_CONFIG_FILE config.php env

parent 47c10491
Branches
No related tags found
No related merge requests found
......@@ -13,12 +13,27 @@ class Config {
*/
private static $config = null;
/**
* Return path of config.php
*
* @return string
*/
private static function config_file_path() {
// IPAM_CONFIG_FILE, alternative config.php location
$alt_file = getenv('IPAM_CONFIG_FILE');
if (is_string($alt_file) && preg_match('/\.php$/', $alt_file) && is_readable($alt_file)) {
return $alt_file;
}
return dirname(__FILE__) . "/../../config.php";
}
/**
* Read config.php info self::$config
* @return void
*/
private static function read_config() {
require( dirname(__FILE__)."/../../config.php" );
require(self::config_file_path());
self::$config = (object) get_defined_vars();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment