class ProjectInfo (View source)

Performs operations on drupal.org project data.

Methods

processInfoList(array $projects, array $list, string $project_type, bool $status, array $additional_elements = [])

Populates an array of project data.

string
getProjectName(Extension $file)

Determines what project a given file object belongs to.

array
filterProjectInfo(array $info, $additional_elements = [])

Filters the project .info.yml data to only save attributes we need.

Details

processInfoList(array $projects, array $list, string $project_type, bool $status, array $additional_elements = [])

Populates an array of project data.

This iterates over a list of the installed modules or themes and groups them by project and status. A few parts of this function assume that enabled modules and themes are always processed first, and if uninstalled modules or themes are being processed (there is a setting to control if uninstalled code should be included in the Available updates report or not),those are only processed after $projects has been populated with information about the enabled code. 'Hidden' modules and themes are ignored if they are not installed. 'Hidden' Modules and themes in the "Testing" package are ignored regardless of installation status.

This function also records the latest change time on the .info.yml files for each module or theme, which is important data which is used when deciding if the available update data should be invalidated.

Parameters

array $projects

Reference to the array of project data of what's installed on this site.

array $list

Array of data to process to add the relevant info to the $projects array.

string $project_type

The kind of data in the list. Can be 'module' or 'theme'.

bool $status

Boolean that controls what status (enabled or uninstalled) to process out of the $list and add to the $projects array.

array $additional_elements

(optional) Array of additional elements to be collected from the .info.yml file. Defaults to array().

string getProjectName(Extension $file)

Determines what project a given file object belongs to.

Parameters

Extension $file

An extension object.

Return Value

string

The canonical project short name.

array filterProjectInfo(array $info, $additional_elements = [])

Filters the project .info.yml data to only save attributes we need.

Parameters

array $info

Array of .info.yml file data as returned by \Drupal\Core\Extension\InfoParser.

$additional_elements

(optional) Array of additional elements to be collected from the .info.yml file. Defaults to array().

Return Value

array

of .info.yml file data we need for the update manager.

See also

ProjectInfo::processInfoList