aboutsummaryrefslogtreecommitdiff
path: root/cli/user-info.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-12-26 16:33:47 +0100
committerGravatar GitHub <noreply@github.com> 2016-12-26 16:33:47 +0100
commit5f637bd816b7323885bfe1751a1724ee59a822f6 (patch)
tree67028e45792c575c25c92616633f64cc7a4a13eb /cli/user-info.php
parentc3d2496bb3ce665faf4a0f24a4aa2ab300ab56d3 (diff)
parent109f63be2620cf108efdfebd43f491e2720c824a (diff)
Merge pull request #1399 from FreshRSS/dev1.6.2
Release 1.6.2
Diffstat (limited to 'cli/user-info.php')
-rwxr-xr-xcli/user-info.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/cli/user-info.php b/cli/user-info.php
new file mode 100755
index 000000000..dd38e6c7f
--- /dev/null
+++ b/cli/user-info.php
@@ -0,0 +1,35 @@
+#!/usr/bin/php
+<?php
+require('_cli.php');
+
+$options = getopt('h', array(
+ 'user:',
+ ));
+
+if (empty($options['user'])) {
+ fail('Usage: ' . basename(__FILE__) . " -h --user username");
+}
+
+$users = $options['user'] === '*' ? listUsers() : array($options['user']);
+
+foreach ($users as $username) {
+ $username = cliInitUser($username);
+
+ $entryDAO = FreshRSS_Factory::createEntryDao($username);
+
+ echo $username === FreshRSS_Context::$system_conf->default_user ? '*' : ' ', "\t";
+
+ if (isset($options['h'])) { //Human format
+ echo
+ $username, "\t",
+ date('c', FreshRSS_UserDAO::mtime($username)), "\t",
+ format_bytes($entryDAO->size()), "\t",
+ "\n";
+ } else {
+ echo
+ $username, "\t",
+ FreshRSS_UserDAO::mtime($username), "\t",
+ $entryDAO->size(), "\t",
+ "\n";
+ }
+}