123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- <?php
-
-
- echo "Garbage Collector<BR>";
- HotPotGC($_configuration['root_sys'],1,1);
-
- function HotPotGC($root_sys,$flag,$userID)
- {
-
- $documentPath = $root_sys."courses";
- require_once(api_get_path(LIBRARY_PATH)."fileManage.lib.php");
- HotPotGCt($documentPath,$flag,$userID);
- }
- function HotPotGCt($folder,$flag,$userID)
- {
- $filelist = array();
- if ($dir = @opendir($folder)) {
- while (($file = readdir($dir)) !== false) {
- if ( $file != ".") {
- if ($file != "..")
- {
- $full_name = $folder."/".$file;
- if (is_dir($full_name))
- {
- HotPotGCt($folder."/".$file,$flag);
- }
- else
- {
- $filelist[] = $file;
- }
- }
- }
- }
- closedir($dir);
- }
- while (list ($key, $val) = each ($filelist))
- {
- if (stristr($val,$userID.".t.html"))
- { if ($flag == 1)
- {
- my_delete($folder."/".$val);
- }
- else
- {
- echo $folder."/".$val."<br />";
- }
- }
- }
- }
- ?>
|