diff --git a/Changelog.md b/Changelog.md index 4c19491..f3193b1 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,5 +1,9 @@ # Changelog +## [3.7.6] - 12.10.2026 + +- Konsole und Cronjobs (CLI) brechen nicht mehr mit „The request object is not available in cli“ ab: Die Besucher-Erkennung (`rex::getRequest()->getClientIp()`) läuft nur noch bei echten Web-Aufrufen. Betroffen waren u. a. Cronjobs in der Umgebung „Frontend“ und Konsolenbefehle anderer AddOns, die das Frontend booten. + ## [3.7.5] - 02.10.2026 - Cronjobs „Statistik-Hashes löschen“ und „Wartung“ werden jetzt in allen Umgebungen registriert; in der Umgebung „Frontend“ scheiterten sie bisher mit `Class "…" not found` (#157) diff --git a/boot.php b/boot.php index 1abd80e..c0fe1ff 100644 --- a/boot.php +++ b/boot.php @@ -64,7 +64,8 @@ // set variable to check in EP whether the visit is coming from a logged-in user or not -if (rex::isFrontend()) { +// (not on the command line: cronjobs/console have no request object, rex::getRequest() would throw) +if (rex::isFrontend() && 'cli' !== PHP_SAPI) { $addon = rex_addon::get('statistics'); $ignore_backend_loggedin = $addon->getConfig('statistics_ignore_backend_loggedin'); $identityMode = (string) $addon->getConfig('statistics_identity_mode', 'stateless'); @@ -133,7 +134,7 @@ // do actions after content is delivered rex_extension::register('RESPONSE_SHUTDOWN', function () use ($statistics_has_backend_login, $token) { - if (rex::isFrontend()) { + if (rex::isFrontend() && 'cli' !== PHP_SAPI) { $addon = rex_addon::get('statistics'); $trackingPaused = (bool) $addon->getConfig('statistics_pause_tracking_manual', false) diff --git a/package.yml b/package.yml index 4359577..dc6e0d7 100644 --- a/package.yml +++ b/package.yml @@ -1,5 +1,5 @@ package: statistics -version: 3.7.5 +version: 3.7.6 author: Andreas Lenhardt supportpage: https://github.com/AndiLeni/statistics