title) { return $this->title; } return $this->identifier; } /** * Sets the title attribute * * @param string $title The title of this update wizard */ public function setTitle($title) { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); $this->title = $title; } /** * Returns the identifier of this class * * @return string The identifier of this update wizard */ public function getIdentifier(): string { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); return $this->identifier ?? static::class; } /** * Sets the identifier attribute * * @param string $identifier The identifier of this update wizard */ public function setIdentifier($identifier) { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); $this->identifier = $identifier; } /** * Simple wrapper function that helps dealing with the compatibility * layer that some update wizards don't have a second parameter * thus, it evaluates everything already * * @return bool If the wizard should be shown at all on the overview page * @see checkForUpdate() */ public function shouldRenderWizard() { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); $explanation = ''; $result = $this->checkForUpdate($explanation); return (bool)$result === true; } /** * Check if given table exists * * @param string $table * @return bool */ protected function checkIfTableExists($table) { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); $tableExists = GeneralUtility::makeInstance(ConnectionPool::class) ->getConnectionForTable($table) ->getSchemaManager() ->tablesExist([$table]); return $tableExists; } /** * Checks whether updates are required. * * @param string &$description The description for the update * @return bool Whether an update is required (TRUE) or not (FALSE) */ abstract public function checkForUpdate(&$description); /** * Performs the accordant updates. * * @param array &$dbQueries Queries done in this update * @param string &$customMessage Custom message * @return bool Whether everything went smoothly or not */ abstract public function performUpdate(array &$dbQueries, &$customMessage); /** * This method can be called to install extensions following all proper processes * (e.g. installing in extList, respecting priority, etc.) * * @param array $extensionKeys List of keys of extensions to install */ protected function installExtensions(array $extensionKeys) { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); /** @var \TYPO3\CMS\Extensionmanager\Utility\InstallUtility $installUtility */ $installUtility = GeneralUtility::makeInstance( \TYPO3\CMS\Extensionmanager\Utility\InstallUtility::class ); $installUtility->install($extensionKeys); } /** * Marks some wizard as being "seen" so that it not shown again. * * Writes the info in LocalConfiguration.php * * @param mixed $confValue The configuration is set to this value */ protected function markWizardAsDone($confValue = 1) { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); GeneralUtility::makeInstance(Registry::class)->set('installUpdate', static::class, $confValue); } /** * Checks if this wizard has been "done" before * * @return bool TRUE if wizard has been done before, FALSE otherwise */ protected function isWizardDone() { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); $wizardClassName = static::class; return GeneralUtility::makeInstance(Registry::class)->get('installUpdate', $wizardClassName, false); } /** * Return the description for this wizard * * @return string */ public function getDescription(): string { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); return ''; } /** * Execute the update * Called when a wizard reports that an update is necessary * * @return bool */ public function executeUpdate(): bool { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); $queries = []; $message = ''; $result = $this->performUpdate($queries, $message); $this->output->write($message); return $result; } /** * Is an update necessary? * Is used to determine whether a wizard needs to be run. * Check if data for migration exists. * * @return bool */ public function updateNecessary(): bool { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); $description = ''; $result = $this->checkForUpdate($description); $this->output->write($description); return $result; } /** * Returns an array of class names of Prerequisite classes * This way a wizard can define dependencies like "database up-to-date" or * "reference index updated" * * @return string[] */ public function getPrerequisites(): array { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); return [ DatabaseUpdatedPrerequisite::class ]; } /** * Setter injection for output into upgrade wizards * * @param OutputInterface $output */ public function setOutput(OutputInterface $output): void { trigger_error( 'Deprecated since TYPO3 v9, will be removed in TYPO3 v10.0, use UpgradeWizardInterface directly. affected class: ' . get_class($this), E_USER_DEPRECATED ); $this->output = $output; } }