From: colemanw Date: Sat, 26 Aug 2023 02:47:52 +0000 (-0400) Subject: APIv3 Explorer - Delete unused code X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=6047fbeb8442e18b2b4c5b35d1a848ae3f03a910;p=civicrm-core.git APIv3 Explorer - Delete unused code Delete code no longer needed now that examples have been deleted in 44def67 --- diff --git a/CRM/Admin/Page/APIExplorer.php b/CRM/Admin/Page/APIExplorer.php index 9f1a26503e..02f1d6cef4 100644 --- a/CRM/Admin/Page/APIExplorer.php +++ b/CRM/Admin/Page/APIExplorer.php @@ -20,29 +20,6 @@ */ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page { - /** - * Return unique paths for checking for examples. - * @return array - */ - private static function uniquePaths() { - // Ensure that paths with trailing slashes are properly dealt with - $paths = explode(PATH_SEPARATOR, get_include_path()); - foreach ($paths as $id => $rawPath) { - $pathParts = explode(DIRECTORY_SEPARATOR, $rawPath); - foreach ($pathParts as $partId => $part) { - if (empty($part)) { - unset($pathParts[$partId]); - } - } - $newRawPath = implode(DIRECTORY_SEPARATOR, $pathParts); - if ($newRawPath != $rawPath) { - $paths[$id] = DIRECTORY_SEPARATOR . $newRawPath; - } - } - $paths = array_unique($paths); - return $paths; - } - /** * Run page. * @@ -57,23 +34,6 @@ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page { $this->assign('operators', CRM_Core_DAO::acceptedSQLOperators()); - // List example directories - // use get_include_path to ensure that extensions are captured. - $examples = []; - $paths = self::uniquePaths(); - foreach ($paths as $path) { - $dir = \CRM_Utils_File::addTrailingSlash($path) . 'api' . DIRECTORY_SEPARATOR . 'v3' . DIRECTORY_SEPARATOR . 'examples'; - if (\CRM_Utils_File::isDir($dir)) { - foreach (scandir($dir) as $item) { - if ($item && strpos($item, '.') === FALSE && array_search($item, $examples) === FALSE) { - $examples[] = $item; - } - } - } - } - sort($examples); - $this->assign('examples', $examples); - return parent::run(); }