diff --git a/conf/config.local.php b/conf/config.local.php index 1d513c6..a321ec9 100644 --- a/conf/config.local.php +++ b/conf/config.local.php @@ -8,7 +8,7 @@ * * Pour ajouter des configurations personnelles à votre instance et les garder, * lisez attentivement ce fichier, puis ajoutez les constantes commentées nécessaires - * dans le fichier '$data_dir/data/config.local.user.php'. + * dans le fichier __DATA_DIR__/data/config.local.user.php. */ // Nécessaire pour situer les constantes dans le bon namespace diff --git a/conf/config.local.user.php b/conf/config.local.user.php index 9eff67f..88e4072 100644 --- a/conf/config.local.user.php +++ b/conf/config.local.user.php @@ -1,9 +1,11 @@ +> $install_dir/config.local.php -fi #================================================= # REAPPLY SYSTEM CONFIGURATIONS @@ -85,7 +69,22 @@ chmod 644 "/etc/cron.d/$app" # SPECIFIC UPGRADE #================================================= +# add config file if not present +if [ ! -f "$data_dir/data/config.local.user.php" ]; then + ynh_script_progression --message="Adding a configuration file..." --weight=5 + + ynh_script_progression --message=" files..." --weight=5 + ynh_add_config --template="config.local.user.php" --destination="$data_dir/data/config.local.user.php" + chmod 650 "$data_dir/data/config.local.user.php" + chown $app:$app "$data_dir/data/config.local.user.php" + echo " +/** + * Chemin vers le fichier pour des configurations personnelles + * qui ne sera pas écraser lors des mises à jour. + */ +require '$data_dir/data/config.local.user.php';" >> $install_dir/config.local.php +fi #================================================= # END OF SCRIPT