Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
f9f8b0d5
Commit
f9f8b0d5
authored
May 04, 2015
by
catch
Browse files
Issue
#2449809
by JeroenT, tadityar: Remove usage of update_get_projects()
parent
ac4e35ce
Changes
10
Hide whitespace changes
Inline
Side-by-side
core/modules/locale/locale.api.php
View file @
f9f8b0d5
...
...
@@ -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
_p
rojects().
* Project data as returned by
\Drupal\Update\UpdateManager::
get
P
rojects().
*
* @see locale_translation_project_list()
* @ingroup interface_translation_properties
...
...
core/modules/update/src/Tests/UpdateContribTest.php
View file @
f9f8b0d5
...
...
@@ -292,7 +292,7 @@ function testUpdateHiddenBaseTheme() {
),
);
$this
->
config
(
'update_test.settings'
)
->
set
(
'system_info'
,
$system_info
)
->
save
();
$projects
=
update_
get
_p
rojects
();
$projects
=
\
Drupal
::
service
(
'update.manager'
)
->
get
P
rojects
();
$theme_data
=
\
Drupal
::
service
(
'theme_handler'
)
->
rebuildThemeData
();
$project_info
=
new
ProjectInfo
();
$project_info
->
processInfoList
(
$projects
,
$theme_data
,
'theme'
,
TRUE
);
...
...
core/modules/update/src/UpdateFetcherInterface.php
View file @
f9f8b0d5
...
...
@@ -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.
*
...
...
core/modules/update/src/UpdateManager.php
View file @
f9f8b0d5
...
...
@@ -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
_p
rojects(); for example, to modules
that implement
// hook_system_info_alter() such as cvs_deploy.
//
\Drupal\Update\UpdateManager::
get
P
rojects(); 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'
);
...
...
core/modules/update/src/UpdateManagerInterface.php
View file @
f9f8b0d5
...
...
@@ -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
);
...
...
core/modules/update/src/UpdateProcessorInterface.php
View file @
f9f8b0d5
...
...
@@ -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()
...
...
core/modules/update/tests/src/Unit/UpdateFetcherTest.php
View file @
f9f8b0d5
...
...
@@ -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
...
...
core/modules/update/update.api.php
View file @
f9f8b0d5
...
...
@@ -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
_p
rojects() with the help
of
* \Drupal\Core\Utility\ProjectInfo->processInfoList(), so look there for
* populated inside
\Drupal\Update\UpdateManager::
get
P
rojects() 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
_p
rojects()
* @see
\Drupal\Update\UpdateManager::
get
P
rojects()
* @see \Drupal\Core\Utility\ProjectInfo->processInfoList()
*/
function
hook_update_projects_alter
(
&
$projects
)
{
...
...
core/modules/update/update.compare.inc
View file @
f9f8b0d5
...
...
@@ -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
_p
rojects()
* @see
\Drupal\Update\UpdateManager::
get
P
rojects()
* @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
_p
rojects
();
$projects
=
\
Drupal
::
service
(
'update.manager'
)
->
get
P
rojects
();
update_process_project_info
(
$projects
);
foreach
(
$projects
as
$project
=>
$project_info
)
{
if
(
isset
(
$available
[
$project
]))
{
...
...
core/modules/update/update.module
View file @
f9f8b0d5
...
...
@@ -300,7 +300,7 @@ function _update_no_data() {
* Array of data about available releases, keyed by project shortname.
*
* @see update_refresh()
* @see
update_
get
_p
rojects()
* @see
\Drupal\Update\UpdateManager::
get
P
rojects()
*/
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()
*
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment