Don't write stats info to console.log when in CLI

If the file was created by the web server user, user executing the CLI command
might have no permissions. This leads to an error, and e.g. when installing
a plugin/skin via composer is converted to an ugly exception. We want to prevent that.
Anyway, these stats are most useful for the webmail use not for CLI commands.
This commit is contained in:
Aleksander Machniak
2021-10-24 15:53:47 +02:00
parent a9e096e87f
commit 8a4eecbcb0

View File

@@ -1186,6 +1186,12 @@ class rcmail extends rcube
$this->address_books = [];
// In CLI stop here, prevent from errors when the console.log might exist,
// but be not accessible
if (php_sapi_name() == 'cli') {
return;
}
// write performance stats to logs/console
if ($this->config->get('devel_mode') || $this->config->get('performance_stats')) {
// we have to disable per_user_logging to make sure stats end up in the main console log