From 386a8a6d70fec31b7957b9c3f7fe9b19b865b093 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 15 Jun 2021 01:50:39 -0400 Subject: [PATCH] SearchKit - Regenerate civix file --- ext/search_kit/search_kit.civix.php | 30 +++-------------------------- 1 file changed, 3 insertions(+), 27 deletions(-) diff --git a/ext/search_kit/search_kit.civix.php b/ext/search_kit/search_kit.civix.php index b8d2504826..9ed76d9214 100644 --- a/ext/search_kit/search_kit.civix.php +++ b/ext/search_kit/search_kit.civix.php @@ -221,7 +221,8 @@ function _search_kit_civix_upgrader() { * Search directory tree for files which match a glob pattern. * * Note: Dot-directories (like "..", ".git", or ".svn") will be ignored. - * Note: In Civi 4.3+, delegate to CRM_Utils_File::findFiles() + * Note: Delegate to CRM_Utils_File::findFiles(), this function kept only + * for backward compatibility of extension code that uses it. * * @param string $dir base dir * @param string $pattern , glob pattern, eg "*.txt" @@ -229,32 +230,7 @@ function _search_kit_civix_upgrader() { * @return array */ function _search_kit_civix_find_files($dir, $pattern) { - if (is_callable(['CRM_Utils_File', 'findFiles'])) { - return CRM_Utils_File::findFiles($dir, $pattern); - } - - $todos = [$dir]; - $result = []; - while (!empty($todos)) { - $subdir = array_shift($todos); - foreach (_search_kit_civix_glob("$subdir/$pattern") as $match) { - if (!is_dir($match)) { - $result[] = $match; - } - } - if ($dh = opendir($subdir)) { - while (FALSE !== ($entry = readdir($dh))) { - $path = $subdir . DIRECTORY_SEPARATOR . $entry; - if ($entry[0] == '.') { - } - elseif (is_dir($path)) { - $todos[] = $path; - } - } - closedir($dh); - } - } - return $result; + return CRM_Utils_File::findFiles($dir, $pattern); } /** -- 2.25.1