Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/documentation.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Ng <chrng8@gmail.com>2022-07-26 21:34:53 +0300
committerChristopher Ng <chrng8@gmail.com>2022-07-26 21:34:53 +0300
commit1169dd916cf134e7da2a3b291a3b5c84ab38a442 (patch)
tree0f7e5f3a1b9b1a66e80e4d9815d465340e8b4188
parent3778afcbe6a495816c995cf8a96898b5682302e6 (diff)
Document export size estimation APIexport-size-estimation-api
Signed-off-by: Christopher Ng <chrng8@gmail.com>
-rw-r--r--developer_manual/digging_deeper/user_migration.rst14
1 files changed, 13 insertions, 1 deletions
diff --git a/developer_manual/digging_deeper/user_migration.rst b/developer_manual/digging_deeper/user_migration.rst
index ff4798ddb..4e0b73611 100644
--- a/developer_manual/digging_deeper/user_migration.rst
+++ b/developer_manual/digging_deeper/user_migration.rst
@@ -30,12 +30,13 @@ whenever a user export or import begins.
use OCP\UserMigration\IExportDestination;
use OCP\UserMigration\IImportSource;
use OCP\UserMigration\IMigrator;
+ use OCP\UserMigration\ISizeEstimationMigrator;
use OCP\UserMigration\TMigratorBasicVersionHandling;
use OCP\UserMigration\UserMigrationException;
use Symfony\Component\Console\Output\OutputInterface;
use Throwable;
- class MyAppMigrator implements IMigrator {
+ class MyAppMigrator implements IMigrator, ISizeEstimationMigrator {
use TMigratorBasicVersionHandling;
private IMyAppManager $myAppManager;
@@ -55,6 +56,17 @@ whenever a user export or import begins.
}
/**
+ * 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 {
+ $size = 100; // 100KiB for user data JSON
+ return $size;
+ }
+
+ /**
* Export user data
*
* @throws UserMigrationException