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

FEAT #10387 TIME 0:30 Refactor priorities from entreprise.xml

parent b7144c0f
No related branches found
No related tags found
No related merge requests found
......@@ -3,3 +3,4 @@ php ./migrateSendmail.php
php ./migrateExport.php
php ./migrateFeature.php
php ./migrateNewNature.php
php ./refactorPriorities.php
<?php
chdir('../..');
$nonReadableFiles = [];
$customs = scandir('custom');
foreach ($customs as $custom) {
if ($custom == 'custom.xml' || $custom == '.' || $custom == '..') {
continue;
}
$priorities = [];
$path = "custom/{$custom}/apps/maarch_entreprise/xml/entreprise.xml";
if (file_exists($path)) {
if (!is_readable($path) || !is_writable($path)) {
$nonReadableFiles[] = $path;
continue;
}
$loadedXml = simplexml_load_file($path);
if ($loadedXml) {
unset($loadedXml->priorities);
$res = $loadedXml->asXML();
$fp = fopen($path, "w+");
if ($fp) {
fwrite($fp, $res);
}
}
}
}
foreach ($nonReadableFiles as $file) {
printf("The file %s it is not readable or not writable.\n", $file);
}
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