From 6f1b20a6090864c6747a63b7fe19b02327ce718e Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Tue, 15 Jun 2021 21:00:05 -0400 Subject: [PATCH] Afform - Regenerate civix files --- ext/afform/admin/afform_admin.civix.php | 36 +++++-------------------- ext/afform/core/afform.civix.php | 36 +++++-------------------- ext/afform/html/afform_html.civix.php | 36 +++++-------------------- ext/afform/mock/afform_mock.civix.php | 36 +++++-------------------- 4 files changed, 24 insertions(+), 120 deletions(-) diff --git a/ext/afform/admin/afform_admin.civix.php b/ext/afform/admin/afform_admin.civix.php index 9db46b2caa..1a1fcfc28e 100644 --- a/ext/afform/admin/afform_admin.civix.php +++ b/ext/afform/admin/afform_admin.civix.php @@ -7,9 +7,9 @@ * extension. */ class CRM_AfformAdmin_ExtensionUtil { - const SHORT_NAME = "afform_admin"; - const LONG_NAME = "org.civicrm.afform_admin"; - const CLASS_PREFIX = "CRM_AfformAdmin"; + const SHORT_NAME = 'afform_admin'; + const LONG_NAME = 'org.civicrm.afform_admin'; + const CLASS_PREFIX = 'CRM_AfformAdmin'; /** * Translate a string using the extension's domain. @@ -221,7 +221,8 @@ function _afform_admin_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 _afform_admin_civix_upgrader() { * @return array */ function _afform_admin_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 (_afform_admin_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); } /** diff --git a/ext/afform/core/afform.civix.php b/ext/afform/core/afform.civix.php index a43b055281..1ab6c2b2cf 100644 --- a/ext/afform/core/afform.civix.php +++ b/ext/afform/core/afform.civix.php @@ -7,9 +7,9 @@ * extension. */ class CRM_Afform_ExtensionUtil { - const SHORT_NAME = "afform"; - const LONG_NAME = "org.civicrm.afform"; - const CLASS_PREFIX = "CRM_Afform"; + const SHORT_NAME = 'afform'; + const LONG_NAME = 'org.civicrm.afform'; + const CLASS_PREFIX = 'CRM_Afform'; /** * Translate a string using the extension's domain. @@ -221,7 +221,8 @@ function _afform_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 _afform_civix_upgrader() { * @return array */ function _afform_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 (_afform_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); } /** diff --git a/ext/afform/html/afform_html.civix.php b/ext/afform/html/afform_html.civix.php index 948f0ce17b..eb663989c5 100644 --- a/ext/afform/html/afform_html.civix.php +++ b/ext/afform/html/afform_html.civix.php @@ -7,9 +7,9 @@ * extension. */ class CRM_AfformHtml_ExtensionUtil { - const SHORT_NAME = "afform_html"; - const LONG_NAME = "org.civicrm.afform-html"; - const CLASS_PREFIX = "CRM_AfformHtml"; + const SHORT_NAME = 'afform_html'; + const LONG_NAME = 'org.civicrm.afform-html'; + const CLASS_PREFIX = 'CRM_AfformHtml'; /** * Translate a string using the extension's domain. @@ -221,7 +221,8 @@ function _afform_html_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 _afform_html_civix_upgrader() { * @return array */ function _afform_html_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 (_afform_html_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); } /** diff --git a/ext/afform/mock/afform_mock.civix.php b/ext/afform/mock/afform_mock.civix.php index 32aad3e556..37f7875270 100644 --- a/ext/afform/mock/afform_mock.civix.php +++ b/ext/afform/mock/afform_mock.civix.php @@ -7,9 +7,9 @@ * extension. */ class CRM_AfformMock_ExtensionUtil { - const SHORT_NAME = "afform_mock"; - const LONG_NAME = "org.civicrm.afform-mock"; - const CLASS_PREFIX = "CRM_AfformMock"; + const SHORT_NAME = 'afform_mock'; + const LONG_NAME = 'org.civicrm.afform-mock'; + const CLASS_PREFIX = 'CRM_AfformMock'; /** * Translate a string using the extension's domain. @@ -221,7 +221,8 @@ function _afform_mock_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 _afform_mock_civix_upgrader() { * @return array */ function _afform_mock_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 (_afform_mock_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