$debugKey =
$options['debug_var_name'
] ??= 'APP_DEBUG';
if (isset($options['env'
])) { $_SERVER[$envKey] =
$options['env'
];
} elseif (isset($_SERVER['argv'
]) &&
class_exists(ArgvInput::
class)) { $this->options =
$options;
$this->
getInput();
} if (!
($options['disable_dotenv'
] ?? false
) &&
isset($options['project_dir'
]) && !
class_exists(MissingDotenv::
class, false
)) { (new Dotenv($envKey,
$debugKey)) ->
setProdEnvs((array) ($options['prod_envs'
] ??
['prod'
])) ->
usePutenv($options['use_putenv'
] ?? false
) ->
bootEnv($options['project_dir'
].'/'.
($options['dotenv_path'
] ?? '.env'
), 'dev',
(array) ($options['test_envs'
] ??
['test'
]),
$options['dotenv_overload'
] ?? false
);
if (isset($this->input
) && ($options['dotenv_overload'
] ?? false
)) { if ($this->input->
getParameterOption(['--env', '-e'
],
$_SERVER[$envKey], true
) !==
$_SERVER[$envKey]) { throw new \
LogicException(sprintf('Cannot use "--env" or "-e" when the "%s" file defines "%s" and the "dotenv_overload" runtime option is true.',
$options['dotenv_path'
] ?? '.env',
$envKey));
} if ($_SERVER[$debugKey] &&
$this->input->
hasParameterOption('--no-debug', true
)) { putenv($debugKey.'='.
$_SERVER[$debugKey] =
$_ENV[$debugKey] = '0'
);
} }