X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=ext%2Foauth-client%2Foauth_client.civix.php;h=3d9ae5d3f523f062ef5fa5a3b608c0eca9dfb785;hb=6eb1d7911d53b6ba1ed6cfcc755692026b0995af;hp=bfc396669551c6d463f9681c8af139ee169764db;hpb=708c2541732beb72d98fccdfd4ef34c5b96ad055;p=civicrm-core.git diff --git a/ext/oauth-client/oauth_client.civix.php b/ext/oauth-client/oauth_client.civix.php index bfc3966695..3d9ae5d3f5 100644 --- a/ext/oauth-client/oauth_client.civix.php +++ b/ext/oauth-client/oauth_client.civix.php @@ -91,9 +91,9 @@ function _oauth_client_civix_civicrm_config(&$config = NULL) { } $configured = TRUE; - $template =& CRM_Core_Smarty::singleton(); + $template = CRM_Core_Smarty::singleton(); - $extRoot = dirname(__FILE__) . DIRECTORY_SEPARATOR; + $extRoot = __DIR__ . DIRECTORY_SEPARATOR; $extDir = $extRoot . 'templates'; if (is_array($template->template_dir)) { @@ -204,64 +204,6 @@ function _oauth_client_civix_upgrader() { } } -/** - * Search directory tree for files which match a glob pattern. - * - * Note: Dot-directories (like "..", ".git", or ".svn") will be ignored. - * 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" - * - * @return array - */ -function _oauth_client_civix_find_files($dir, $pattern) { - return CRM_Utils_File::findFiles($dir, $pattern); -} - -/** - * (Delegated) Implements hook_civicrm_managed(). - * - * Find any *.mgd.php files, merge their content, and return. - * - * @link https://docs.civicrm.org/dev/en/latest/hooks/hook_civicrm_managed - */ -function _oauth_client_civix_civicrm_managed(&$entities) { - $mgdFiles = _oauth_client_civix_find_files(__DIR__, '*.mgd.php'); - sort($mgdFiles); - foreach ($mgdFiles as $file) { - $es = include $file; - foreach ($es as $e) { - if (empty($e['module'])) { - $e['module'] = E::LONG_NAME; - } - if (empty($e['params']['version'])) { - $e['params']['version'] = '3'; - } - $entities[] = $e; - } - } -} - -/** - * Glob wrapper which is guaranteed to return an array. - * - * The documentation for glob() says, "On some systems it is impossible to - * distinguish between empty match and an error." Anecdotally, the return - * result for an empty match is sometimes array() and sometimes FALSE. - * This wrapper provides consistency. - * - * @link http://php.net/glob - * @param string $pattern - * - * @return array - */ -function _oauth_client_civix_glob($pattern) { - $result = glob($pattern); - return is_array($result) ? $result : []; -} - /** * Inserts a navigation menu item at a given place in the hierarchy. *