From 1c10eca976c6bcb3c11b57def3e51ff38d4045fa Mon Sep 17 00:00:00 2001 From: fredtempez Date: Thu, 7 Nov 2019 11:56:12 +0100 Subject: [PATCH] [10.0.77.dev] Import v10, nettoyage des anciens dossiers de langues --- core/core.php | 2 +- core/module/config/config.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/core.php b/core/core.php index 7fc4fedb..73e885bd 100644 --- a/core/core.php +++ b/core/core.php @@ -31,7 +31,7 @@ class common { const TEMP_DIR = 'site/tmp/'; // Numéro de version - const ZWII_VERSION = '10.0.75.dev'; + const ZWII_VERSION = '10.0.77.dev'; public static $actions = []; public static $coreModuleIds = [ diff --git a/core/module/config/config.php b/core/module/config/config.php index f066f567..5b2b63ad 100755 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -309,6 +309,16 @@ class config extends common { if ($this->getInput('configManageImportUser', helper::FILTER_BOOLEAN) === true ) { $users = $this->getData(['user']); } + // Nettoyage des dossiers de langue + foreach (self::$i18nList as $itemKey => $item) { + // Le dossier existe ? + if (is_dir(self::DATA_DIR . $itemKey) === true) { + unlink (self::DATA_DIR . $itemKey . '/module.json'); + unlink (self::DATA_DIR . $itemKey . '/page.json'); + rmdir (self::DATA_DIR . $itemKey); + } + } + } else { // Version invalide // Valeurs en sortie erreur $this->addOutput([