aboutsummaryrefslogtreecommitdiff
path: root/cli/user-info.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-11-05 21:32:08 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-11-05 21:32:08 +0100
commit6b85f8cf12f7d83bc7a6a599b48abe779dc263f0 (patch)
treebb775ae14d473c42ce4d11a61bd5ec55f1dcf2ac /cli/user-info.php
parente66247f01271eb96ac96aad6c0631d9f544ce80c (diff)
CLI: IEC prefix (binary) for units
Updated according to https://wiki.ubuntu.com/UnitsPolicy (I got confused due `ls`, which is still using 1024 but is listed as an exception) And use the formatting function already included in FreshRSS
Diffstat (limited to 'cli/user-info.php')
-rw-r--r--cli/user-info.php10
1 files changed, 1 insertions, 9 deletions
diff --git a/cli/user-info.php b/cli/user-info.php
index 5b26ecb15..dd38e6c7f 100644
--- a/cli/user-info.php
+++ b/cli/user-info.php
@@ -2,14 +2,6 @@
<?php
require('_cli.php');
-function formatSize($bytes)
-{//http://www.php.net/manual/function.disk-free-space.php#103382
- $si_prefix = array('', 'k', 'M', 'G', 'T', 'P');
- $i = min((int)log($bytes, 1024), count($si_prefix) - 1);
- return ($i <= 0) ? $bytes.'B' :
- round($bytes / pow(1024, $i), 2).' '.$si_prefix[$i].'B';
-}
-
$options = getopt('h', array(
'user:',
));
@@ -31,7 +23,7 @@ foreach ($users as $username) {
echo
$username, "\t",
date('c', FreshRSS_UserDAO::mtime($username)), "\t",
- formatSize($entryDAO->size()), "\t",
+ format_bytes($entryDAO->size()), "\t",
"\n";
} else {
echo