Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
automatic_updates-3233587
Manage
Activity
Members
Labels
Plan
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Issue forks
automatic_updates-3233587
Commits
a887695e
Commit
a887695e
authored
3 years ago
by
Ted Bowman
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3228115
by tedbow: remove unused automatic_updates.recommender service
parent
a09a91a6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
automatic_updates.services.yml
+0
-3
0 additions, 3 deletions
automatic_updates.services.yml
src/UpdateRecommender.php
+0
-65
0 additions, 65 deletions
src/UpdateRecommender.php
with
0 additions
and
68 deletions
automatic_updates.services.yml
+
0
−
3
View file @
a887695e
...
@@ -2,9 +2,6 @@ services:
...
@@ -2,9 +2,6 @@ services:
automatic_updates.readiness_validation_manager
:
automatic_updates.readiness_validation_manager
:
class
:
Drupal\automatic_updates\Validation\ReadinessValidationManager
class
:
Drupal\automatic_updates\Validation\ReadinessValidationManager
arguments
:
[
'
@keyvalue.expirable'
,
'
@datetime.time'
,
24
]
arguments
:
[
'
@keyvalue.expirable'
,
'
@datetime.time'
,
24
]
automatic_updates.recommender
:
class
:
Drupal\automatic_updates\UpdateRecommender
arguments
:
[
'
@update.manager'
,
'
@update.processor'
]
automatic_updates.updater
:
automatic_updates.updater
:
class
:
Drupal\automatic_updates\Updater
class
:
Drupal\automatic_updates\Updater
arguments
:
[
'
@state'
,
'
@string_translation'
,
'
@automatic_updates.beginner'
,
'
@automatic_updates.stager'
,
'
@automatic_updates.cleaner'
,
'
@automatic_updates.committer'
,
'
@file_system'
,
'
@event_dispatcher'
]
arguments
:
[
'
@state'
,
'
@string_translation'
,
'
@automatic_updates.beginner'
,
'
@automatic_updates.stager'
,
'
@automatic_updates.cleaner'
,
'
@automatic_updates.committer'
,
'
@file_system'
,
'
@event_dispatcher'
]
...
...
This diff is collapsed.
Click to expand it.
src/UpdateRecommender.php
deleted
100644 → 0
+
0
−
65
View file @
a09a91a6
<?php
namespace
Drupal\automatic_updates
;
use
Drupal\update\UpdateManagerInterface
;
use
Drupal\update\UpdateProcessorInterface
;
/**
* Determines the recommended version of a package.
*/
class
UpdateRecommender
{
/**
* The update manager service.
*
* @var \Drupal\update\UpdateManagerInterface
*/
protected
$updateManager
;
/**
* The update processor service.
*
* @var \Drupal\update\UpdateProcessorInterface
*/
protected
$updateProcessor
;
/**
* UpdateRecommender constructor.
*
* @param \Drupal\update\UpdateManagerInterface $update_manager
* The update manager service.
* @param \Drupal\update\UpdateProcessorInterface $update_processor
* The update processor service.
*/
public
function
__construct
(
UpdateManagerInterface
$update_manager
,
UpdateProcessorInterface
$update_processor
)
{
$this
->
updateManager
=
$update_manager
;
$this
->
updateProcessor
=
$update_processor
;
}
/**
* Returns the recommended update version of a project.
*
* @param string $project
* The name of the project.
*
* @return string
* The version that we recommend the site update to.
*/
public
function
getRecommendedUpdateVersion
(
string
$project
)
{
// Hard code for now
return
'9.2.0'
;
// From https://www.drupal.org/project/drupal/issues/3111767
$this
->
updateManager
->
refreshUpdateData
();
$this
->
updateProcessor
->
fetchData
();
$available
=
update_get_available
(
TRUE
);
$projects
=
update_calculate_project_data
(
$available
);
$not_recommended_version
=
$projects
[
$project
][
'status'
]
!==
UpdateManagerInterface
::
CURRENT
;
$security_update
=
in_array
(
$projects
[
'drupal'
][
'status'
],
[
UpdateManagerInterface
::
NOT_SECURE
,
UpdateManagerInterface
::
REVOKED
],
TRUE
);
$recommended_release
=
isset
(
$projects
[
'drupal'
][
'releases'
][
$projects
[
'drupal'
][
'recommended'
]])
?
$projects
[
'drupal'
][
'releases'
][
$projects
[
'drupal'
][
'recommended'
]]
:
NULL
;
$existing_minor_version
=
explode
(
'.'
,
\Drupal
::
VERSION
,
-
1
);
$recommended_minor_version
=
explode
(
'.'
,
$recommended_release
[
'version'
],
-
1
);
$major_upgrade
=
$existing_minor_version
!==
$recommended_minor_version
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment