Skip to content
Snippets Groups Projects
Verified Commit f8c24f10 authored by Damien's avatar Damien
Browse files

FEAT #11954 TIME 0:30 Migrate extensions

parent b71f0720
No related branches found
No related tags found
No related merge requests found
...@@ -14,3 +14,4 @@ php ./removeProcessModes.php ...@@ -14,3 +14,4 @@ php ./removeProcessModes.php
php ./migrateCategories.php php ./migrateCategories.php
php ./migrateOldIndexingModels.php php ./migrateOldIndexingModels.php
php ./migrateWorkingDays.php php ./migrateWorkingDays.php
php ./migrateExtensions.php
<?php
require '../../vendor/autoload.php';
chdir('../..');
$migrated = 0;
$customs = scandir('custom');
foreach ($customs as $custom) {
if ($custom == 'custom.xml' || $custom == '.' || $custom == '..') {
continue;
}
$xmlfile = null;
$path = "custom/{$custom}/apps/maarch_entreprise/xml/extensions.xml";
if (file_exists($path)) {
$xmlfile = simplexml_load_file($path);
if ($xmlfile) {
$i = 0;
foreach ($xmlfile->FORMAT as $item) {
if (isset($item->index_frame_show)) {
$xmlfile->FORMAT[$i]->canConvert = $item->index_frame_show;
unset($xmlfile->FORMAT[$i]->index_frame_show);
}
++$i;
}
$res = $xmlfile->asXML();
$fp = fopen($path, "w+");
if ($fp) {
fwrite($fp, $res);
}
$migrated++;
}
}
}
printf("Migration Extensions : " . $migrated . " custom(s) avec un fichier extensions.xml trouvé(s) et migré(s).\n");
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment