Skip to content

Commit fa041da

Browse files
come-ncPytal
authored andcommitted
Add the ISizeEstimationMigrator interface for method getExportEstimatedSize
Signed-off-by: Côme Chilliet <[email protected]>
1 parent 6da413f commit fa041da

File tree

4 files changed

+45
-8
lines changed

4 files changed

+45
-8
lines changed

lib/composer/composer/autoload_classmap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -569,6 +569,7 @@
569569
'OCP\\UserMigration\\IExportDestination' => $baseDir . '/lib/public/UserMigration/IExportDestination.php',
570570
'OCP\\UserMigration\\IImportSource' => $baseDir . '/lib/public/UserMigration/IImportSource.php',
571571
'OCP\\UserMigration\\IMigrator' => $baseDir . '/lib/public/UserMigration/IMigrator.php',
572+
'OCP\\UserMigration\\ISizeEstimationMigrator' => $baseDir . '/lib/public/UserMigration/ISizeEstimationMigrator.php',
572573
'OCP\\UserMigration\\TMigratorBasicVersionHandling' => $baseDir . '/lib/public/UserMigration/TMigratorBasicVersionHandling.php',
573574
'OCP\\UserMigration\\UserMigrationException' => $baseDir . '/lib/public/UserMigration/UserMigrationException.php',
574575
'OCP\\UserStatus\\IManager' => $baseDir . '/lib/public/UserStatus/IManager.php',

lib/composer/composer/autoload_static.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -598,6 +598,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
598598
'OCP\\UserMigration\\IExportDestination' => __DIR__ . '/../../..' . '/lib/public/UserMigration/IExportDestination.php',
599599
'OCP\\UserMigration\\IImportSource' => __DIR__ . '/../../..' . '/lib/public/UserMigration/IImportSource.php',
600600
'OCP\\UserMigration\\IMigrator' => __DIR__ . '/../../..' . '/lib/public/UserMigration/IMigrator.php',
601+
'OCP\\UserMigration\\ISizeEstimationMigrator' => __DIR__ . '/../../..' . '/lib/public/UserMigration/ISizeEstimationMigrator.php',
601602
'OCP\\UserMigration\\TMigratorBasicVersionHandling' => __DIR__ . '/../../..' . '/lib/public/UserMigration/TMigratorBasicVersionHandling.php',
602603
'OCP\\UserMigration\\UserMigrationException' => __DIR__ . '/../../..' . '/lib/public/UserMigration/UserMigrationException.php',
603604
'OCP\\UserStatus\\IManager' => __DIR__ . '/../../..' . '/lib/public/UserStatus/IManager.php',

lib/public/UserMigration/IMigrator.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,14 +87,6 @@ public function getDescription(): string;
8787
*/
8888
public function getVersion(): int;
8989

90-
/**
91-
* Returns an estimate of the exported data size in KiB.
92-
* Should be fast, favor performance over accuracy.
93-
*
94-
* @since 24.0.0
95-
*/
96-
public function getExportEstimatedSize(IUser $user): int;
97-
9890
/**
9991
* Checks whether it is able to import a version of the export format for this migrator
10092
* Use $importSource->getMigratorVersion($this->getId()) to get the version from the archive
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* @copyright 2022 Christopher Ng <[email protected]>
7+
*
8+
* @author Christopher Ng <[email protected]>
9+
* @author Côme Chilliet <[email protected]>
10+
*
11+
* @license GNU AGPL version 3 or any later version
12+
*
13+
* This program is free software: you can redistribute it and/or modify
14+
* it under the terms of the GNU Affero General Public License as
15+
* published by the Free Software Foundation, either version 3 of the
16+
* License, or (at your option) any later version.
17+
*
18+
* This program is distributed in the hope that it will be useful,
19+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
20+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21+
* GNU Affero General Public License for more details.
22+
*
23+
* You should have received a copy of the GNU Affero General Public License
24+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
25+
*
26+
*/
27+
28+
namespace OCP\UserMigration;
29+
30+
use OCP\IUser;
31+
32+
/**
33+
* @since 25.0.0
34+
*/
35+
interface ISizeEstimationMigrator {
36+
/**
37+
* Returns an estimate of the exported data size in KiB.
38+
* Should be fast, favor performance over accuracy.
39+
*
40+
* @since 25.0.0
41+
*/
42+
public function getEstimatedExportSize(IUser $user): int;
43+
}

0 commit comments

Comments
 (0)