Skip to content
Snippets Groups Projects
disk.graph.php 622 B
Newer Older
  • Learn to ignore specific revisions
  • <?
    	exec("/usr/local/bin/shame.py -a", $Shame);
    	for ( $i=1 ; $i < (count($Shame) - 1); $i++)
    	{
    		list($space, $place, $user, $size) = preg_split("/ +/", $Shame[$i]);
    		if ($i <= 12)
    		{
    			$item[]=$user;
    			$slice[]=preg_replace('/M/', '', ${size});
    		}
    		else {
    			$otherSize += preg_replace('/M/', '', ${size});
    		}
    	}
    //	$itemName[]="Other";
    //	$sliceSize[]=$otherSize;
    	$slice = array_merge(array($otherSize),$slice);
    	$item = array_merge(array("Other"), $item);
    
    /*	echo "<pre>";
    	print_r($slice);
    	print_r($item);*/
    
    
    Thomas Lake's avatar
     
    Thomas Lake committed
    	include("../../lib/pieChart.php");
    	piechart("Top 12 Users of disk space", $slice, $item, 1)