mirror of
https://github.com/nextcloud/server.git
synced 2026-06-11 09:42:09 -04:00
Use Migrators id instead of class names
This will help with UI and means migrators can move in namespaces without changing export format. Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
682468ef5c
commit
dda51d49d7
7 changed files with 7 additions and 7 deletions
|
|
@ -414,7 +414,7 @@ class CalendarMigrator implements IMigrator {
|
|||
* @throws CalendarMigratorException
|
||||
*/
|
||||
public function import(IUser $user, IImportSource $importSource, OutputInterface $output): void {
|
||||
if ($importSource->getMigratorVersion(static::class) === null) {
|
||||
if ($importSource->getMigratorVersion($this->getId()) === null) {
|
||||
$output->writeln('No version for ' . static::class . ', skipping import…');
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -306,7 +306,7 @@ class ContactsMigrator implements IMigrator {
|
|||
* @throws ContactsMigratorException
|
||||
*/
|
||||
public function import(IUser $user, IImportSource $importSource, OutputInterface $output): void {
|
||||
if ($importSource->getMigratorVersion(static::class) === null) {
|
||||
if ($importSource->getMigratorVersion($this->getId()) === null) {
|
||||
$output->writeln('No version for ' . static::class . ', skipping import…');
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ class TrashbinMigrator implements IMigrator {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
public function import(IUser $user, IImportSource $importSource, OutputInterface $output): void {
|
||||
if ($importSource->getMigratorVersion(static::class) === null) {
|
||||
if ($importSource->getMigratorVersion($this->getId()) === null) {
|
||||
$output->writeln('No version for ' . static::class . ', skipping import…');
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ class AccountMigrator implements IMigrator {
|
|||
* {@inheritDoc}
|
||||
*/
|
||||
public function import(IUser $user, IImportSource $importSource, OutputInterface $output): void {
|
||||
if ($importSource->getMigratorVersion(static::class) === null) {
|
||||
if ($importSource->getMigratorVersion($this->getId()) === null) {
|
||||
$output->writeln('No version for ' . static::class . ', skipping import…');
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@ interface IImportSource {
|
|||
/**
|
||||
* @return ?int Version for this migrator from the export archive. Null means migrator missing.
|
||||
*
|
||||
* @param class-string<IMigrator> $migrator
|
||||
* @param string $migrator Migrator id (as returned by IMigrator::getId)
|
||||
*
|
||||
* @since 24.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ interface IMigrator {
|
|||
|
||||
/**
|
||||
* Checks whether it is able to import a version of the export format for this migrator
|
||||
* Use $importSource->getMigratorVersion(static::class) to get the version from the archive
|
||||
* Use $importSource->getMigratorVersion($this->getId()) to get the version from the archive
|
||||
*
|
||||
* @since 24.0.0
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ trait TMigratorBasicVersionHandling {
|
|||
public function canImport(
|
||||
IImportSource $importSource
|
||||
): bool {
|
||||
$version = $importSource->getMigratorVersion(static::class);
|
||||
$version = $importSource->getMigratorVersion($this->getId());
|
||||
if ($version === null) {
|
||||
return !$this->mandatory;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue