To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit a05ab572 authored by Reto Da Forno's avatar Reto Da Forno

update to stats collection

parent f9d2d80c
......@@ -17,11 +17,11 @@
$statsfilename = "statistics.dat";
$stats = parse_ini_file($statsfilename);
// autorefresh stats after a certain amount of time
include('update_stats.php');
// autorefresh stats after a certain amount of time -> now handled via Cron
/*include('update_stats.php');
if (!file_exists($statsfilename) || (time() - $stats['last_update']) > (3600*24*14)) { // update once a fortnight
collect_stats($statsfilename);
}
}*/
function create_pie_chart($elem_id, $data_array) {
echo "var myChart = new Chart(document.getElementById(\"$elem_id\"), {
......
......@@ -8,8 +8,16 @@
*/
?>
<?php
set_include_path(get_include_path() . PATH_SEPARATOR . "/home/flocklab/public_html/user");
require_once('include/libflocklab.php');
if (!set_time_limit(120)) {
die("unable to set max. execution time");
}
$statsFileName = "/home/flocklab/public_html/user/statistics.dat";
function collect_stats($filename)
{
......@@ -294,4 +302,6 @@ powerprofusers_per_year = \"".str_replace('"', '\'', serialize($powerprofusers_p
// write the stats into the file
file_put_contents($filename, $new_stats);
}
collect_stats($statsFileName);
?>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment