PHP Classes

function to do it recursively

Recommend this page to a friend!

      Folder Space Folder Quota with Percent Bar  >  All threads  >  function to do it recursively  >  (Un) Subscribe thread alerts  
Subject:function to do it recursively
Summary:I use a function that use this class for all sub-folder quota
Date:2011-01-22 20:07:00

  1. function to do it recursively   Reply   Report abuse  
Picture of Robelin Robelin - 2011-01-22 20:07:15

function UsersQuota($source) {
$dir_handle = @opendir($source) or die("Unable to open");
while ($folder = readdir($dir_handle)) {
if($folder!="." && $folder!=".." && is_dir("$source/$folder")){
$data = array(
'total'=>10485760, //10Mb //quota enter byte format
'max_height'=>300, //Set your Graphic height (px)
'max_width'=>15, //Set your Graphic width (px).
'axis'=> 'horizontal', //vertical
'bar_name'=>"$folder", //label
'dir'=> "$source/$folder", //set your directory url
'empty_color'=>'#DDDDDD', //empty bar color
'full_color'=>'#bb3902', //full bar color
'float'=>'left', //css float control left or right
'var_dump'=> false //var_dump() function for testing.
$fldr = new handle();
echo "<div style=\"clear:both;\"></div>";