function StatusInfoDrush::lastCheck

8.0.x StatusInfoDrush.php StatusInfoDrush::lastCheck()
7.x StatusInfoDrush.php StatusInfoDrush::lastCheck()
master StatusInfoDrush.php StatusInfoDrush::lastCheck()

Returns time of last check of available updates.

Overrides StatusInfoInterface::lastCheck

File

lib/Drush/UpdateService/StatusInfoDrush.php, line 26
Implementation of 'drush' update_status engine for any Drupal version.

Namespace

Drush\UpdateService

Class

StatusInfoDrush

Code

function lastCheck() {
  $older = 0;

  // Iterate all projects and get the time of the older release info.
  $projects = drush_get_projects();
  foreach ($projects as $project_name => $project) {
    $request = pm_parse_request($project_name, NULL, $projects);
    $url = Project::buildFetchUrl($request);
    $cache_file = drush_download_file_name($url);
    if (file_exists($cache_file)) {
      $ctime = filectime($cache_file);
      $older = (!$older) ? $ctime : min($ctime, $older);
    }
  }

  return $older;
}