register_hook('DOKUWIKI_STARTED', 'AFTER', $this, 'recordActivity'); } /** * @param Event $event unused (DOKUWIKI_STARTED carries no data) * @return void */ public function recordActivity(Event $event) { global $INPUT; $user = $INPUT->server->str('REMOTE_USER'); if ($user === '') { return; // anonymous request — nothing to record } /** @var helper_plugin_lastseen $hlp */ $hlp = plugin_load('helper', 'lastseen'); if ($hlp === null) { return; } // record() is internally throttled — for most requests this is a // cheap read-and-return with no disk write. $hlp->record($user); } }