private static function ensureBaseConfig() { if (self::$baseConfig === null) { require_once dirname(__FILE__) . "/Config.php"; if ($config["ConfigPath"] !== "") { $configPath = $config["ConfigPath"]; $configPath = ($configPath[0] !== "/" ? dirname(__FILE__) . "/" : "") . $configPath; // Turn into absolute path if relative path was specified $configPath = $configPath[strlen($configPath) - 1] === "/" ? substr($configPath, 0, -1) : $configPath; // Remove trailing slash if defined $configFile = $configPath . "/Config.php"; if (file_exists($configFile) === false) { throw new Exception("PSPI configuration file '" . $configFile . "' not found"); } require_once $configFile; $config["ConfigPath"] = $configPath; } self::$baseConfig = $config; } }