| @@ -1,119 +1,0 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | -namespace AcyMailing\Helpers\Update; | |
| 4 | - | |
| 5 | -use AcyMailing\Controllers\ConfigurationController; | |
| 6 | - | |
| 7 | -trait SQLPatch | |
| 8 | -{ | |
| 9 | - public function updateSQL(): void | |
| 10 | - { | |
| 11 | - if (!$this->isUpdating) { | |
| 12 | - return; | |
| 13 | - } | |
| 14 | - | |
| 15 | - $config = acym_config(); | |
| 16 | - | |
| 17 | - $this->updateFor603(); | |
| 18 | - $this->updateFor610(); | |
| 19 | - $this->updateFor612(); | |
| 20 | - $this->updateFor613(); | |
| 21 | - $this->updateFor614(); | |
| 22 | - $this->updateFor615($config); | |
| 23 | - $this->updateFor616(); | |
| 24 | - $this->updateFor617(); | |
| 25 | - $this->updateFor622($config); | |
| 26 | - $this->updateFor640(); | |
| 27 | - $this->updateFor650(); | |
| 28 | - $this->updateFor660(); | |
| 29 | - $this->updateFor670(); | |
| 30 | - $this->updateFor692(); | |
| 31 | - $this->updateFor6100(); | |
| 32 | - $this->updateFor6102(); | |
| 33 | - $this->updateFor6104(); | |
| 34 | - $this->updateFor6110(); | |
| 35 | - $this->updateFor6120(); | |
| 36 | - $this->updateFor6130(); | |
| 37 | - $this->updateFor6140(); | |
| 38 | - $this->updateFor6150(); | |
| 39 | - $this->updateFor6160(); | |
| 40 | - $this->updateFor6170(); | |
| 41 | - $this->updateFor6180(); | |
| 42 | - $this->updateFor6181(); | |
| 43 | - $this->updateFor6190(); | |
| 44 | - | |
| 45 | - $this->updateFor700($config); | |
| 46 | - $this->updateFor710(); | |
| 47 | - $this->updateFor720($config); | |
| 48 | - $this->updateFor721(); | |
| 49 | - $this->updateFor740($config); | |
| 50 | - $this->updateFor750($config); | |
| 51 | - $this->updateFor755(); | |
| 52 | - $this->updateFor759(); | |
| 53 | - $this->updateFor7510(); | |
| 54 | - $this->updateFor760(); | |
| 55 | - $this->updateFor761(); | |
| 56 | - $this->updateFor762(); | |
| 57 | - $this->updateFor776(); | |
| 58 | - $this->updateFor781(); | |
| 59 | - $this->updateFor792(); | |
| 60 | - $this->updateFor793(); | |
| 61 | - $this->updateFor794(); | |
| 62 | - $this->updateFor796(); | |
| 63 | - | |
| 64 | - $this->updateFor800(); | |
| 65 | - $this->updateFor810(); | |
| 66 | - $this->updateFor811(); | |
| 67 | - $this->updateFor850(); | |
| 68 | - $this->updateFor860(); | |
| 69 | - $this->updateFor862(); | |
| 70 | - $this->updateFor870(); | |
| 71 | - $this->updateFor872($config); | |
| 72 | - $this->updateFor873($config); | |
| 73 | - $this->updateFor874($config); | |
| 74 | - $this->updateFor881($config); | |
| 75 | - | |
| 76 | - $this->updateFor920($config); | |
| 77 | - $this->updateFor930(); | |
| 78 | - $this->updateFor931(); | |
| 79 | - $this->updateFor940($config); | |
| 80 | - $this->updateFor961(); | |
| 81 | - $this->updateFor970(); | |
| 82 | - $this->updateFor980(); | |
| 83 | - $this->updateFor990(); | |
| 84 | - $this->updateFor9101(); | |
| 85 | - $this->updateFor9102(); | |
| 86 | - $this->updateFor9110(); | |
| 87 | - | |
| 88 | - $this->updateFor1000(); | |
| 89 | - $this->updateFor1020($config); | |
| 90 | - } | |
| 91 | - | |
| 92 | - public function checkDB(): void | |
| 93 | - { | |
| 94 | - $configController = new ConfigurationController(); | |
| 95 | - $messages = $configController->checkDB(false); | |
| 96 | - | |
| 97 | - if (empty($messages)) { | |
| 98 | - return; | |
| 99 | - } | |
| 100 | - | |
| 101 | - $isError = false; | |
| 102 | - $textMsgs = []; | |
| 103 | - foreach ($messages as $oneMsg) { | |
| 104 | - if ($oneMsg['error']) { | |
| 105 | - $isError = true; | |
| 106 | - } | |
| 107 | - $textMsgs[] = $oneMsg['msg']; | |
| 108 | - } | |
| 109 | - | |
| 110 | - if ($isError && !empty($textMsgs)) { | |
| 111 | - acym_enqueueMessage(implode('<br />', $textMsgs), 'warning'); | |
| 112 | - } | |
| 113 | - } | |
| 114 | - | |
| 115 | - private function isPreviousVersionAtLeast(string $versionNumber): bool | |
| 116 | - { | |
| 117 | - return version_compare($this->previousVersion, $versionNumber, '>='); | |
| 118 | - } | |
| 119 | -} | |