rename database
This commit is contained in:
parent
ead284fff7
commit
6e9f30719b
@ -29,12 +29,22 @@ if (file_exists('site/data/core.json')) {
|
||||
|
||||
// Renomme les bases de données
|
||||
if ($version['core']['dataVersion'] < 12400) {
|
||||
if (file_exists('core/module/install/ressource/i18n/languages.json'))
|
||||
rename('core/module/install/ressource/i18n/languages.json', 'core/module/install/ressource/i18n/language.json');
|
||||
if (file_exists('site/data/languages.json'))
|
||||
rename('site/data/languages.json', 'site/data/language.json');
|
||||
if (file_exists('site/data/fonts.json'))
|
||||
rename('site/data/fonts.json', 'site/data/font.json');
|
||||
// Renommage les fichiers de données au pluriel
|
||||
$t = [
|
||||
'core/module/install/ressource/i18n/languages.json' => 'core/module/install/ressource/i18n/language.json',
|
||||
'site/data/languages.json' => 'site/data/language.json',
|
||||
'site/data/fonts.json' => 'site/data/font.json'
|
||||
];
|
||||
foreach ($d as $k => $v) {
|
||||
if (file_exists($k)) {
|
||||
rename($k, $v);
|
||||
$d = file_get_contents($v);
|
||||
$d = str_replace(basename($k,'.json'), basename($v, '.json'));
|
||||
file_put_contents($v);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user