Compare commits
6 Commits
b122288127
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
be5a2b84a8
|
|||
|
312826259e
|
|||
|
7ea8d14689
|
|||
|
38a732de6d
|
|||
|
1c2c25f45b
|
|||
|
1ce75c2c9c
|
@@ -11,6 +11,33 @@ final class MDImporterMissingConcordance extends Exception {
|
||||
|
||||
/** @var array<string, array<string>> */
|
||||
private static array $_missing_concordances = [];
|
||||
public static bool $suppress_shutdown_function = false;
|
||||
private static bool $_shutdown_function_registered = false;
|
||||
|
||||
/**
|
||||
* Gets the text for registering shutdown functions.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public static function getCleanMissingConcordanceReport():string {
|
||||
|
||||
if (empty(self::$_missing_concordances)) return '';
|
||||
|
||||
|
||||
$output = PHP_EOL . PHP_EOL . "There are unmapped concordances. Please map them before proceeding." . PHP_EOL . "You may use https://concordance.museum-digital.org/ to do the mapping" . PHP_EOL . PHP_EOL;
|
||||
foreach (self::$_missing_concordances as $key => $values) {
|
||||
sort($values);
|
||||
$output .= PHP_EOL . PHP_EOL . $key . PHP_EOL . PHP_EOL;
|
||||
$output .= implode(PHP_EOL, array_unique($values));
|
||||
}
|
||||
$output .= PHP_EOL;
|
||||
|
||||
// Reset missing concordance report.
|
||||
self::$_missing_concordances = [];
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets up an error.
|
||||
@@ -24,17 +51,14 @@ final class MDImporterMissingConcordance extends Exception {
|
||||
|
||||
if (class_exists("MD_IMPORTER_CONF") && MD_IMPORTER_CONF::$dry_run === true) {
|
||||
|
||||
if (empty(self::$_missing_concordances)) {
|
||||
if (self::$_shutdown_function_registered === false) {
|
||||
|
||||
// Register printing at the end
|
||||
register_shutdown_function(function() {
|
||||
echo PHP_EOL . PHP_EOL . "There are unmapped concordances. Please map them before proceeding." . PHP_EOL . "You may use https://concordance.museum-digital.org/ to do the mapping" . PHP_EOL . PHP_EOL;
|
||||
foreach (self::$_missing_concordances as $key => $values) {
|
||||
sort($values);
|
||||
echo PHP_EOL . PHP_EOL . $key . PHP_EOL . PHP_EOL;
|
||||
echo implode(PHP_EOL, array_unique($values));
|
||||
}
|
||||
if (self::$suppress_shutdown_function === true) return;
|
||||
echo self::getCleanMissingConcordanceReport();
|
||||
});
|
||||
self::$_shutdown_function_registered = true;
|
||||
|
||||
}
|
||||
|
||||
@@ -46,7 +70,7 @@ final class MDImporterMissingConcordance extends Exception {
|
||||
|
||||
}
|
||||
|
||||
$exception = new MDImporterMissingConcordance("Unmapped specific value of type " . $target_type . ": " . $value_to_map . PHP_EOL . "Please consult https://concordance.museum-digital.org for filling out missing concordances");
|
||||
$exception = new MDImporterMissingConcordance("Unmapped specific value of type " . $target_type . ": '" . $value_to_map . '\'' . PHP_EOL . "Please consult https://concordance.museum-digital.org for filling out missing concordances");
|
||||
$exception->target_type = $target_type;
|
||||
$exception->value_to_map = $value_to_map;
|
||||
|
||||
|
||||
@@ -332,6 +332,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
|
||||
"nach" => 4,
|
||||
'Original / Vorlage' => 4,
|
||||
'Original / Vorlage zu' => 4,
|
||||
'Kopie nach / Orginal Figurengruppe' => 4,
|
||||
"Schöpfer der Vorlage" => 4,
|
||||
"Schöpferin der Vorlage" => 4,
|
||||
"Schöpfer*in der Vorlage" => 4,
|
||||
@@ -515,6 +516,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
|
||||
"Maler*in" => 9,
|
||||
'Maler/in' => 9, // painted by
|
||||
"Malerin, Grafikerin" => 9,
|
||||
"Maler (zugeschrieben)" => 9,
|
||||
"Malermeister" => 9,
|
||||
"Malermeisterin" => 9,
|
||||
"Malermeister*in" => 9,
|
||||
@@ -609,6 +611,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
|
||||
"Lithographie" => 12,
|
||||
"Lithographin" => 12,
|
||||
"Lithograph*in" => 12,
|
||||
"Lithograph & Verleger" => 12,
|
||||
"Radierer" => 12,
|
||||
"Radiererin" => 12,
|
||||
"Radierer*in" => 12,
|
||||
@@ -1026,6 +1029,7 @@ final class MDConcActor implements MDImporterConcordanceListInterface {
|
||||
"Exilpolitiker" => 23,
|
||||
'Impulsgebende Person' => 23,
|
||||
"zugeschrieben" => 23,
|
||||
"zugeschrieben an" => 23,
|
||||
|
||||
"Feldwebel" => 23,
|
||||
"Feuerwehrmann im 2. Weltkrieg" => 23,
|
||||
|
||||
@@ -102,8 +102,10 @@ final class MDConcMarkingPosition implements MDImporterConcordanceListInterface
|
||||
"unterer Bildrand rechts" => "bottom_right",
|
||||
"Bildrand rechts unten" => "bottom_right",
|
||||
"Rechts unten" => "bottom_right",
|
||||
"rechts unten" => "bottom_right",
|
||||
"Unten rechts" => "bottom_right",
|
||||
"unten rechts" => "bottom_right",
|
||||
"untenb rechts" => "bottom_right",
|
||||
|
||||
// Top Left
|
||||
"linker, oberer Bildrand" => "top_left",
|
||||
|
||||
@@ -288,6 +288,7 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
|
||||
"Beschriftung auf Schmuckrahmen (gedruckt)" => "overprint",
|
||||
"Datierung (gedruckt)" => "overprint",
|
||||
"Titel (gedruckt)" => "overprint",
|
||||
"Titel (gedruckt)" => "overprint",
|
||||
"Wappen (gedruckt)" => "overprint",
|
||||
"Widmung (gedruckt)" => "overprint",
|
||||
|
||||
@@ -355,6 +356,7 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
|
||||
"Nummer graviert, gedruckt" => "engraving",
|
||||
"eingraviert und geätzt" => "engraving",
|
||||
"Schnitt" => "engraving",
|
||||
"Beschriftung (graviert)" => "engraving",
|
||||
|
||||
# Screwed on
|
||||
"angeschraubt" => "screwed",
|
||||
@@ -385,6 +387,7 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
|
||||
"Prägung" => "embossing",
|
||||
"geflechelt" => "embossing",
|
||||
"Inschrift, geprägt" => "embossing",
|
||||
"Signatur (geprägt)" => "embossing",
|
||||
"schwarze Prägung" => "embossing",
|
||||
"aufgesetzt und genutet, eingeprägt" => "embossing",
|
||||
"mit eingeprägtem Golddruck" => "embossing",
|
||||
@@ -462,11 +465,14 @@ final class MDConcMarkingType implements MDImporterConcordanceListInterface {
|
||||
"Signatur (gemalt)" => "signature",
|
||||
"Signatur (gezeichnet)" => "signature",
|
||||
"Gez. u. gest. v. F. Foltz in Darmstadt., Andernach." => "signature",
|
||||
"Signatur mit Datierung" => "signature",
|
||||
"Signatur mit Datierung (handschriftlich)" => "signature",
|
||||
"Signatur mit Datierung (gedruckt)" => "signature",
|
||||
"Signatur mit Datierung (gemalt)" => "signature",
|
||||
"Signatur mit Datierung (gestempelt)" => "signature",
|
||||
"Signatur mit Datierung (gezeichnet)" => "signature",
|
||||
"Signatur mit Datierung (gedruckt)" => "signature",
|
||||
"Signatur und Datierung (gedruckt)" => "signature",
|
||||
"Signatur mit Datum (handschriftlich)" => "signature",
|
||||
"Signatur mit Datum (gedruckt)" => "signature",
|
||||
"Signatur mit Datum (gemalt)" => "signature",
|
||||
|
||||
Reference in New Issue
Block a user