/** * Removes expired tmp directories. It calls by WPL cronjobs * @author Howard <*****@*****.**> * @static */ public static function delete_expired_tmp() { $path = wpl_global::get_tmp_path(); $folders = wpl_folder::folders($path); $now = time(); $_3days = 259200; #3days in seconds foreach ($folders as $folder) { $full_path = $path . $folder; $latest_modification_time = filemtime($full_path); if ($now - $latest_modification_time > $_3days) { wpl_folder::delete($full_path); } } }