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

FEAT #8958 TIME 0:30 Migrate remoteSignatoryBooks.xml

parent 86bcafb9
No related branches found
No related tags found
No related merge requests found
......@@ -5,3 +5,4 @@ php ./migrateExport.php
php ./migrateFeature.php
php ./migrateNewNature.php
php ./refactorPriorities.php
php ./refactorRemoteSignatoryBooks.php
<?php
chdir('../..');
$migrated = 0;
$nonReadableFiles = [];
$customs = scandir('custom');
foreach ($customs as $custom) {
if ($custom == 'custom.xml' || $custom == '.' || $custom == '..') {
continue;
}
$priorities = [];
$path = "custom/{$custom}/modules/visa/xml/remoteSignatoryBooks.xml";
if (file_exists($path)) {
if (!is_readable($path) || !is_writable($path)) {
$nonReadableFiles[] = $path;
continue;
}
$loadedXml = simplexml_load_file($path);
if ($loadedXml) {
$newSignatoryBook = $loadedXml->addChild('signatoryBook');
$newSignatoryBook->addChild('id', 'maarchParapheur');
$newSignatoryBook->addChild('userId', ' ');
$newSignatoryBook->addChild('password', ' ');
$newSignatoryBook->addChild('url', ' ');
$newSignatoryBook->addChild('signature', 'SIGN');
$newSignatoryBook->addChild('annotation', 'NOTE');
$newSignatoryBook->addChild('externalValidated', 'VAL');
$newSignatoryBook->addChild('externalRefused', 'REF');
$res = $loadedXml->asXML();
$fp = fopen($path, "w+");
if ($fp) {
fwrite($fp, $res);
}
++$migrated;
}
}
}
foreach ($nonReadableFiles as $file) {
printf("The file %s it is not readable or not writable.\n", $file);
}
printf($migrated . " custom(s) avec un fichier remoteSignatoryBooks.xml trouvé(s) et refactoré(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