stats_svn.php 1.32 KB
Newer Older
Ayolo's avatar
Ayolo committed
1 2 3 4 5 6 7 8 9
<?php

/* Copyright 2007
* - Simon Lopez < simon DOT lopez AT ayolo DOT org >
*
* Ce fichier fait partie du site de l'Association des Étudiants de
* l'UTBM, http://ae.utbm.fr.
*
* This program is free software; you can redistribute it and/or
Ayolo's avatar
Ayolo committed
10
* modify it under the terms of the GNU General Public License a
Ayolo's avatar
Ayolo committed
11 12 13 14 15 16 17 18 19 20 21 22 23 24
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
*/

Ayolo's avatar
Ayolo committed
25
$topdir="./";
Ayolo's avatar
Ayolo committed
26 27 28 29 30 31 32 33 34

include($topdir."include/graph.inc.php");

$cam=new camembert(600,380,array(),2,0,0,0,0,0,0,10,150);

$svn=exec("/usr/share/php5/exec/svn_stats.sh");

$svn=explode("|",$svn,-1);

Ayolo's avatar
Ayolo committed
35
$stats=array();
Ayolo's avatar
Ayolo committed
36 37 38 39 40
for($i=0;$i<count($svn);$i++)
{
  if(!empty($svn[$i]))
  {
    $tmp=explode(" ",$svn[$i]);
41 42
    $j=$tmp[0];
    $stats[$j]=$tmp[1];
Ayolo's avatar
Ayolo committed
43 44
  }
}
Ayolo's avatar
Ayolo committed
45
arsort($stats);
Ayolo's avatar
Ayolo committed
46

47
foreach($stats as $author => $commits)
Ayolo's avatar
Ayolo committed
48
  $cam->data($commits,$author);
Ayolo's avatar
Ayolo committed
49 50 51 52 53 54

$cam->png_render();

exit();

?>