-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathdispatch.php
More file actions
37 lines (30 loc) · 905 Bytes
/
dispatch.php
File metadata and controls
37 lines (30 loc) · 905 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
// phpcs:disable PSR1.Files.SideEffects.FoundWithSymbols
/**
* Statistics plugin - data logger
*
* This logger is called via JavaScript
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Andreas Gohr <gohr@cosmocode.de>
*/
use dokuwiki\plugin\statistics\IgnoreException;
use dokuwiki\ErrorHandler;
if (!defined('DOKU_INC')) define('DOKU_INC', realpath(__DIR__ . '/../../../') . '/');
define('DOKU_DISABLE_GZIP_OUTPUT', 1);
require_once(DOKU_INC . 'inc/init.php');
session_write_close();
global $INPUT;
/** @var helper_plugin_statistics $plugin */
$plugin = plugin_load('helper', 'statistics');
$plugin->sendGIF(); // browser be done
$logger = $plugin->getLogger();
$logger->begin(); // triggers autologging
switch ($INPUT->str('do')) {
case 'v':
$logger->logPageView();
break;
case 'o':
$logger->logOutgoing();
}
$logger->end();