Skip to content
Snippets Groups Projects
Commit 26efea98 authored by Ted Bowman's avatar Ted Bowman Committed by Adam G-H
Browse files

Issue #3240753 by tedbow, phenaproxima: Prevent install if Composer dependencies are not present

parent c2a35f7b
No related branches found
No related tags found
1 merge request!64Issue #3240753: Prevent install if composer dependencies are not present.
...@@ -11,11 +11,17 @@ use Drupal\automatic_updates\Validation\ReadinessRequirements; ...@@ -11,11 +11,17 @@ use Drupal\automatic_updates\Validation\ReadinessRequirements;
* Implements hook_requirements(). * Implements hook_requirements().
*/ */
function automatic_updates_requirements($phase) { function automatic_updates_requirements($phase) {
if ($phase !== 'runtime') { if ($phase === 'runtime') {
return []; /** @var \Drupal\automatic_updates\Validation\ReadinessRequirements $readiness_requirement */
$readiness_requirement = \Drupal::classResolver(ReadinessRequirements::class);
return $readiness_requirement->getRequirements();
}
if ($phase === 'install' && !class_exists('PhpTuf\ComposerStager\Domain\Beginner')) {
return [
'automatic_updates' => [
'description' => t('External dependencies for Automatic Updates are not available. Composer must be used to download the module with dependencies.'),
'severity' => REQUIREMENT_ERROR,
],
];
} }
/** @var \Drupal\automatic_updates\Validation\ReadinessRequirements $readiness_requirement */
$readiness_requirement = \Drupal::classResolver(ReadinessRequirements::class);
return $readiness_requirement->getRequirements();
} }
<?php
/**
* @file
* Contains install and update functions for Package Manager.
*/
/**
* Implements hook_requirements().
*/
function package_manager_requirements($phase) {
if ($phase === 'install' && !class_exists('PhpTuf\ComposerStager\Domain\Beginner')) {
return [
'package_manager' => [
'description' => t('External dependencies for Package Manager are not available. Composer must be used to download the module with dependencies.'),
'severity' => REQUIREMENT_ERROR,
],
];
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment