Skip to content
Snippets Groups Projects

Issue #3271240: Allow getting update information for any project not just Drupal core

Merged Issue #3271240: Allow getting update information for any project not just Drupal core
All threads resolved!
Merged Ted Bowman requested to merge issue/automatic_updates-3271240:3271240-any-project into 8.x-2.x
All threads resolved!
1 file
+ 18
4
Compare changes
  • Side-by-side
  • Inline
+ 18
4
@@ -9,12 +9,26 @@ use Drupal\update\UpdateManagerInterface;
@@ -9,12 +9,26 @@ use Drupal\update\UpdateManagerInterface;
/**
/**
* Defines a class for retrieving project information from Update module.
* Defines a class for retrieving project information from Update module.
*
* @todo Allow passing a project name to handle more than Drupal core in
* https://www.drupal.org/i/3271240.
*/
*/
class ProjectInfo {
class ProjectInfo {
 
/**
 
* The project name.
 
*
 
* @var string
 
*/
 
protected $name;
 
 
/**
 
* Constructs a ProjectInfo object.
 
*
 
* @param string $name
 
* The project name.
 
*/
 
public function __construct(string $name) {
 
$this->name = $name;
 
}
 
/**
/**
* Returns up-to-date project information for Drupal core.
* Returns up-to-date project information for Drupal core.
*
*
@@ -32,7 +46,7 @@ class ProjectInfo {
@@ -32,7 +46,7 @@ class ProjectInfo {
public function getProjectInfo(bool $refresh = FALSE): array {
public function getProjectInfo(bool $refresh = FALSE): array {
$available_updates = update_get_available($refresh);
$available_updates = update_get_available($refresh);
$project_data = update_calculate_project_data($available_updates);
$project_data = update_calculate_project_data($available_updates);
return $project_data['drupal'];
return $project_data[$this->name];
}
}
/**
/**
Loading