You are here

function advagg_get_remote_libraries_versions in Advanced CSS/JS Aggregation 7.2

Update github version numbers to the latest.

Parameters

bool $refresh: Set to TRUE to skip the cache and force a refresh of the data.

Return value

mixed Key Value pair of the project name and remote version number. If $target is set then that version number is returned.

2 calls to advagg_get_remote_libraries_versions()
advagg_cron in ./advagg.module
Implements hook_cron().
advagg_get_version_description in ./advagg.module
Get the description text based off the library version.
2 string references to 'advagg_get_remote_libraries_versions'
advagg_get_remote_libraries_version in ./advagg.module
Get the latest version number for the remote version.
advagg_get_remote_libraries_versions_cache in ./advagg.module
Get the remote and local versions cache of the available libraries.

File

./advagg.module, line 5681
Advanced CSS/JS aggregation module.

Code

function advagg_get_remote_libraries_versions($refresh = FALSE) {
  $cid = __FUNCTION__;
  $versions = array();
  if (!$refresh) {
    $versions = advagg_get_remote_libraries_versions_cache($cid);
    if (!empty($versions)) {
      return $versions;
    }
  }
  if (is_callable('libraries_info')) {
    $libraries = libraries_info();
    foreach ($libraries as $key => $library) {

      // Get current version.
      $libraries_detect = libraries_detect($key);
      if (isset($libraries_detect['version'])) {
        $versions[$key]['local'] = $libraries_detect['version'];
      }
      elseif (!empty($libraries_detect['local version'])) {
        $versions[$key]['local'] = $libraries_detect['local version'];
      }

      // Check if callback is live.
      $remote = advagg_get_remote_libraries_version($key, $library, FALSE);
      if (!empty($remote)) {
        $versions[$key]['remote'] = $remote;
      }
    }
  }
  if (!empty($versions)) {
    cache_set($cid, $versions, 'cache_advagg_info');
  }
  return $versions;
}