aboutsummaryrefslogtreecommitdiff
path: root/cli/user-info.php
diff options
context:
space:
mode:
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";
+ }
+}