A free, self-hostable news aggregator…
CLI: More infos in user-info
Alexandre Alapetiteada94465e62d
diff --git a/cli/README.md b/cli/README.mdindex cbab699dc..5434d1964 100644--- a/cli/README.md+++ b/cli/README.md@@ -63,7 +63,8 @@ cd /usr/share/FreshRSS./cli/user-info.php -h --user username# -h is to use a human-readable format# --user can be a username, or '*' to loop on all users-# Returns a * if the user is admin, the name of the user, the date/time of last action, and the size occupied+# Returns a * if the user is admin, the name of the user, the date/time of last action, the size occupied,+# and the number of: feeds, read articles, unread articles, and favourites```diff --git a/cli/user-info.php b/cli/user-info.phpindex dd38e6c7f..aa3e239b8 100755--- a/cli/user-info.php+++ b/cli/user-info.php@@ -14,22 +14,36 @@ $users = $options['user'] === '*' ? listUsers() : array($options['user']);foreach ($users as $username) {$username = cliInitUser($username);+ echo $username === FreshRSS_Context::$system_conf->default_user ? '*' : ' ', "\t";+ $catDAO = new FreshRSS_CategoryDAO();+ $feedDAO = FreshRSS_Factory::createFeedDao($username);$entryDAO = FreshRSS_Factory::createEntryDao($username);- echo $username === FreshRSS_Context::$system_conf->default_user ? '*' : ' ', "\t";+ $nbEntries = $entryDAO->countUnreadRead();+ $nbFavorites = $entryDAO->countUnreadReadFavorites();if (isset($options['h'])) { //Human formatecho$username, "\t",date('c', FreshRSS_UserDAO::mtime($username)), "\t",format_bytes($entryDAO->size()), "\t",+ $catDAO->count(), " categories\t",+ count($feedDAO->listFeedsIds()), " feeds\t",+ $nbEntries['read'], " reads\t",+ $nbEntries['unread'], " unreads\t",+ $nbFavorites['all'], " favourites\t","\n";} else {echo$username, "\t",FreshRSS_UserDAO::mtime($username), "\t",$entryDAO->size(), "\t",+ $catDAO->count(), "\t",+ count($feedDAO->listFeedsIds()), "\t",+ $nbEntries['read'], "\t",+ $nbEntries['unread'], "\t",+ $nbFavorites['all'], "\t","\n";}}