mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-03 06:44:03 +01:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user