2023-02-10 09:58:55 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
2023-02-12 17:52:18 +01:00
|
|
|
* Mise à jour avant v12
|
2023-02-10 09:58:55 +01:00
|
|
|
* */
|
2023-02-18 08:41:01 +01:00
|
|
|
|
|
|
|
if (file_exists('site/data/core.json')) {
|
|
|
|
$version = json_decode(file_get_contents('site/data/core.json'), true);
|
|
|
|
|
2023-03-02 15:22:55 +01:00
|
|
|
// Avant version 12.0.00
|
2023-02-18 08:41:01 +01:00
|
|
|
if ($version['core']['dataVersion'] < 12000) {
|
|
|
|
// Correspondance pour les dossiers de langue à convertir
|
|
|
|
$languages = [
|
|
|
|
'fr' => 'fr_FR',
|
|
|
|
'en' => 'en_EN',
|
|
|
|
'pt' => 'pt_PT'
|
|
|
|
];
|
|
|
|
// Convertit les dossiers vers la nouvelle structure
|
|
|
|
foreach ($languages as $key => $value) {
|
|
|
|
if (
|
|
|
|
is_dir('site/data/' . $key) &&
|
|
|
|
!is_dir('site/data/' . $value)
|
|
|
|
) {
|
|
|
|
$end = rename('site/data/' . $key, 'site/data/' . $value);
|
|
|
|
}
|
2023-02-10 09:58:55 +01:00
|
|
|
}
|
2023-03-02 15:22:55 +01:00
|
|
|
sleep(1);
|
2023-02-10 09:58:55 +01:00
|
|
|
}
|
2023-03-02 15:22:55 +01:00
|
|
|
|
|
|
|
// Avant version 12.3.00
|
|
|
|
if ($version['core']['dataVersion'] < 12300) {
|
|
|
|
// Nettoyage du dossier de langue de TinyMCE
|
|
|
|
unlink('core/vendor/tinymce/langs/*.js');
|
|
|
|
unlink('core/vendor/tinymce/langs/langs.zip');
|
2023-03-04 09:52:00 +01:00
|
|
|
unlink('core/module/install/ressource/i18n/de.json');
|
|
|
|
unlink('core/module/install/ressource/i18n/it.json');
|
|
|
|
unlink('core/module/install/ressource/i18n/pt_PT.json');
|
|
|
|
unlink('core/module/install/ressource/i18n/gr_GR.json');
|
2023-03-02 15:22:55 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|