aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/Command
diff options
context:
space:
mode:
authorFerdinand Thiessen <opensource@fthiessen.de>2025-05-14 00:38:32 +0200
committerFerdinand Thiessen <opensource@fthiessen.de>2025-05-14 10:18:04 +0200
commit1ae3fa40037b0ac6ec279e5cb66587889bbe1507 (patch)
tree55d2287e632fee90bd50696fa3f1bc7417083ee7 /apps/files_trashbin/lib/Command
parent0f03a892b980bbd8faebf554e20e6d727fc1b373 (diff)
downloadnextcloud-server-1ae3fa40037b0ac6ec279e5cb66587889bbe1507.tar.gz
nextcloud-server-1ae3fa40037b0ac6ec279e5cb66587889bbe1507.zip
chore: replace leagcy OC_Helper calls with OCP\Utilchore/oc-helper-filesize
- Replace legacy calls with OCP\Util - Add missing deprecation notices - Inline implementation in OCP\Util and call it from OC_Helper Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
Diffstat (limited to 'apps/files_trashbin/lib/Command')
-rw-r--r--apps/files_trashbin/lib/Command/CleanUp.php2
-rw-r--r--apps/files_trashbin/lib/Command/Size.php8
2 files changed, 5 insertions, 5 deletions
diff --git a/apps/files_trashbin/lib/Command/CleanUp.php b/apps/files_trashbin/lib/Command/CleanUp.php
index daaa4003f7a..fc0157ec461 100644
--- a/apps/files_trashbin/lib/Command/CleanUp.php
+++ b/apps/files_trashbin/lib/Command/CleanUp.php
@@ -96,7 +96,7 @@ class CleanUp extends Command {
$node = $this->rootFolder->get($path);
if ($verbose) {
- $output->writeln('Deleting <info>' . \OC_Helper::humanFileSize($node->getSize()) . "</info> in trash for <info>$uid</info>.");
+ $output->writeln('Deleting <info>' . \OCP\Util::humanFileSize($node->getSize()) . "</info> in trash for <info>$uid</info>.");
}
$node->delete();
if ($this->rootFolder->nodeExists($path)) {
diff --git a/apps/files_trashbin/lib/Command/Size.php b/apps/files_trashbin/lib/Command/Size.php
index 11699ce25ea..385872c436c 100644
--- a/apps/files_trashbin/lib/Command/Size.php
+++ b/apps/files_trashbin/lib/Command/Size.php
@@ -45,7 +45,7 @@ class Size extends Base {
$size = $input->getArgument('size');
if ($size) {
- $parsedSize = \OC_Helper::computerFileSize($size);
+ $parsedSize = \OCP\Util::computerFileSize($size);
if ($parsedSize === false) {
$output->writeln('<error>Failed to parse input size</error>');
return -1;
@@ -70,7 +70,7 @@ class Size extends Base {
if ($globalSize < 0) {
$globalHumanSize = 'default (50% of available space)';
} else {
- $globalHumanSize = \OC_Helper::humanFileSize($globalSize);
+ $globalHumanSize = \OCP\Util::humanFileSize($globalSize);
}
if ($user) {
@@ -79,7 +79,7 @@ class Size extends Base {
if ($userSize < 0) {
$userHumanSize = ($globalSize < 0) ? $globalHumanSize : "default($globalHumanSize)";
} else {
- $userHumanSize = \OC_Helper::humanFileSize($userSize);
+ $userHumanSize = \OCP\Util::humanFileSize($userSize);
}
if ($input->getOption('output') == self::OUTPUT_FORMAT_PLAIN) {
@@ -106,7 +106,7 @@ class Size extends Base {
if (count($userValues)) {
$output->writeln('Per-user sizes:');
$this->writeArrayInOutputFormat($input, $output, array_map(function ($size) {
- return \OC_Helper::humanFileSize($size);
+ return \OCP\Util::humanFileSize($size);
}, $userValues));
} else {
$output->writeln('No per-user sizes configured');