Remove SearchEngineConvertInnoDbWorker
authorTim Düsterhus <duesterhus@woltlab.com>
Fri, 27 Aug 2021 09:46:00 +0000 (11:46 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Fri, 27 Aug 2021 09:49:53 +0000 (11:49 +0200)
com.woltlab.wcf/fileDelete.xml
com.woltlab.wcf/objectType.xml
wcfsetup/install/files/lib/system/worker/SearchEngineConvertInnoDbWorker.class.php [deleted file]

index 28d4ebf404e0e850604c6902eae2e167a8ba6571..39e62ef1e81577d935f83e63f1f75c9450ff3f13 100644 (file)
                <file>lib/system/user/online/location/UserLocation.class.php</file>
                <file>lib/system/version/VersionHandler.class.php</file>
                <file>lib/system/worker/DatabaseConvertEncodingWorker.class.php</file>
+               <file>lib/system/worker/SearchEngineConvertInnoDbWorker.class.php</file>
                <file>lib/system/worker/UserActivityPointUpdateCacheWorker.class.php</file>
                <file>lib/system/worker/UserRankUpdateWorker.class.php</file>
                <file>lib/util/BasicFileUtil.class.php</file>
index 9038daf0457eb092a2dc04cef702dead19c69dea..eec0869dbc1ec6c4b032bc523e507f12585fe9a0 100644 (file)
                </type>
                <!-- /importers -->
                <!-- rebuild data workers -->
-               <type>
-                       <name>com.woltlab.wcf.searchEngineConvertInnoDb</name>
-                       <definitionname>com.woltlab.wcf.rebuildData</definitionname>
-                       <classname>wcf\system\worker\SearchEngineConvertInnoDbWorker</classname>
-                       <nicevalue>-200</nicevalue>
-               </type>
                <type>
                        <name>com.woltlab.wcf.like</name>
                        <definitionname>com.woltlab.wcf.rebuildData</definitionname>
                </type>
                <!-- /deprecated -->
        </import>
+       <delete>
+               <type name="com.woltlab.wcf.searchEngineConvertInnoDb">
+                       <definitionname>com.woltlab.wcf.rebuildData</definitionname>
+               </type>
+       </delete>
 </data>
diff --git a/wcfsetup/install/files/lib/system/worker/SearchEngineConvertInnoDbWorker.class.php b/wcfsetup/install/files/lib/system/worker/SearchEngineConvertInnoDbWorker.class.php
deleted file mode 100644 (file)
index d3050da..0000000
+++ /dev/null
@@ -1,106 +0,0 @@
-<?php
-
-namespace wcf\system\worker;
-
-use wcf\data\object\type\ObjectTypeCache;
-use wcf\system\request\LinkHandler;
-use wcf\system\search\SearchIndexManager;
-use wcf\system\WCF;
-
-/**
- * Worker implementation for search table engine conversion.
- *
- * @author  Tim Duesterhus, Alexander Ebert
- * @copyright   2001-2020 WoltLab GmbH
- * @license GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
- * @package WoltLabSuite\Core\System\Worker
- * @since       5.4
- */
-class SearchEngineConvertInnoDbWorker extends AbstractRebuildDataWorker
-{
-    /**
-     * @inheritDoc
-     */
-    protected $limit = 1;
-
-    /**
-     * @inheritDoc
-     */
-    public function initObjectList()
-    {
-        // This rebuild worker has no database object list and
-        // therefore, we do nothing in this method and overwrite
-        // the parent method so no exception is thrown.
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function countObjects()
-    {
-        if ($this->count === null) {
-            $this->count = \count($this->getTables());
-        }
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function getProceedURL()
-    {
-        return LinkHandler::getInstance()->getLink('RebuildData');
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function validate()
-    {
-        WCF::getSession()->checkPermissions(['admin.management.canRebuildData']);
-    }
-
-    /**
-     * @inheritDoc
-     */
-    public function execute()
-    {
-        $tables = $this->getTables();
-
-        $sql = "SELECT  LOWER(ENGINE)
-                FROM    INFORMATION_SCHEMA.TABLES
-                WHERE   TABLE_NAME = ?
-                    AND TABLE_SCHEMA = ?";
-        $checkStatement = WCF::getDB()->prepareStatement($sql);
-
-        $convertTables = \array_slice($tables, $this->limit * $this->loopCount, $this->limit);
-        foreach ($convertTables as $table) {
-            $checkStatement->execute([
-                $table,
-                WCF::getDB()->getDatabaseName(),
-            ]);
-
-            $engine = $checkStatement->fetchSingleColumn();
-            if ($engine !== false && $engine !== 'innodb') {
-                $sql = "ALTER TABLE " . $table . " ENGINE = InnoDB";
-                $statement = WCF::getDB()->prepareStatement($sql);
-                $statement->execute();
-            }
-        }
-    }
-
-    /**
-     * Returns the list of known database tables.
-     *
-     * @return      string[]
-     */
-    protected function getTables()
-    {
-        $objectTypes = ObjectTypeCache::getInstance()->getObjectTypes('com.woltlab.wcf.searchableObjectType');
-        $tableNames = [];
-        foreach ($objectTypes as $objectType) {
-            $tableNames[] = SearchIndexManager::getTableName($objectType->objectType);
-        }
-
-        return $tableNames;
-    }
-}