Location: PHPKode > scripts > olDelete > oldelete/example_and_doc.php
<?php
/* olDelete by vicius23 (Carlos Sánchez):   DOCUMENTATION: 
 * 
 * 		Creation of the class:  $myclass = new olDelete($path,$time);
 * 														$path = Full Path to the directory (you shoud use $_SERVER["DOCUMENT_ROOT"] to get to it ;) ).
 * 															  $time = Number of Minutes that we want to specify to delete old files.
 * 		Usage:
 * 				$myclass->deleteFile(); --> Deletes all old files from the directory specified that are $time or more minutes old.
 * 				$myclass->deleteFolder(); --> Same as above, but with folders.
 * 
 * 
 * Example:
 */
 // Load class Navigator:
include_once("../classes/class.navigator.php"); //REQUIRED!!!!
 
$path=$_SERVER["DOCUMENT_ROOT"]."/myfolder/folder2/";
$time=2200;

//Create class:
$myclass=new olDelete($path,$time);

// Delete files:
$myclass->deleteFile();

// Delete Folders:
$myclass->deleteFolder();
?>
Return current item: olDelete