<?php
$dir = __DIR__."/../templates_c"; // The directory "Templates_C" uses phprunner to load files
$files = glob($dir.'/*.pdf'); // We obtain the name of all the PDF files
foreach($files as $file){
    $lastModifiedTime = filemtime($file);
    $currentTime = time();
    $timeDiff = abs($currentTime - $lastModifiedTime)/(60*60); //en horas
    if(is_file($file) && $timeDiff > 1) { // Delete the log files greater than 1 hours.
			unlink($file); // Delete of the file
		}
}
?>