3 namespace Org\Mxchange\CoreFramework\Registry\Upgrade\Format\Lfdb;
5 // Import framework stuff
6 use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
7 use Org\Mxchange\CoreFramework\Registry\BaseRegistry;
8 use Org\Mxchange\CoreFramework\Upgrade\Format\Database\UpgradeableDatabaseFormat;
9 use Org\Mxchange\CoreFramework\Upgrade\Format\RegisterableFormatUpgrade;
12 * A LocalFileDatabase database-format-upgrade registry
14 * @author Roland Haeder <webmaster@ship-simu.org>
16 * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2023 Core Developer Team
17 * @license GNU GPL 3.0 or any newer version
18 * @link http://www.ship-simu.org
20 * This program is free software: you can redistribute it and/or modify
21 * it under the terms of the GNU General Public License as published by
22 * the Free Software Foundation, either version 3 of the License, or
23 * (at your option) any later version.
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28 * GNU General Public License for more details.
30 * You should have received a copy of the GNU General Public License
31 * along with this program. If not, see <http://www.gnu.org/licenses/>.
33 class LocalFileDatabaseFormatUpgradeRegistry extends BaseRegistry implements RegisterableFormatUpgrade {
35 * Instance of this class
37 private static $registryInstance = null;
40 * Protected constructor
44 private function __construct () {
45 // Call parent constructor
46 parent::__construct(__CLASS__);
50 * Singleton getter for self instance. This class has no factory pattern
51 * because here is no need for special parameters.
53 * @return $registryInstance Instance of this class
55 public final static function getRegistry () {
56 // Is an instance there?
57 if (is_null(self::$registryInstance)) {
58 // Not yet, so create one
59 self::$registryInstance = new LocalFileDatabaseFormatUpgradeRegistry();
62 // Return the instance
63 return self::$registryInstance;
67 * Registers given format-upgrade class with this registry
69 * @param $upgradeInstance An instance of a UpgradeableDatabaseFormat class
73 public function registerFormatUpgrader (UpgradeableDatabaseFormat $upgradeInstance) {
74 DebugMiddleware::getSelfInstance()->partialStub();