Пример #1
0
 /**
  * Delete cached update service file of a project.
  *
  * @param array $request
  *   A request array.
  */
 public function clearCached(array $request)
 {
     if (isset($this->cache[$request['name']])) {
         unset($this->cache[$request['name']]);
     }
     $url = Project::buildFetchUrl($request);
     $cache_file = drush_download_file_name($url);
     if (file_exists($cache_file)) {
         unlink($cache_file);
     }
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 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;
 }