From 4d7bf7f9b6c239ca710d6e72a1fbcde35f6943c2 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Sun, 19 Dec 2021 17:27:32 -0500 Subject: [PATCH] unused function --- CRM/Utils/Mail/EmailProcessor.php | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/CRM/Utils/Mail/EmailProcessor.php b/CRM/Utils/Mail/EmailProcessor.php index 43fc9145c3..353ce5d1ca 100644 --- a/CRM/Utils/Mail/EmailProcessor.php +++ b/CRM/Utils/Mail/EmailProcessor.php @@ -44,35 +44,6 @@ class CRM_Utils_Mail_EmailProcessor { } } - /** - * Delete old files from a given directory (recursively). - * - * @param string $dir - * Directory to cleanup. - * @param int $age - * Files older than this many seconds will be deleted (default: 60 days). - */ - public static function cleanupDir($dir, $age = 5184000) { - // return early if we can’t read/write the dir - if (!is_writable($dir) or !is_readable($dir) or !is_dir($dir)) { - return; - } - - foreach (scandir($dir) as $file) { - - // don’t go up the directory stack and skip new files/dirs - if ($file == '.' or $file == '..') { - continue; - } - if (filemtime("$dir/$file") > time() - $age) { - continue; - } - - // it’s an old file/dir, so delete/recurse - is_dir("$dir/$file") ? self::cleanupDir("$dir/$file", $age) : unlink("$dir/$file"); - } - } - /** * Process the mailboxes that aren't default (ie. that aren't used by civiMail for the bounce). * -- 2.25.1