From 992a811df66de7be66c64d3703e854c15a58d337 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Thu, 2 Mar 2017 23:04:38 +0100 Subject: CLI add language to install https://github.com/FreshRSS/FreshRSS/issues/1445 --- cli/do-install.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/do-install.php b/cli/do-install.php index 16d03daaf..4cd7597fe 100755 --- a/cli/do-install.php +++ b/cli/do-install.php @@ -6,6 +6,7 @@ require(LIB_PATH . '/lib_install.php'); $params = array( 'environment:', 'base_url:', + 'language:', 'title:', 'default_user:', 'allow_anonymous', @@ -30,7 +31,7 @@ $options = getopt('', array_merge($params, $dBparams)); if (empty($options['default_user'])) { fail('Usage: ' . basename(__FILE__) . " --default_user admin ( --auth_type form" . " --environment production --base_url https://rss.example.net/" . - " --title FreshRSS --allow_anonymous --api_enabled" . + " --language en --title FreshRSS --allow_anonymous --api_enabled" . " --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123" . " --db-base freshrss --db-prefix freshrss_ --disable_update )"); } -- cgit v1.2.3 From ae1bf1f56fcfa920db3d5092cb18dced4cbcb434 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 3 Mar 2017 11:47:04 +0100 Subject: CLI do no list un-created user admin https://github.com/FreshRSS/FreshRSS/issues/1448 --- cli/list-users.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/list-users.php b/cli/list-users.php index e690ff451..610a9dd7b 100755 --- a/cli/list-users.php +++ b/cli/list-users.php @@ -4,7 +4,7 @@ require('_cli.php'); $users = listUsers(); sort($users); -if (FreshRSS_Context::$system_conf->default_user !== '') { +if (FreshRSS_Context::$system_conf->default_user !== '' && in_array(FreshRSS_Context::$system_conf->default_user, $users, true)) { array_unshift($users, FreshRSS_Context::$system_conf->default_user); $users = array_unique($users); } -- cgit v1.2.3 From c544f510d26377684aefe8a27b484ee22bbd4f69 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 3 Mar 2017 11:55:58 +0100 Subject: CLI: install language https://github.com/FreshRSS/FreshRSS/issues/1445#issuecomment-283908468 --- cli/README.md | 3 ++- cli/reconfigure.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'cli') diff --git a/cli/README.md b/cli/README.md index 5662e2d83..cbab699dc 100644 --- a/cli/README.md +++ b/cli/README.md @@ -32,10 +32,11 @@ Options in parenthesis are optional. ```sh cd /usr/share/FreshRSS -./cli/do-install.php --default_user admin ( --auth_type form --environment production --base_url https://rss.example.net/ --title FreshRSS --allow_anonymous --api_enabled --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123 --db-base freshrss --db-prefix freshrss ) +./cli/do-install.php --default_user admin ( --auth_type form --environment production --base_url https://rss.example.net/ --language en --title FreshRSS --allow_anonymous --api_enabled --db-type mysql --db-host localhost:3306 --db-user freshrss --db-password dbPassword123 --db-base freshrss --db-prefix freshrss ) # --auth_type can be: 'form' (default), 'http_auth' (using the Web server access control), 'none' (dangerous) # --db-type can be: 'sqlite' (default), 'mysql' (MySQL or MariaDB), 'pgsql' (PostgreSQL) # --environment can be: 'production' (default), 'development' (for additional log messages) +# --language can be: 'en' (default), 'fr', or one of the [supported languages](../app/i18n/) # --db-prefix is an optional prefix in front of the names of the tables. We suggest using 'freshrss_' # This command does not create the default user. Do that with ./cli/create-user.php diff --git a/cli/reconfigure.php b/cli/reconfigure.php index da451b3ef..c6902da67 100755 --- a/cli/reconfigure.php +++ b/cli/reconfigure.php @@ -5,6 +5,7 @@ require('_cli.php'); $params = array( 'environment:', 'base_url:', + 'language:', 'title:', 'default_user:', 'allow_anonymous', -- cgit v1.2.3 From ada94465e62d5809303afffc636fdae87aff2738 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 3 Mar 2017 23:01:33 +0100 Subject: CLI: More infos in user-info https://github.com/FreshRSS/FreshRSS/issues/1449#issuecomment-283927614 --- cli/README.md | 3 ++- cli/user-info.php | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'cli') diff --git a/cli/README.md b/cli/README.md index 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.php index 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 format echo $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"; } } -- cgit v1.2.3 From 37957d45b24306f494554ee1e6c911998ca68643 Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Fri, 3 Mar 2017 23:15:50 +0100 Subject: Allows do-install.php only if data/do-install.txt exists https://github.com/FreshRSS/FreshRSS/issues/1449 --- cli/do-install.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'cli') diff --git a/cli/do-install.php b/cli/do-install.php index 4cd7597fe..143ca5c3e 100755 --- a/cli/do-install.php +++ b/cli/do-install.php @@ -3,6 +3,10 @@ require('_cli.php'); require(LIB_PATH . '/lib_install.php'); +if (!file_exists(DATA_PATH . '/do-install.txt')) { + fail('FreshRSS looks to be already installed! Please use `./cli/reconfigure.php` instead.'); +} + $params = array( 'environment:', 'base_url:', -- cgit v1.2.3