public static function loadConfig(array $config, $envPath = null)
{
$envPath = $envPath !== null ? $envPath : getcwd();
$result = self::loadDotEnv($envPath);
// If the .env load failed, use the config given
if ($result === false) {
if (empty($config)) {
throw new \InvalidArgumentException('Configuration values must be defined!');
}
$result = $config;
}
self::setConfig($result);
return $result;
}