Remove superfluous variable assignments
This commit is contained in:
parent
7c0ad9fa37
commit
5819caff91
@ -66,7 +66,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$persinstRewriteResult->close();
|
||||
$persinstRewriteResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -98,7 +97,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$persinstByTLNameResult->close();
|
||||
$persinstByTLNameResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -130,7 +128,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$persinstByBaseNameResult->close();
|
||||
$persinstByBaseNameResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -162,7 +159,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -199,7 +195,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$persinstByImportLogResult->close();
|
||||
$persinstByImportLogResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -260,7 +255,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$placeRewriteResult->close();
|
||||
$placeRewriteResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -290,7 +284,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$placeByBaseNameResult->close();
|
||||
$placeByBaseNameResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -322,7 +315,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$placeByTLNameResult->close();
|
||||
$placeByTLNameResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -354,7 +346,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$placeByNodaResult->close();
|
||||
$placeByNodaResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -388,7 +379,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$placeByImportLogResult->close();
|
||||
$placeByImportLogResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -449,7 +439,6 @@ final class NodaIDGetter {
|
||||
}
|
||||
|
||||
$tagRewriteResult->close();
|
||||
$tagRewriteResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -479,7 +468,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$tagByBaseNameResult->close();
|
||||
$tagByBaseNameResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -511,7 +499,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$tagByTLNameResult->close();
|
||||
$tagByTLNameResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -543,7 +530,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$tagByNodaResult->close();
|
||||
$tagByNodaResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -577,7 +563,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$tagByImportLogResult->close();
|
||||
$tagByImportLogResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -636,7 +621,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$timeByBaseNameResult->close();
|
||||
$timeByBaseNameResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -668,7 +652,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$timeByTLNameResult->close();
|
||||
$timeByTLNameResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -702,7 +685,6 @@ final class NodaIDGetter {
|
||||
else $output = 0;
|
||||
|
||||
$timeByImportLogResult->close();
|
||||
$timeByImportLogResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
|
@ -89,7 +89,6 @@ final class NodaLogEdit {
|
||||
$insertStmt->bind_param("issss", $tag_id, $tool_name, $user_name, $action, $section);
|
||||
$insertStmt->execute();
|
||||
$insertStmt->close();
|
||||
$insertStmt = null;
|
||||
|
||||
// Update the main tag table, except for edits to the base,
|
||||
// as these have built-in updating and updating in this case
|
||||
@ -103,7 +102,6 @@ final class NodaLogEdit {
|
||||
$updateStmt->bind_param("si", $user_name, $tag_id);
|
||||
$updateStmt->execute();
|
||||
$updateStmt->close();
|
||||
$updateStmt = null;
|
||||
|
||||
}
|
||||
|
||||
@ -134,7 +132,6 @@ final class NodaLogEdit {
|
||||
$insertStmt->bind_param("issss", $persinst_id, $tool_name, $user_name, $action, $section);
|
||||
$insertStmt->execute();
|
||||
$insertStmt->close();
|
||||
$insertStmt = null;
|
||||
|
||||
}
|
||||
|
||||
@ -163,7 +160,6 @@ final class NodaLogEdit {
|
||||
$insertStmt->bind_param("issss", $zeit_id, $tool_name, $user_name, $action, $section);
|
||||
$insertStmt->execute();
|
||||
$insertStmt->close();
|
||||
$insertStmt = null;
|
||||
|
||||
}
|
||||
|
||||
@ -192,7 +188,6 @@ final class NodaLogEdit {
|
||||
$insertStmt->bind_param("issss", $ort_id, $tool_name, $user_name, $action, $section);
|
||||
$insertStmt->execute();
|
||||
$insertStmt->close();
|
||||
$insertStmt = null;
|
||||
|
||||
// Update the main tag table, except for edits to the base,
|
||||
// as these have built-in updating and updating in this case
|
||||
@ -206,7 +201,6 @@ final class NodaLogEdit {
|
||||
$updateStmt->bind_param("si", $user_name, $ort_id);
|
||||
$updateStmt->execute();
|
||||
$updateStmt->close();
|
||||
$updateStmt = null;
|
||||
|
||||
}
|
||||
|
||||
|
@ -29,11 +29,10 @@ final class NodaNameGetter {
|
||||
WHERE `trans_language` = '" . $mysqli_noda->escape_string($lang) . "'
|
||||
AND `tag_id` IN (" . implode(', ', $tag_ids) . ")");
|
||||
|
||||
while ($cur = $result->fetch_assoc()) {
|
||||
$output[(int)$cur['tag_id']] = (string)$cur['trans_name'];
|
||||
while ($cur = $result->fetch_row()) {
|
||||
$output[(int)$cur[0]] = (string)$cur[1];
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
if (!empty($tag_ids_left = array_diff($tag_ids, array_keys($output)))) {
|
||||
|
||||
@ -41,11 +40,10 @@ final class NodaNameGetter {
|
||||
FROM `tag`
|
||||
WHERE `tag_id` IN (" . implode(', ', $tag_ids_left) . ")");
|
||||
|
||||
while ($cur = $result->fetch_assoc()) {
|
||||
$output[(int)$cur['tag_id']] = (string)$cur['tag_name'];
|
||||
while ($cur = $result->fetch_row()) {
|
||||
$output[(int)$cur[0]] = (string)$cur[1];
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
}
|
||||
|
||||
@ -76,11 +74,10 @@ final class NodaNameGetter {
|
||||
WHERE `trans_language` = '" . $mysqli_noda->escape_string($lang) . "'
|
||||
AND `ort_id` IN (" . implode(', ', $place_ids) . ")");
|
||||
|
||||
while ($cur = $result->fetch_assoc()) {
|
||||
$output[(int)$cur['ort_id']] = (string)$cur['trans_name'];
|
||||
while ($cur = $result->fetch_row()) {
|
||||
$output[(int)$cur[0]] = (string)$cur[1];
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
if (!empty($place_ids_left = array_diff($place_ids, array_keys($output)))) {
|
||||
|
||||
@ -88,11 +85,10 @@ final class NodaNameGetter {
|
||||
FROM `orte`
|
||||
WHERE `ort_id` IN (" . implode(', ', $place_ids_left) . ")");
|
||||
|
||||
while ($cur = $result->fetch_assoc()) {
|
||||
$output[(int)$cur['ort_id']] = (string)$cur['ort_name'];
|
||||
while ($cur = $result->fetch_row()) {
|
||||
$output[(int)$cur[0]] = (string)$cur[1];
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
}
|
||||
|
||||
@ -123,22 +119,20 @@ final class NodaNameGetter {
|
||||
WHERE `trans_language` = '" . $mysqli_noda->escape_string($lang) . "'
|
||||
AND `persinst_id` IN (" . implode(', ', $persinst_ids) . ")");
|
||||
|
||||
while ($cur = $result->fetch_assoc()) {
|
||||
$output[(int)$cur['persinst_id']] = (string)$cur['trans_name'];
|
||||
while ($cur = $result->fetch_row()) {
|
||||
$output[(int)$cur[0]] = (string)$cur[1];
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
if (!empty($persinst_ids_left = array_diff($persinst_ids, array_keys($output)))) {
|
||||
$result = $mysqli_noda->do_read_query("SELECT `persinst_id`, `persinst_name_en`
|
||||
FROM `persinst`
|
||||
WHERE `persinst_id` IN (" . implode(', ', $persinst_ids_left) . ")");
|
||||
|
||||
while ($cur = $result->fetch_assoc()) {
|
||||
$output[(int)$cur['persinst_id']] = (string)$cur['persinst_name_en'];
|
||||
while ($cur = $result->fetch_row()) {
|
||||
$output[(int)$cur[0]] = (string)$cur[1];
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
}
|
||||
|
||||
if (count($output) > 1) {
|
||||
@ -168,11 +162,10 @@ final class NodaNameGetter {
|
||||
WHERE `trans_language` = '" . $mysqli_noda->escape_string($lang) . "'
|
||||
AND `zeit_id` IN (" . implode(', ', $time_ids) . ")");
|
||||
|
||||
while ($cur = $result->fetch_assoc()) {
|
||||
$output[(int)$cur['zeit_id']] = (string)$cur['trans_name'];
|
||||
while ($cur = $result->fetch_row()) {
|
||||
$output[(int)$cur[0]] = (string)$cur[1];
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
if (!empty($time_ids_left = array_diff($time_ids, array_keys($output)))) {
|
||||
|
||||
@ -180,11 +173,10 @@ final class NodaNameGetter {
|
||||
FROM `zeiten`
|
||||
WHERE `zeit_id` IN (" . implode(', ', $time_ids_left) . ")");
|
||||
|
||||
while ($cur = $result->fetch_assoc()) {
|
||||
$output[(int)$cur['zeit_id']] = (string)$cur['zeit_name'];
|
||||
while ($cur = $result->fetch_row()) {
|
||||
$output[(int)$cur[0]] = (string)$cur[1];
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
}
|
||||
|
||||
@ -207,8 +199,6 @@ final class NodaNameGetter {
|
||||
*/
|
||||
public static function getTagName(MDMysqli $mysqli_noda, string $lang, int $tag_id):string {
|
||||
|
||||
$output = [];
|
||||
|
||||
// Get translations
|
||||
$result = $mysqli_noda->query_by_stmt("SELECT `trans_name`
|
||||
FROM `tag_translation`
|
||||
|
@ -5,7 +5,6 @@
|
||||
* @author Joshua Ramon Enslin <joshua@museum-digital.de>
|
||||
*/
|
||||
declare(strict_types = 1);
|
||||
require_once __DIR__ . '/inc/datesByCountry.php';
|
||||
|
||||
/**
|
||||
* Autotranslater class for times.
|
||||
@ -121,14 +120,14 @@ final class NodaTimeAutotranslater {
|
||||
public static function getSuffixModeForYearsWSuffix(int $start, int $end):NodaTimeAutotranslaterSuffixMode {
|
||||
|
||||
if ($start < 0 && $end < 0) {
|
||||
$suffixMode = NodaTimeAutotranslaterSuffixMode::BCE; // 2; // " v. Chr.";
|
||||
return NodaTimeAutotranslaterSuffixMode::BCE; // 2; // " v. Chr.";
|
||||
}
|
||||
else if ($end < 1000) {
|
||||
$suffixMode = NodaTimeAutotranslaterSuffixMode::CE; // " n. Chr.";
|
||||
return NodaTimeAutotranslaterSuffixMode::CE; // " n. Chr.";
|
||||
}
|
||||
else {
|
||||
return NodaTimeAutotranslaterSuffixMode::ANY; // Times larger than 1000 n. Chr.
|
||||
}
|
||||
else $suffixMode = NodaTimeAutotranslaterSuffixMode::ANY; // Times larger than 1000 n. Chr.
|
||||
|
||||
return $suffixMode;
|
||||
|
||||
}
|
||||
|
||||
@ -370,7 +369,7 @@ final class NodaTimeAutotranslater {
|
||||
*/
|
||||
public static function translateYearsSinceStart(array $timeInfo):array {
|
||||
|
||||
$start = \intval($timeInfo['zeit_beginn']);
|
||||
// $start = \intval($timeInfo['zeit_beginn']);
|
||||
|
||||
if (substr((string)$timeInfo['zeit_name'], 0, 5) === "Nach ") {
|
||||
return self::translateYearsAfterStart($timeInfo);
|
||||
@ -407,7 +406,7 @@ final class NodaTimeAutotranslater {
|
||||
if (empty(\trim((string)$timeInfo['zeit_zaehlzeit_monat'], " ,.;0"))) {
|
||||
$timeInfo['zeit_ende'] = \strval(\intval($timeInfo['zeit_ende']) + 1);
|
||||
}
|
||||
$end = \intval($timeInfo['zeit_ende']);
|
||||
// $end = \intval($timeInfo['zeit_ende']);
|
||||
|
||||
$innerTimeInfo = $timeInfo;
|
||||
$innerTimeInfo['zeit_beginn'] = $timeInfo['zeit_ende'];
|
||||
@ -438,7 +437,7 @@ final class NodaTimeAutotranslater {
|
||||
*/
|
||||
public static function translateYearsUntilEnd(array $timeInfo):array {
|
||||
|
||||
$end = \intval($timeInfo['zeit_ende']);
|
||||
// $end = \intval($timeInfo['zeit_ende']);
|
||||
|
||||
if (substr((string)$timeInfo['zeit_name'], 0, 4) === "Vor ") {
|
||||
return self::translateYearsBeforeEnd($timeInfo);
|
||||
|
@ -1086,7 +1086,7 @@ final class NodaTimeSplitter {
|
||||
if (strlen($start_name) === 9 and substr($start_name, 4, 1) === '-') $start_name = substr($start_name, 0, 4);
|
||||
if (strlen($end_name) === 9 and substr($end_name, 4, 1) === '-') $end_name = substr($end_name, 5, 4);
|
||||
|
||||
$output = [
|
||||
return [
|
||||
"start_name" => $start_name,
|
||||
"end_name" => $end_name,
|
||||
"start_year" => $start[0],
|
||||
@ -1097,8 +1097,6 @@ final class NodaTimeSplitter {
|
||||
"counting_time_bcce" => "+",
|
||||
];
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -269,15 +269,13 @@ final class NodaWikidataFetcher {
|
||||
|
||||
}
|
||||
|
||||
$sparqlQueryString = 'SELECT ?id ?idLabel WHERE {
|
||||
return 'SELECT ?id ?idLabel WHERE {
|
||||
?id wdt:' . $repoPId . ' "' . $externalId . '".
|
||||
SERVICE wikibase:label {
|
||||
bd:serviceParam wikibase:language "en" .
|
||||
}
|
||||
}';
|
||||
|
||||
return $sparqlQueryString;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@ -566,22 +564,25 @@ final class NodaWikidataFetcher {
|
||||
FROM `persinst`
|
||||
WHERE `persinst_id` = ?", "i", $persinst_id);
|
||||
|
||||
if (!($cinfo = $cergebnis->fetch_row())) {
|
||||
throw new Exception("There is no actor of ID #" . $persinst_id);
|
||||
}
|
||||
$cergebnis->close();
|
||||
|
||||
$persinst_kurzinfo = $cinfo[0];
|
||||
$display_name = $cinfo[1];
|
||||
|
||||
// Update persinst table
|
||||
$updatePersinstStmt = $this->_mysqli_noda->do_prepare("UPDATE `persinst`
|
||||
SET `persinst_kurzinfo` = ?
|
||||
WHERE `persinst_id` = ?");
|
||||
|
||||
if ($cergebnis->num_rows === 0) {
|
||||
throw new Exception("There is no actor of ID #" . $persinst_id);
|
||||
}
|
||||
|
||||
$cinfo = $cergebnis->fetch_assoc();
|
||||
if (!empty($cinfo['persinst_kurzinfo']) and substr($cinfo['persinst_kurzinfo'], 0, 3) !== 'GND') {
|
||||
if (!empty($persinst_kurzinfo) and substr($persinst_kurzinfo, 0, 3) !== 'GND') {
|
||||
|
||||
switch ($this->_retrievalMode) {
|
||||
case "add":
|
||||
|
||||
$newDesc = $cinfo['persinst_kurzinfo'] . PHP_EOL . PHP_EOL . $datafromwiki;
|
||||
$newDesc = $persinst_kurzinfo . PHP_EOL . PHP_EOL . $datafromwiki;
|
||||
|
||||
$updatePersinstStmt->bind_param("si", $newDesc, $persinst_id);
|
||||
$updatePersinstStmt->execute();
|
||||
@ -589,7 +590,6 @@ final class NodaWikidataFetcher {
|
||||
break;
|
||||
|
||||
case "keep":
|
||||
$newDesc = $cinfo['persinst_kurzinfo'];
|
||||
break;
|
||||
|
||||
case "replace":
|
||||
@ -603,12 +603,12 @@ final class NodaWikidataFetcher {
|
||||
|
||||
$tlLoader = new MDTlLoader("wiki_getter_persinst", $preflang);
|
||||
echo self::generateHTMLHeadForWikidataFetcher($lang);
|
||||
echo self::generateWikidataFetcherHeader($tlLoader, "", $cinfo['display_name']);
|
||||
echo self::generateWikidataFetcherHeader($tlLoader, "", $display_name);
|
||||
echo '
|
||||
<p class="alert icons iconsAlert">Es gibt schon einen Eintrag im Beschreibungsfeld</p>
|
||||
<div class="wikiReplaceTTile">
|
||||
<h3>Bisher vorhanden</h3>
|
||||
<p>' . nl2br($cinfo['persinst_kurzinfo']) . '</p>
|
||||
<p>' . nl2br($persinst_kurzinfo) . '</p>
|
||||
</div>
|
||||
<div class="wikiReplaceTTile">
|
||||
<h3>Jetzt gefunden</h3><p>' . $datafromwiki . '</p>
|
||||
@ -630,8 +630,6 @@ final class NodaWikidataFetcher {
|
||||
$output = true;
|
||||
|
||||
}
|
||||
|
||||
$cergebnis->close();
|
||||
$updatePersinstStmt->close();
|
||||
|
||||
// Set link to Wikipedia in noda table
|
||||
@ -653,7 +651,6 @@ final class NodaWikidataFetcher {
|
||||
$updatePersinstEditInfoStmt->bind_param("si", $erfasst_von, $persinst_id);
|
||||
$updatePersinstEditInfoStmt->execute();
|
||||
$updatePersinstEditInfoStmt->close();
|
||||
$updatePersinstEditInfoStmt = null;
|
||||
|
||||
return $output;
|
||||
|
||||
@ -677,7 +674,6 @@ final class NodaWikidataFetcher {
|
||||
throw new MDmainEntityNotExistentException("Failed to fetch actor information");
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
if ($actor_dates['persinst_geburtsjahr'] === '') {
|
||||
|
||||
@ -698,7 +694,6 @@ final class NodaWikidataFetcher {
|
||||
$updateStmt->bind_param("ii", $birth_date, $persinst_id);
|
||||
$updateStmt->execute();
|
||||
$updateStmt->close();
|
||||
$updateStmt = null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -718,7 +713,6 @@ final class NodaWikidataFetcher {
|
||||
$updateStmt->bind_param("ii", $death_date, $persinst_id);
|
||||
$updateStmt->execute();
|
||||
$updateStmt->close();
|
||||
$updateStmt = null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -755,7 +749,6 @@ final class NodaWikidataFetcher {
|
||||
$updateStmt->bind_param("si", $wikidata_gender, $persinst_id);
|
||||
$updateStmt->execute();
|
||||
$updateStmt->close();
|
||||
$updateStmt = null;
|
||||
}
|
||||
|
||||
}
|
||||
@ -901,8 +894,6 @@ final class NodaWikidataFetcher {
|
||||
|
||||
if (!empty($languagesToFetch[$lang]) && !empty($data['sitelinks'][$lang . 'wiki'])) {
|
||||
|
||||
$url = $languagesToFetch[$lang];
|
||||
|
||||
$wikilink = $wikilinks[$lang];
|
||||
if (!empty($contents[$lang])) {
|
||||
|
||||
@ -1060,11 +1051,9 @@ final class NodaWikidataFetcher {
|
||||
LIMIT 1", "i", $onum);
|
||||
if ($result->num_rows !== 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
// If there is no superordinate, check if the identified superordinate
|
||||
// is known in the noda DB.
|
||||
@ -1078,11 +1067,9 @@ final class NodaWikidataFetcher {
|
||||
|
||||
if (!($superordinateData = $result->fetch_row())) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$topPlaceId = $superordinateData[0];
|
||||
|
||||
@ -1094,7 +1081,6 @@ final class NodaWikidataFetcher {
|
||||
$insertStmt->bind_param("ii", $topPlaceId, $onum);
|
||||
$insertStmt->execute();
|
||||
$insertStmt->close();
|
||||
$insertStmt = null;
|
||||
|
||||
}
|
||||
|
||||
@ -1281,8 +1267,6 @@ final class NodaWikidataFetcher {
|
||||
|
||||
if (!empty($languagesToFetch[$lang]) && !empty($data['sitelinks'][$lang . 'wiki'])) {
|
||||
|
||||
$url = $languagesToFetch[$lang];
|
||||
|
||||
$wikilink = $wikilinks[$lang];
|
||||
if (!empty($contents[$lang])) {
|
||||
|
||||
@ -1364,14 +1348,13 @@ final class NodaWikidataFetcher {
|
||||
FROM `tag`
|
||||
WHERE `tag_id` = ?", "i", $tag_id);
|
||||
|
||||
if (!($cinfo = $cergebnis->fetch_assoc())) {
|
||||
if (!($cinfo = $cergebnis->fetch_row())) {
|
||||
$cergebnis->close();
|
||||
$cergebnis = null;
|
||||
return $output;
|
||||
}
|
||||
|
||||
$cergebnis->close();
|
||||
$cergebnis = null;
|
||||
|
||||
$tag_anmerkung = $cinfo[0];
|
||||
|
||||
$this->_mysqli_noda->autocommit(false);
|
||||
|
||||
@ -1379,12 +1362,12 @@ final class NodaWikidataFetcher {
|
||||
SET `tag_anmerkung` = ?
|
||||
WHERE `tag_id` = ?");
|
||||
|
||||
if (!empty($cinfo['tag_anmerkung']) and substr($cinfo['tag_anmerkung'], 0, 3) !== 'GND') {
|
||||
if (!empty($tag_anmerkung) and substr($tag_anmerkung, 0, 3) !== 'GND') {
|
||||
|
||||
switch ($this->_retrievalMode) {
|
||||
case "add":
|
||||
|
||||
$newDesc = $cinfo['tag_anmerkung'] . PHP_EOL . PHP_EOL . $datafromwiki;
|
||||
$newDesc = $tag_anmerkung . PHP_EOL . PHP_EOL . $datafromwiki;
|
||||
|
||||
$updateTagDescStmt->bind_param("si", $newDesc, $tag_id);
|
||||
$updateTagDescStmt->execute();
|
||||
@ -1392,7 +1375,6 @@ final class NodaWikidataFetcher {
|
||||
break;
|
||||
|
||||
case "keep":
|
||||
$newDesc = $cinfo['tag_anmerkung'];
|
||||
break;
|
||||
|
||||
case "replace":
|
||||
@ -1410,7 +1392,7 @@ final class NodaWikidataFetcher {
|
||||
echo '
|
||||
<p class="alert icons iconsAlert">Es gibt schon einen Eintrag im Beschreibungsfeld</b>
|
||||
<div class="wikiReplaceTTile">
|
||||
<h3>Bisher vorhanden</h3><p>' . nl2br($cinfo['tag_anmerkung']) . '</p>
|
||||
<h3>Bisher vorhanden</h3><p>' . nl2br($tag_anmerkung) . '</p>
|
||||
</div>
|
||||
<div class="wikiReplaceTTile">
|
||||
<h3>Jetzt gefunden</h3><p>' . $datafromwiki . '<p>
|
||||
@ -1432,7 +1414,6 @@ final class NodaWikidataFetcher {
|
||||
}
|
||||
|
||||
$updateTagDescStmt->close();
|
||||
$updateTagDescStmt = null;
|
||||
|
||||
$insertNodaTagStmt = $this->_mysqli_noda->do_prepare("INSERT INTO `noda_tag`
|
||||
(`tag_id`, `noda_source`, `noda_nrinsource`, `noda_link`, `noda_erfasst_von`)
|
||||
@ -1453,7 +1434,6 @@ final class NodaWikidataFetcher {
|
||||
$updateTagEditInfoStmt->bind_param("si", $erfasst_von, $tag_id);
|
||||
$updateTagEditInfoStmt->execute();
|
||||
$updateTagEditInfoStmt->close();
|
||||
$updateTagEditInfoStmt = null;
|
||||
|
||||
$this->_mysqli_noda->commit();
|
||||
$this->_mysqli_noda->autocommit(true);
|
||||
@ -1499,7 +1479,6 @@ final class NodaWikidataFetcher {
|
||||
}
|
||||
|
||||
$insertNodaTagStmt->close();
|
||||
$insertNodaTagStmt = null;
|
||||
|
||||
$this->_mysqli_noda->commit();
|
||||
$this->_mysqli_noda->autocommit(true);
|
||||
@ -1613,8 +1592,6 @@ final class NodaWikidataFetcher {
|
||||
|
||||
if (!empty($languagesToFetch[$lang]) && !empty($data['sitelinks'][$lang . 'wiki'])) {
|
||||
|
||||
$url = $languagesToFetch[$lang];
|
||||
|
||||
$wikilink = $wikilinks[$lang];
|
||||
if (!empty($contents[$lang])) {
|
||||
|
||||
|
@ -28,11 +28,9 @@ final class NodaPersinstFulltextSync {
|
||||
|
||||
if ($result->num_rows === 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$this->_mysqli_noda->do_update_query_large("DELETE FROM `persinst_fulltext`
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `persinst`
|
||||
@ -58,7 +56,6 @@ final class NodaPersinstFulltextSync {
|
||||
|
||||
if ($result->num_rows === 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -70,7 +67,6 @@ final class NodaPersinstFulltextSync {
|
||||
$toUpdate[$persinst_id] = $cur;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$tlResult = $this->_mysqli_noda->do_read_query("SELECT `persinst_translation`.`persinst_id`, `trans_name` AS `name`
|
||||
FROM `persinst_translation`
|
||||
@ -85,7 +81,6 @@ final class NodaPersinstFulltextSync {
|
||||
else $translations[$persinst_id][] = $cur['name'];
|
||||
}
|
||||
$tlResult->close();
|
||||
$tlResult = null;
|
||||
|
||||
$newEntries = [];
|
||||
|
||||
@ -126,7 +121,6 @@ final class NodaPersinstFulltextSync {
|
||||
}
|
||||
|
||||
$updateStmt->close();
|
||||
$updateStmt = null;
|
||||
|
||||
if (count($toUpdate) > 1) {
|
||||
$this->_mysqli_noda->commit();
|
||||
|
@ -29,11 +29,9 @@ final class NodaPlaceFulltextSync {
|
||||
|
||||
if ($result->num_rows === 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$this->_mysqli_noda->do_update_query_large("DELETE FROM `orte_fulltext`
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `orte`
|
||||
@ -59,7 +57,6 @@ final class NodaPlaceFulltextSync {
|
||||
|
||||
if ($result->num_rows === 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -71,7 +68,6 @@ final class NodaPlaceFulltextSync {
|
||||
$toUpdate[$ort_id] = $cur;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$tlResult = $this->_mysqli_noda->do_read_query("SELECT `ort_translation`.`ort_id`, `trans_name` AS `name`
|
||||
FROM `ort_translation`
|
||||
@ -86,7 +82,6 @@ final class NodaPlaceFulltextSync {
|
||||
else $translations[$ort_id][] = $cur['name'];
|
||||
}
|
||||
$tlResult->close();
|
||||
$tlResult = null;
|
||||
|
||||
$newEntries = [];
|
||||
|
||||
@ -127,7 +122,6 @@ final class NodaPlaceFulltextSync {
|
||||
}
|
||||
|
||||
$updateStmt->close();
|
||||
$updateStmt = null;
|
||||
|
||||
if (count($toUpdate) > 1) {
|
||||
$this->_mysqli_noda->commit();
|
||||
|
@ -29,11 +29,9 @@ final class NodaSourceFulltextSync {
|
||||
|
||||
if ($result->num_rows === 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$this->_mysqli_noda->do_update_query_large("DELETE FROM `source_fulltext_search`
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `source`
|
||||
@ -60,7 +58,6 @@ final class NodaSourceFulltextSync {
|
||||
|
||||
if ($result->num_rows === 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -73,7 +70,6 @@ final class NodaSourceFulltextSync {
|
||||
$toUpdate[$source_id] = $cur;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$authorsResult = $this->_mysqli_noda->do_read_query("SELECT `source_author`.`source_id`, `persinst_anzeigename` AS `name`
|
||||
FROM `persinst`, `source_author`
|
||||
@ -89,7 +85,6 @@ final class NodaSourceFulltextSync {
|
||||
else $authors[$source_id][] = $cur['name'];
|
||||
}
|
||||
$authorsResult->close();
|
||||
$authorsResult = null;
|
||||
|
||||
$newEntries = [];
|
||||
|
||||
@ -131,7 +126,6 @@ final class NodaSourceFulltextSync {
|
||||
}
|
||||
|
||||
$updateStmt->close();
|
||||
$updateStmt = null;
|
||||
|
||||
if (count($toUpdate) > 1) {
|
||||
$this->_mysqli_noda->commit();
|
||||
|
@ -29,11 +29,9 @@ final class NodaTagFulltextSync {
|
||||
|
||||
if ($result->num_rows === 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$this->_mysqli_noda->do_update_query_large("DELETE FROM `tag_fulltext`
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `tag`
|
||||
@ -59,7 +57,6 @@ final class NodaTagFulltextSync {
|
||||
|
||||
if ($result->num_rows === 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -71,7 +68,6 @@ final class NodaTagFulltextSync {
|
||||
$toUpdate[$tag_id] = $cur;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$tlResult = $this->_mysqli_noda->do_read_query("SELECT `tag_translation`.`tag_id`, `trans_name` AS `name`
|
||||
FROM `tag_translation`
|
||||
@ -86,7 +82,6 @@ final class NodaTagFulltextSync {
|
||||
else $translations[$tag_id][] = $cur['name'];
|
||||
}
|
||||
$tlResult->close();
|
||||
$tlResult = null;
|
||||
|
||||
$newEntries = [];
|
||||
|
||||
@ -127,7 +122,6 @@ final class NodaTagFulltextSync {
|
||||
}
|
||||
|
||||
$updateStmt->close();
|
||||
$updateStmt = null;
|
||||
|
||||
if (count($toUpdate) > 1) {
|
||||
$this->_mysqli_noda->commit();
|
||||
|
@ -29,11 +29,9 @@ final class NodaTimeFulltextSync {
|
||||
|
||||
if ($result->num_rows === 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$this->_mysqli_noda->do_update_query_large("DELETE FROM `zeiten_fulltext`
|
||||
WHERE NOT EXISTS (SELECT 1 FROM `zeiten`
|
||||
@ -59,7 +57,6 @@ final class NodaTimeFulltextSync {
|
||||
|
||||
if ($result->num_rows === 0) {
|
||||
$result->close();
|
||||
$result = null;
|
||||
return [];
|
||||
}
|
||||
|
||||
@ -71,7 +68,6 @@ final class NodaTimeFulltextSync {
|
||||
$toUpdate[$zeit_id] = $cur;
|
||||
}
|
||||
$result->close();
|
||||
$result = null;
|
||||
|
||||
$tlResult = $this->_mysqli_noda->do_read_query("SELECT `zeit_translation`.`zeit_id`, `trans_name` AS `name`
|
||||
FROM `zeit_translation`
|
||||
@ -86,7 +82,6 @@ final class NodaTimeFulltextSync {
|
||||
else $translations[$time_id][] = $cur['name'];
|
||||
}
|
||||
$tlResult->close();
|
||||
$tlResult = null;
|
||||
|
||||
$newEntries = [];
|
||||
|
||||
@ -127,7 +122,6 @@ final class NodaTimeFulltextSync {
|
||||
}
|
||||
|
||||
$updateStmt->close();
|
||||
$updateStmt = null;
|
||||
|
||||
if (count($toUpdate) > 1) {
|
||||
$this->_mysqli_noda->commit();
|
||||
|
Loading…
Reference in New Issue
Block a user