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
|
// Renomme les bases de données
|
||||||
if ($version['core']['dataVersion'] < 12400) {
|
if ($version['core']['dataVersion'] < 12400) {
|
||||||
if (file_exists('core/module/install/ressource/i18n/languages.json'))
|
// Renommage les fichiers de données au pluriel
|
||||||
rename('core/module/install/ressource/i18n/languages.json', 'core/module/install/ressource/i18n/language.json');
|
$t = [
|
||||||
if (file_exists('site/data/languages.json'))
|
'core/module/install/ressource/i18n/languages.json' => 'core/module/install/ressource/i18n/language.json',
|
||||||
rename('site/data/languages.json', 'site/data/language.json');
|
'site/data/languages.json' => 'site/data/language.json',
|
||||||
if (file_exists('site/data/fonts.json'))
|
'site/data/fonts.json' => 'site/data/font.json'
|
||||||
rename('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