-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathstats.php
36 lines (32 loc) · 901 Bytes
/
stats.php
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
<?php
/**
* Stats script.
*
* Copyright 2000-2017 Horde LLC (http://www.horde.org/)
*
* See the enclosed file LICENSE for license information (GPL). If you
* did not receive this file, see http://www.horde.org/licenses/gpl.
*
* @author Anil Madhavapeddy <[email protected]>
* @package Chora
*/
require_once __DIR__ . '/lib/Application.php';
Horde_Registry::appInit('chora');
/* Spawn the file object. */
try {
$fl = $VC->getFile($where);
} catch (Horde_Vcs_Exception $e) {
Chora::fatal($e);
}
$stats = array();
foreach ($fl->getLog() as $lg) {
$qa = $lg->getAuthor();
$stats[$qa] = isset($stats[$qa]) ? ($stats[$qa] + 1) : 1;
}
arsort($stats);
$title = _("Statistics for:");
$page_output->addScriptFile('tables.js', 'horde');
Chora::header($title);
echo Chora::getHistoryViews($where)->render('stats');
require CHORA_TEMPLATES . '/stats/stats.inc';
$page_output->footer();