|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * --------------------------------------------------------------------- |
| 5 | + * |
| 6 | + * GLPI - Gestionnaire Libre de Parc Informatique |
| 7 | + * |
| 8 | + * http://glpi-project.org |
| 9 | + * |
| 10 | + * @copyright 2015-2026 Teclib' and contributors. |
| 11 | + * @licence https://www.gnu.org/licenses/gpl-3.0.html |
| 12 | + * |
| 13 | + * --------------------------------------------------------------------- |
| 14 | + * |
| 15 | + * LICENSE |
| 16 | + * |
| 17 | + * This file is part of GLPI. |
| 18 | + * |
| 19 | + * This program is free software: you can redistribute it and/or modify |
| 20 | + * it under the terms of the GNU General Public License as published by |
| 21 | + * the Free Software Foundation, either version 3 of the License, or |
| 22 | + * (at your option) any later version. |
| 23 | + * |
| 24 | + * This program is distributed in the hope that it will be useful, |
| 25 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 26 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 27 | + * GNU General Public License for more details. |
| 28 | + * |
| 29 | + * You should have received a copy of the GNU General Public License |
| 30 | + * along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 31 | + * |
| 32 | + * --------------------------------------------------------------------- |
| 33 | + */ |
| 34 | + |
| 35 | +use function Safe\preg_match; |
| 36 | +use function Safe\scandir; |
| 37 | + |
| 38 | +/** |
| 39 | + * Update from 11.0.6 to 11.0.7 |
| 40 | + * |
| 41 | + * @return bool for success (will die for most error) |
| 42 | + **/ |
| 43 | +function update1106to1107() |
| 44 | +{ |
| 45 | + /** |
| 46 | + * @var DBmysql $DB |
| 47 | + * @var Migration $migration |
| 48 | + */ |
| 49 | + global $DB, $migration; |
| 50 | + |
| 51 | + $updateresult = true; |
| 52 | + $ADDTODISPLAYPREF = []; |
| 53 | + $DELFROMDISPLAYPREF = []; |
| 54 | + $update_dir = __DIR__ . '/update_11.0.6_to_11.0.7/'; |
| 55 | + |
| 56 | + $migration->setVersion('11.0.7'); |
| 57 | + |
| 58 | + $update_scripts = scandir($update_dir); |
| 59 | + foreach ($update_scripts as $update_script) { |
| 60 | + if (preg_match('/\.php$/', $update_script) !== 1) { |
| 61 | + continue; |
| 62 | + } |
| 63 | + require $update_dir . $update_script; |
| 64 | + } |
| 65 | + |
| 66 | + // ************ Keep it at the end ************** |
| 67 | + $migration->updateDisplayPrefs($ADDTODISPLAYPREF, $DELFROMDISPLAYPREF); |
| 68 | + |
| 69 | + $migration->executeMigration(); |
| 70 | + |
| 71 | + return $updateresult; |
| 72 | +} |
0 commit comments