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
Messages:1
Author:Robelin
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
require_once("folder_space.class.php");

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();
$fldr->create($data);
echo "<div style=\"clear:both;\"></div>";

}
}
closedir($dir_handle);
}
UsersQuota('PATH_OF_THE_PARENT_FOLDER');