Deprecation: #106947 - Move upgrade wizard related interfaces and attribute to EXT:core
See forge#106947
Description
EXT: provided a couple of interfaces to allow implementing upgrade
wizards, along with the PHP attribute
# to
register them.
Since TYPO3 v13 it is possible to run TYPO3 without EXT: being
installed. However, this advantage could often not be utilised sensibly,
since extensions still needed to require EXT: as a dependency in
order to ship upgrade wizards, because the implemented interfaces needed to
be available.
For this reason the following interfaces, classes and attributes are now moved
into EXT:, and their former counterparts in EXT: now extend
these Core classes:
- Attribute
\TYPO3\toCMS\ Install\ Attribute\ Upgrade Wizard \TYPO3\CMS\ Core\ Attribute\ Upgrade Wizard - Interface
\TYPO3\toCMS\ Install\ Updates\ Chatty Interface \TYPO3\CMS\ Core\ Upgrades\ Chatty Interface - Interface
\TYPO3\toCMS\ Install\ Updates\ Confirmable Interface \TYPO3\CMS\ Core\ Upgrades\ Confirmable Interface - Interface
\TYPO3\toCMS\ Install\ Updates\ Prerequisite Interface \TYPO3\CMS\ Core\ Upgrades\ Prerequisite Interface - Interface
\TYPO3\toCMS\ Install\ Updates\ Repeatable Interface \TYPO3\CMS\ Core\ Upgrades\ Repeatable Interface - Interface
\TYPO3\toCMS\ Install\ Updates\ Upgrade Wizard Interface \TYPO3\CMS\ Core\ Upgrades\ Upgrade Wizard Interface - Class
\TYPO3\toCMS\ Install\ Updates\ Confirmation \TYPO3\CMS\ Core\ Upgrades\ Confirmation - Class
\TYPO3\toCMS\ Install\ Updates\ Database Updated Prerequisite \TYPO3\CMS\ Core\ Upgrades\ Database Updated Prerequisite - Class
\TYPO3\toCMS\ Install\ Updates\ Reference Index Updated Prerequisite \TYPO3\CMS\ Core\ Upgrades\ Reference Index Updated Prerequisite - AbstractClass
\TYPO3\toCMS\ Install\ Updates\ Abstract List Type To CType Update \TYPO3\CMS\ Core\ Upgrades\ Abstract List Type To CType Update
The following internal class has been moved without an alternative:
- Class :php
\TYPO3\toCMS\ Install\ Updates\ Prerequisite Collection \TYPO3\CMS\ Core\ Upgrades\ Prerequisite Collection
Extension authors are encouraged to migrate their upgrade wizards to the new
core interface, in order to drop their dependency on EXT:.
Note
EXT: is still required to execute upgrade wizards either on CLI
or within the TYPO3 Install Tool interface, even when switching to the
new EXT: interfaces. Moving typo3 upgrade:* commands is planned
for TYPO3 v14 LTS.
Note
Note that not only "Install" is replaced with "Core", but also "Updates" renamed to "Upgrades" to keep a consistent naming scheme.
Impact
Using the listed interfaces and the attribute in the scope of EXT: allow extension
authors to optionally provide their extension upgrade wizards.
EXT: can then be set as a "suggested" dependency, and is no longer
required to be mandatory.
The usage of these old interfaces from EXT: is now deprecated.
Affected installations
Installations missing EXT: or having extensions providing upgrade wizards
using the old namespace.
Migration
Upgrade custom upgrade wizards to use the new attribute, interfaces
and/or classes from the EXT: namespace, instead of EXT::
Upgrade Wizard
Before
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Upgrades;
use TYPO3\CMS\Install\Attribute\UpgradeWizard;
use TYPO3\CMS\Install\Updates\ChattyInterface;
use TYPO3\CMS\Install\Updates\ConfirmableInterface;
use TYPO3\CMS\Install\Updates\RepeatableInterface;
use TYPO3\CMS\Install\Updates\UpgradeWizardInterface;
#[UpgradeWizard('myExtensionCustomUpgradeWizardIdentifier')]
class CustomUpgradeWizard extends UpgradeWizardInterface, ChattyInterface, RepeatableInterface
{
// ...
}
After
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Upgrades;
use TYPO3\CMS\Core\Attribute\UpgradeWizard;
use TYPO3\CMS\Core\Upgrades\ChattyInterface;
use TYPO3\CMS\Core\Upgrades\ConfirmableInterface;
use TYPO3\CMS\Core\Upgrades\RepeatableInterface;
use TYPO3\CMS\Core\Upgrades\UpgradeWizardInterface;
#[UpgradeWizard('myExtensionCustomUpgradeWizardIdentifier')]
class CustomUpgradeWizard extends UpgradeWizardInterface, ChattyInterface, RepeatableInterface
{
// ...
}
AbstractListTypeToCTypeUpdate
The abstract upgrade wizard
\TYPO3\
has been introduced in 13.4 and is quite young, but needed to be moved to EXT: to
provide implementing upgrade wizards utilizing this base class.
Note
Any extension that utilizes this abstract needs to require at least TYPO3 v14.0 when using the new base class.
Before
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Upgrades;
use TYPO3\CMS\Core\Attribute\UpgradeWizard;
use TYPO3\CMS\Install\Updates\AbstractListTypeToCTypeUpdate;
#[UpgradeWizard('CustomCTypeMigration')]
final class CustomCTypeMigration extends AbstractListTypeToCTypeUpdate
{
// ...
}
After
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Upgrades;
use TYPO3\CMS\Core\Attribute\UpgradeWizard;
use TYPO3\CMS\Core\Upgrades\AbstractListTypeToCTypeUpdate;
#[UpgradeWizard('CustomCTypeMigration')]
final class CustomCTypeMigration extends AbstractListTypeToCTypeUpdate
{
// ...
}
EXT:install prerequisite
Using the prerequisite classes from the EXT: namespace
(using their compatibility alias) can be kept for the time being,
if an extension needs to provide support for two major TYPO3 versions:
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Upgrades;
use TYPO3\CMS\Core\Attribute\UpgradeWizard;
use TYPO3\CMS\Core\Upgrades\ChattyInterface;
use TYPO3\CMS\Core\Upgrades\ConfirmableInterface;
use TYPO3\CMS\Core\Upgrades\RepeatableInterface;
use TYPO3\CMS\Core\Upgrades\UpgradeWizardInterface;
use TYPO3\CMS\Install\Updates\DatabaseUpdatedPrerequisite;
use TYPO3\CMS\Install\Updates\ReferenceIndexUpdatedPrerequisite;
#[UpgradeWizard('myExtensionCustomUpgradeWizardIdentifier')]
class CustomUpgradeWizard extends UpgradeWizardInterface, ChattyInterface, RepeatableInterface
{
/**
* @return string[] All new fields and tables must exist
*/
public function getPrerequisites(): array
{
return [
DatabaseUpdatedPrerequisite::class,
ReferenceIndexUpdatedPrerequisite:class,
];
}
}
<?php
declare(strict_types=1);
namespace MyVendor\MyExtension\Upgrades;
use TYPO3\CMS\Core\Attribute\UpgradeWizard;
use TYPO3\CMS\Core\Upgrades\ChattyInterface;
use TYPO3\CMS\Core\Upgrades\ConfirmableInterface;
use TYPO3\CMS\Core\Upgrades\RepeatableInterface;
use TYPO3\CMS\Core\Upgrades\UpgradeWizardInterface;
use TYPO3\CMS\Core\Upgrades\DatabaseUpdatedPrerequisite;
use TYPO3\CMS\Core\Upgrades\ReferenceIndexUpdatedPrerequisite;
#[UpgradeWizard('myExtensionCustomUpgradeWizardIdentifier')]
class CustomUpgradeWizard extends UpgradeWizardInterface, ChattyInterface, RepeatableInterface
{
/**
* @return string[] All new fields and tables must exist
*/
public function getPrerequisites(): array
{
return [
DatabaseUpdatedPrerequisite::class,
ReferenceIndexUpdatedPrerequisite:class,
];
}
}