mirror of
https://github.com/RaspbianFrance/raspisms.git
synced 2025-06-06 14:46:27 +02:00
first refonte
This commit is contained in:
commit
9e9cd47b91
226 changed files with 34307 additions and 0 deletions
49
descartes/load-environment.php
Executable file
49
descartes/load-environment.php
Executable file
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
|
||||
function load_env ()
|
||||
{
|
||||
$environment = [];
|
||||
$env = [];
|
||||
|
||||
//Load descartes global env
|
||||
require_once(__DIR__ . '/env.php');
|
||||
$environment = array_merge($environment, $env);
|
||||
|
||||
//Load descartes override env
|
||||
if (file_exists(__DIR__ . '/../env.descartes.php'))
|
||||
{
|
||||
require_once(__DIR__ . '/../env.descartes.php');
|
||||
$environment = array_merge($environment, $env);
|
||||
}
|
||||
|
||||
//Load user defined global env
|
||||
if (file_exists(__DIR__ . '/../env.php'))
|
||||
{
|
||||
require_once(__DIR__ . '/../env.php');
|
||||
$environment = array_merge($environment, $env);
|
||||
}
|
||||
|
||||
//Define all constants
|
||||
foreach ($environment as $name => $value)
|
||||
{
|
||||
define(mb_strtoupper($name), $value);
|
||||
}
|
||||
|
||||
//Load user defined env specific env
|
||||
$environment = [];
|
||||
$env = [];
|
||||
|
||||
if (defined('ENV') && file_exists(__DIR__ . '/../env.' . ENV . '.php'))
|
||||
{
|
||||
require_once(__DIR__ . '/../env.' . ENV . '.php');
|
||||
$environment = array_merge($environment, $env);
|
||||
}
|
||||
|
||||
//Define env specific constants
|
||||
foreach ($environment as $name => $value)
|
||||
{
|
||||
define(mb_strtoupper($name), $value);
|
||||
}
|
||||
}
|
||||
|
||||
load_env();
|
Loading…
Add table
Add a link
Reference in a new issue