Replace the use of the deprecated DatabaseException
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 8 Oct 2021 14:54:59 +0000 (16:54 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 8 Oct 2021 14:56:33 +0000 (16:56 +0200)
see WoltLab/WCF@2017f1dc4aa92040e2a17a4ad59f4683119c661e
see #55

files/lib/system/exporter/MyBB16xExporter.class.php
files/lib/system/exporter/SMF2xExporter.class.php
files/lib/system/exporter/VB3or4xExporter.class.php
files/lib/system/exporter/VB5xExporter.class.php

index a97bf3c411eb21a07ff311e226d906b85ebc2547..861c89d2d7cefc7fff10ef4f4a6e2c1a13672123 100644 (file)
@@ -9,7 +9,6 @@ use wcf\data\object\type\ObjectTypeCache;
 use wcf\data\user\group\UserGroup;
 use wcf\data\user\option\UserOption;
 use wcf\data\user\UserProfile;
-use wcf\system\database\DatabaseException;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\importer\ImportHandler;
 use wcf\system\Regex;
@@ -123,7 +122,7 @@ class MyBB16xExporter extends AbstractExporter
         $data = \unserialize($row['cache']);
 
         if ($data['version_code'] < 1800) {
-            throw new DatabaseException('Cannot import MyBB 1.6.x or less', $this->database);
+            throw new \RuntimeException('Cannot import MyBB 1.6.x or less.');
         }
     }
 
index 2fdd6416136a5ebe8e7ceb7c351e0708038bf302..f0ff23bab9fb8b00682cc1c178c90f994e7f31f0 100644 (file)
@@ -5,7 +5,6 @@ namespace wcf\system\exporter;
 use wbb\data\board\Board;
 use wcf\data\user\group\UserGroup;
 use wcf\data\user\option\UserOption;
-use wcf\system\database\DatabaseException;
 use wcf\system\database\util\PreparedStatementConditionBuilder;
 use wcf\system\importer\ImportHandler;
 use wcf\system\option\user\SelectOptionsUserOptionOutput;
@@ -119,7 +118,7 @@ class SMF2xExporter extends AbstractExporter
         parent::validateDatabaseAccess();
 
         if (\version_compare($this->readOption('smfVersion'), '2.0.0', '<')) {
-            throw new DatabaseException('Cannot import less than SMF 2.x', $this->database);
+            throw new \RuntimeException('Cannot import less than SMF 2.x.');
         }
     }
 
index 606aac9402be449edbef80cc64e547b4a1e0d716..b801eb8f12f996c4ec8e72f512d8a6ab83cb81ad 100644 (file)
@@ -239,10 +239,10 @@ class VB3or4xExporter extends AbstractExporter
         $templateversion = $this->readOption('templateversion');
 
         if (\version_compare($templateversion, '3.8.0', '<')) {
-            throw new DatabaseException('Cannot import less than vB 3.8.x', $this->database);
+            throw new \RuntimeException('Cannot import less than vBulletin 3.8.x.');
         }
         if (\version_compare($templateversion, '4.3.0 alpha 1', '>=')) {
-            throw new DatabaseException('Cannot import greater than vB 4.2.x', $this->database);
+            throw new \RuntimeException('Cannot import greater than vBulletin 4.2.x.');
         }
     }
 
index d3506b6877dc2893905d25715feb82d2b358236c..e95185e0ab87ad9f58fd427281722308452ab962 100644 (file)
@@ -6,7 +6,6 @@ use gallery\data\album\Album;
 use wbb\data\board\Board;
 use wcf\data\user\group\UserGroup;
 use wcf\data\user\option\UserOption;
-use wcf\system\database\DatabaseException;
 use wcf\system\exception\SystemException;
 use wcf\system\importer\ImportHandler;
 use wcf\system\Regex;
@@ -161,7 +160,7 @@ class VB5xExporter extends AbstractExporter
         $templateversion = $this->readOption('templateversion');
 
         if (\version_compare($templateversion, '5.0.0', '<')) {
-            throw new DatabaseException('Cannot import less than vB 5.0.x', $this->database);
+            throw new \RuntimeException('Cannot import less than vBulletin 5.0.x.');
         }
     }