You are here

function ProjectInfo::filterProjectInfo in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Utility/ProjectInfo.php \Drupal\Core\Utility\ProjectInfo::filterProjectInfo()

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_whitelist: (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

\Drupal\Core\Utility\ProjectInfo->processInfoList()

1 call to ProjectInfo::filterProjectInfo()
ProjectInfo::processInfoList in core/lib/Drupal/Core/Utility/ProjectInfo.php
Populates an array of project data.

File

core/lib/Drupal/Core/Utility/ProjectInfo.php, line 184
Contains \Drupal\Core\Utility\ProjectInfo.

Class

ProjectInfo
Performs operations on drupal.org project data.

Namespace

Drupal\Core\Utility

Code

function filterProjectInfo($info, $additional_whitelist = array()) {
  $whitelist = array(
    '_info_file_ctime',
    'datestamp',
    'major',
    'name',
    'package',
    'project',
    'project status url',
    'version',
  );
  $whitelist = array_merge($whitelist, $additional_whitelist);
  return array_intersect_key($info, array_combine($whitelist, $whitelist));
}