summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPytal <24800714+Pytal@users.noreply.github.com>2022-05-30 17:16:33 -0700
committerGitHub <noreply@github.com>2022-05-30 17:16:33 -0700
commit4873faa951eb3fdc5743b62a077d978cc16b15ec (patch)
treea1428c4c6f440e7ae16ccca679e9565b13369a18 /lib
parentd7ec631d5fa0ebe1caefdd5ad384950a79e828f6 (diff)
parentaaedc95e817c55576ed7413bc2220800bb66ef85 (diff)
downloadnextcloud-server-4873faa951eb3fdc5743b62a077d978cc16b15ec.tar.gz
nextcloud-server-4873faa951eb3fdc5743b62a077d978cc16b15ec.zip
Merge pull request #32206 from nextcloud/enh/migrator-add-estimatedsize-getter
Diffstat (limited to 'lib')
-rw-r--r--lib/composer/composer/autoload_classmap.php1
-rw-r--r--lib/composer/composer/autoload_static.php1
-rw-r--r--lib/public/UserMigration/ISizeEstimationMigrator.php43
3 files changed, 45 insertions, 0 deletions
diff --git a/lib/composer/composer/autoload_classmap.php b/lib/composer/composer/autoload_classmap.php
index ae80dc78b03..d2eb52ac5e8 100644
--- a/lib/composer/composer/autoload_classmap.php
+++ b/lib/composer/composer/autoload_classmap.php
@@ -569,6 +569,7 @@ return array(
'OCP\\UserMigration\\IExportDestination' => $baseDir . '/lib/public/UserMigration/IExportDestination.php',
'OCP\\UserMigration\\IImportSource' => $baseDir . '/lib/public/UserMigration/IImportSource.php',
'OCP\\UserMigration\\IMigrator' => $baseDir . '/lib/public/UserMigration/IMigrator.php',
+ 'OCP\\UserMigration\\ISizeEstimationMigrator' => $baseDir . '/lib/public/UserMigration/ISizeEstimationMigrator.php',
'OCP\\UserMigration\\TMigratorBasicVersionHandling' => $baseDir . '/lib/public/UserMigration/TMigratorBasicVersionHandling.php',
'OCP\\UserMigration\\UserMigrationException' => $baseDir . '/lib/public/UserMigration/UserMigrationException.php',
'OCP\\UserStatus\\IManager' => $baseDir . '/lib/public/UserStatus/IManager.php',
diff --git a/lib/composer/composer/autoload_static.php b/lib/composer/composer/autoload_static.php
index 327c44a739c..a208f213de8 100644
--- a/lib/composer/composer/autoload_static.php
+++ b/lib/composer/composer/autoload_static.php
@@ -598,6 +598,7 @@ class ComposerStaticInit749170dad3f5e7f9ca158f5a9f04f6a2
'OCP\\UserMigration\\IExportDestination' => __DIR__ . '/../../..' . '/lib/public/UserMigration/IExportDestination.php',
'OCP\\UserMigration\\IImportSource' => __DIR__ . '/../../..' . '/lib/public/UserMigration/IImportSource.php',
'OCP\\UserMigration\\IMigrator' => __DIR__ . '/../../..' . '/lib/public/UserMigration/IMigrator.php',
+ 'OCP\\UserMigration\\ISizeEstimationMigrator' => __DIR__ . '/../../..' . '/lib/public/UserMigration/ISizeEstimationMigrator.php',
'OCP\\UserMigration\\TMigratorBasicVersionHandling' => __DIR__ . '/../../..' . '/lib/public/UserMigration/TMigratorBasicVersionHandling.php',
'OCP\\UserMigration\\UserMigrationException' => __DIR__ . '/../../..' . '/lib/public/UserMigration/UserMigrationException.php',
'OCP\\UserStatus\\IManager' => __DIR__ . '/../../..' . '/lib/public/UserStatus/IManager.php',
diff --git a/lib/public/UserMigration/ISizeEstimationMigrator.php b/lib/public/UserMigration/ISizeEstimationMigrator.php
new file mode 100644
index 00000000000..05abe48ea8f
--- /dev/null
+++ b/lib/public/UserMigration/ISizeEstimationMigrator.php
@@ -0,0 +1,43 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * @copyright 2022 Christopher Ng <chrng8@gmail.com>
+ *
+ * @author Christopher Ng <chrng8@gmail.com>
+ * @author Côme Chilliet <come.chilliet@nextcloud.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\UserMigration;
+
+use OCP\IUser;
+
+/**
+ * @since 25.0.0
+ */
+interface ISizeEstimationMigrator {
+ /**
+ * Returns an estimate of the exported data size in KiB.
+ * Should be fast, favor performance over accuracy.
+ *
+ * @since 25.0.0
+ */
+ public function getEstimatedExportSize(IUser $user): int;
+}