Commit f9f8b0d5 authored by catch's avatar catch

Issue #2449809 by JeroenT, tadityar: Remove usage of update_get_projects()

parent ac4e35ce
......@@ -91,8 +91,9 @@
* Alter the list of projects to be updated by locale's interface translation.
*
* Locale module attempts to update the translation of those modules returned
* by update_get_projects(). Using this hook, the data returned by
* update_get_projects() can be altered or extended.
* by \Drupal\Update\UpdateManager::getProjects(). Using this hook, the data
* returned by \Drupal\Update\UpdateManager::getProjects() can be altered or
* extended.
*
* Modules or distributions that use a dedicated translation server should use
* this hook to specify the interface translation server pattern, or to add
......@@ -108,7 +109,7 @@
* - "%language": Language code. Value examples: "fr", "pt-pt".
*
* @param array $projects
* Project data as returned by update_get_projects().
* Project data as returned by \Drupal\Update\UpdateManager::getProjects().
*
* @see locale_translation_project_list()
* @ingroup interface_translation_properties
......
......@@ -292,7 +292,7 @@ function testUpdateHiddenBaseTheme() {
),
);
$this->config('update_test.settings')->set('system_info', $system_info)->save();
$projects = update_get_projects();
$projects = \Drupal::service('update.manager')->getProjects();
$theme_data = \Drupal::service('theme_handler')->rebuildThemeData();
$project_info = new ProjectInfo();
$project_info->processInfoList($projects, $theme_data, 'theme', TRUE);
......
......@@ -15,7 +15,8 @@ interface UpdateFetcherInterface {
* Returns the base of the URL to fetch available update data for a project.
*
* @param array $project
* The array of project information from update_get_projects().
* The array of project information from
* \Drupal\Update\UpdateManager::getProjects().
*
* @return string
* The base of the URL used for fetching available update data. This does
......@@ -28,7 +29,8 @@ public function getFetchBaseUrl($project);
* Retrieves the project information.
*
* @param array $project
* The array of project information from update_get_projects().
* The array of project information from
* \Drupal\Update\UpdateManager::getProjects().
* @param string $site_key
* (optional) The anonymous site key hash. Defaults to an empty string.
*
......@@ -45,7 +47,8 @@ public function fetchProjectData(array $project, $site_key = '');
* site is configured to report usage stats.
*
* @param array $project
* The array of project information from update_get_projects().
* The array of project information from
* \Drupal\Update\UpdateManager::getProjects().
* @param string $site_key
* (optional) The anonymous site key hash. Defaults to an empty string.
*
......
......@@ -107,8 +107,8 @@ public function refreshUpdateData() {
// of both the projects we care about, and the current update status of the
// site. We do *not* want to clear the cache of available releases just yet,
// since that data (even if it's stale) can be useful during
// update_get_projects(); for example, to modules that implement
// hook_system_info_alter() such as cvs_deploy.
// \Drupal\Update\UpdateManager::getProjects(); for example, to modules
// that implement hook_system_info_alter() such as cvs_deploy.
$this->keyValueStore->delete('update_project_projects');
$this->keyValueStore->delete('update_project_data');
......
......@@ -100,7 +100,9 @@ public function refreshUpdateData();
*
* @return array
* The stored value of the $projects array generated by
* update_calculate_project_data() or update_get_projects(), or an empty
* update_calculate_project_data() or
* \Drupal\Update\UpdateManager::getProjects(), or an empty array when the
* storage is cleared.
* array when the storage is cleared.
*/
public function projectStorage($key);
......
......@@ -37,8 +37,9 @@ public function fetchData();
*
* @param array $project
* Associative array of information about a project as created by
* update_get_projects(), including keys such as 'name' (short name), and
* the 'info' array with data from a .info.yml file for the project.
* \Drupal\Update\UpdateManager::getProjects(), including keys such as
* 'name' (short name), and the 'info' array with data from a .info.yml
* file for the project.
*
* @see \Drupal\update\UpdateManager::getProjects()
* @see update_get_available()
......
......@@ -43,7 +43,8 @@ protected function setUp() {
* Tests that buildFetchUrl() builds the URL correctly.
*
* @param array $project
* A keyed array of project information matching results from update_get_projects().
* A keyed array of project information matching results from
* \Drupal\Update\UpdateManager::getProjects().
* @param string $site_key
* A string to mimic an anonymous site key hash.
* @param string $expected
......
......@@ -27,11 +27,11 @@
* Reference to an array of the projects installed on the system. This
* includes all the metadata documented in the comments below for each project
* (either module or theme) that is currently enabled. The array is initially
* populated inside update_get_projects() with the help of
* \Drupal\Core\Utility\ProjectInfo->processInfoList(), so look there for
* populated inside \Drupal\Update\UpdateManager::getProjects() with the help
* of \Drupal\Core\Utility\ProjectInfo->processInfoList(), so look there for
* examples of how to populate the array with real values.
*
* @see update_get_projects()
* @see \Drupal\Update\UpdateManager::getProjects()
* @see \Drupal\Core\Utility\ProjectInfo->processInfoList()
*/
function hook_update_projects_alter(&$projects) {
......
......@@ -65,7 +65,8 @@ function update_get_projects() {
* compare against the available releases to produce the status report.
*
* @param $projects
* Array of project information from update_get_projects().
* Array of project information from
* \Drupal\Update\UpdateManager::getProjects().
*/
function update_process_project_info(&$projects) {
foreach ($projects as $key => $project) {
......@@ -127,7 +128,7 @@ function update_process_project_info(&$projects) {
* An array of installed projects with current update status information.
*
* @see update_get_available()
* @see update_get_projects()
* @see \Drupal\Update\UpdateManager::getProjects()
* @see update_process_project_info()
* @see \Drupal\update\UpdateManagerInterface::projectStorage()
*/
......@@ -139,7 +140,7 @@ function update_calculate_project_data($available) {
if (!empty($projects)) {
return $projects;
}
$projects = update_get_projects();
$projects = \Drupal::service('update.manager')->getProjects();
update_process_project_info($projects);
foreach ($projects as $project => $project_info) {
if (isset($available[$project])) {
......
......@@ -300,7 +300,7 @@ function _update_no_data() {
* Array of data about available releases, keyed by project shortname.
*
* @see update_refresh()
* @see update_get_projects()
* @see \Drupal\Update\UpdateManager::getProjects()
*/
function update_get_available($refresh = FALSE) {
module_load_include('inc', 'update', 'update.compare');
......@@ -360,8 +360,9 @@ function update_get_available($refresh = FALSE) {
*
* @param $project
* Associative array of information about a project as created by
* update_get_projects(), including keys such as 'name' (short name), and the
* 'info' array with data from a .info.yml file for the project.
* \Drupal\Update\UpdateManager::getProjects(), including keys such as 'name'
* (short name), and the 'info' array with data from a .info.yml file for the
* project.
*
* @see \Drupal\update\UpdateFetcher::createFetchTask()
*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment