You are here

function hybridauth_providers_files in HybridAuth Social Login 7.2

Same name and namespace in other branches
  1. 6.2 hybridauth.module \hybridauth_providers_files()

Returns available providers files, keyed by filename without extension.

2 calls to hybridauth_providers_files()
hybridauth_admin_settings in ./hybridauth.admin.inc
Form constructor for the hybridauth admin settings form.
hybridauth_providers_list in ./hybridauth.module
Internal functions.

File

./hybridauth.module, line 759
Main file for the HybridAuth module.

Code

function hybridauth_providers_files($reset = FALSE) {
  $files = array();

  // Try to get cached value if allowed: $reset == FALSE.
  if (!$reset) {
    $cache = cache_get('hybridauth_providers_files');
    if (!empty($cache->data)) {
      $files = $cache->data;
    }
  }

  // Scan Providers directory if $reset == TRUE or there was no cached value.
  if (empty($files)) {
    $files = file_scan_directory(_hybridauth_library_path() . '/Hybrid/Providers', '/\\.php$/', array(
      'key' => 'name',
    ));
    cache_set('hybridauth_providers_files', $files, 'cache', CACHE_TEMPORARY);
  }
  return $files;
}