Internal: Rename .env to .env.dist. Developers should rename their .env.local to .env

pull/4969/head
Yannick Warnier 2 years ago
parent 7524294862
commit d7e88b453f
  1. 0
      .env.dist
  2. 16
      public/main/install/index.php
  3. 6
      public/main/install/install.lib.php
  4. 2
      webpack.config.js

@ -46,8 +46,8 @@ api_check_php_version();
ob_implicit_flush();
Debug::enable();
// Create .env.local file
/*$envFile = api_get_path(SYMFONY_SYS_PATH).'.env.local';
// Create .env file
/*$envFile = api_get_path(SYMFONY_SYS_PATH).'.env';
if (file_exists($envFile)) {
echo "Chamilo is already installed. File $envFile exists.";
exit;
@ -466,9 +466,9 @@ if (isset($_POST['step2'])) {
if (!$isUpdateAvailable) {
$installType = 'update';
// Create .env.local file
$envFile = api_get_path(SYMFONY_SYS_PATH) . '.env.local';
$distFile = api_get_path(SYMFONY_SYS_PATH) . '.env';
// Create .env file
$envFile = api_get_path(SYMFONY_SYS_PATH) . '.env';
$distFile = api_get_path(SYMFONY_SYS_PATH) . '.env.dist';
$params = [
'{{DATABASE_HOST}}' => $dbHostForm,
'{{DATABASE_PORT}}' => $dbPortForm,
@ -554,9 +554,9 @@ if (isset($_POST['step2'])) {
);
$manager = Database::getManager();
// Create .env.local file
$envFile = api_get_path(SYMFONY_SYS_PATH).'.env.local';
$distFile = api_get_path(SYMFONY_SYS_PATH).'.env';
// Create .env file
$envFile = api_get_path(SYMFONY_SYS_PATH).'.env';
$distFile = api_get_path(SYMFONY_SYS_PATH).'.env.dist';
$params = [
'{{DATABASE_HOST}}' => $dbHostForm,

@ -725,8 +725,8 @@ function display_requirements(
'status' => is_writable($basePath.'var'),
];
$pathPermissions[] = [
'item' => $basePath.'.env.local',
'status' => checkCanCreateFile($basePath.'.env.local'),
'item' => $basePath.'.env',
'status' => checkCanCreateFile($basePath.'.env'),
];
$pathPermissions[] = [
'item' => $basePath.'config/',
@ -1386,7 +1386,7 @@ function updateEnvFile($distFile, $envFile, $params)
foreach ($requirements as $requirement) {
if (!isset($params['{{'.$requirement.'}}'])) {
throw new \Exception("The parameter $requirement is needed in order to edit the .env.local file");
throw new \Exception("The parameter $requirement is needed in order to edit the .env file");
}
}

@ -104,7 +104,7 @@ Encore
])
// define the environment variables
/*.configureDefinePlugin(options => {
const env = dotEnv.config({ path: '.env.local' });
const env = dotEnv.config({ path: '.env' });
if (env.parsed) {
options['process.env'].APP_API_PLATFORM_URL = JSON.stringify(env.parsed.APP_API_PLATFORM_URL);
}

Loading…
Cancel
Save