Browse Source

Merge pull request #38104 from nextcloud/feat/um-32-bit

tags/v27.0.0beta2
Pytal 1 year ago
parent
commit
972b2097d0
No account linked to committer's email address

+ 2
- 2
apps/dav/lib/UserMigration/CalendarMigrator.php View File

@@ -211,7 +211,7 @@ class CalendarMigrator implements IMigrator, ISizeEstimationMigrator {
/**
* {@inheritDoc}
*/
public function getEstimatedExportSize(IUser $user): int {
public function getEstimatedExportSize(IUser $user): int|float {
$calendarExports = $this->getCalendarExports($user, new NullOutput());
$calendarCount = count($calendarExports);

@@ -230,7 +230,7 @@ class CalendarMigrator implements IMigrator, ISizeEstimationMigrator {
// 450B for each component (events, todos, alarms, etc.)
$size += ($componentCount * 450) / 1024;

return (int)ceil($size);
return ceil($size);
}

/**

+ 2
- 2
apps/dav/lib/UserMigration/ContactsMigrator.php View File

@@ -202,7 +202,7 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator {
/**
* {@inheritDoc}
*/
public function getEstimatedExportSize(IUser $user): int {
public function getEstimatedExportSize(IUser $user): int|float {
$addressBookExports = $this->getAddressBookExports($user, new NullOutput());
$addressBookCount = count($addressBookExports);

@@ -217,7 +217,7 @@ class ContactsMigrator implements IMigrator, ISizeEstimationMigrator {
// 350B for each contact
$size += ($contactsCount * 350) / 1024;

return (int)ceil($size);
return ceil($size);
}

/**

+ 2
- 2
apps/files_trashbin/lib/UserMigration/TrashbinMigrator.php View File

@@ -67,7 +67,7 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator {
/**
* {@inheritDoc}
*/
public function getEstimatedExportSize(IUser $user): int {
public function getEstimatedExportSize(IUser $user): int|float {
$uid = $user->getUID();

try {
@@ -75,7 +75,7 @@ class TrashbinMigrator implements IMigrator, ISizeEstimationMigrator {
if (!$trashbinFolder instanceof Folder) {
return 0;
}
return (int)ceil($trashbinFolder->getSize() / 1024);
return ceil($trashbinFolder->getSize() / 1024);
} catch (\Throwable $e) {
return 0;
}

+ 2
- 2
apps/settings/lib/UserMigration/AccountMigrator.php View File

@@ -84,7 +84,7 @@ class AccountMigrator implements IMigrator, ISizeEstimationMigrator {
/**
* {@inheritDoc}
*/
public function getEstimatedExportSize(IUser $user): int {
public function getEstimatedExportSize(IUser $user): int|float {
$size = 100; // 100KiB for account JSON

try {
@@ -97,7 +97,7 @@ class AccountMigrator implements IMigrator, ISizeEstimationMigrator {
// Skip avatar in size estimate on failure
}

return (int)ceil($size);
return ceil($size);
}

/**

+ 2
- 1
lib/public/UserMigration/ISizeEstimationMigrator.php View File

@@ -38,6 +38,7 @@ interface ISizeEstimationMigrator {
* Should be fast, favor performance over accuracy.
*
* @since 25.0.0
* @since 27.0.0 return value may overflow from int to float
*/
public function getEstimatedExportSize(IUser $user): int;
public function getEstimatedExportSize(IUser $user): int|float;
}

Loading…
Cancel
Save