diff --git a/core/includes/install.inc b/core/includes/install.inc index e6db8eb8f0..60e665516d 100644 --- a/core/includes/install.inc +++ b/core/includes/install.inc @@ -1129,25 +1129,15 @@ function install_profile_info($profile, $langcode = 'en') { 'config_install_path' => NULL, ]; $profile_path = drupal_get_path('profile', $profile); - $info_path = "$profile_path/$profile.info.yml"; - $info_parser = \Drupal::service('info_parser'); - if (file_exists($info_path)) { - // Favour the legacy .info.yml file. - $info = $info_parser->parse($info_path); - } - else { - $info = $info_parser->parse("$profile_path/composer.json"); - } + $info = \Drupal::service('info_parser')->parse("$profile_path/$profile.info.yml"); + $info += $defaults; - // Modern composer.json file. $dependency_name_function = function ($dependency) { return Dependency::createFromString($dependency)->getName(); }; - if (!empty($info['require'])) { - // Remove the entry for core, it is not a module. - unset($info['require']['core']); - $info['dependencies'] = array_keys($info['require']); + if (!empty($info['composer_dependencies'])) { + $info['dependencies'] = array_keys($info['composer_dependencies']); } else { // Convert dependencies in [project:module] format. diff --git a/core/lib/Drupal/Core/Extension/Dependency.php b/core/lib/Drupal/Core/Extension/Dependency.php index c68b9e938c..54dab149aa 100644 --- a/core/lib/Drupal/Core/Extension/Dependency.php +++ b/core/lib/Drupal/Core/Extension/Dependency.php @@ -97,8 +97,8 @@ protected function getConstraint() { /** * {@inheritdoc} */ - public function isCompatible($version) { - return $this->getConstraint()->isCompatible($version); + public function isCompatible($dependee_version) { + return $this->getConstraint()->isCompatible($dependee_version); } /** diff --git a/core/lib/Drupal/Core/Extension/Dependency/Composer.php b/core/lib/Drupal/Core/Extension/Dependency/Composer.php index 054d2f3bfc..ff542d542f 100644 --- a/core/lib/Drupal/Core/Extension/Dependency/Composer.php +++ b/core/lib/Drupal/Core/Extension/Dependency/Composer.php @@ -45,8 +45,8 @@ public function getName() { /** * {@inheritdoc} */ - public function isCompatible($version) { - return Semver::satisfies($version, $this->constraint); + public function isCompatible($dependee_version) { + return Semver::satisfies($dependee_version, $this->constraint); } /** diff --git a/core/lib/Drupal/Core/Extension/Dependency/DependencyInterface.php b/core/lib/Drupal/Core/Extension/Dependency/DependencyInterface.php index 0686906c96..e9142e3694 100644 --- a/core/lib/Drupal/Core/Extension/Dependency/DependencyInterface.php +++ b/core/lib/Drupal/Core/Extension/Dependency/DependencyInterface.php @@ -10,13 +10,13 @@ interface DependencyInterface { /** * Determines if the provided version is compatible with this dependency. * - * @param string $version - * The version to check, for example '4.2'. + * @param string $dependee_version + * The dependee version to check, for example '4.2'. * * @return bool * TRUE if compatible with the provided version, FALSE if not. */ - public function isCompatible($version); + public function isCompatible($dependee_version); /** * Gets dependency name. diff --git a/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php b/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php index 6d95d6378b..deba59bf11 100644 --- a/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php +++ b/core/lib/Drupal/Core/Extension/Discovery/RecursiveExtensionFilterIterator.php @@ -158,8 +158,8 @@ public function accept() { return !in_array($name, $this->blacklist, TRUE); } else { - // Only accept extension info or composer.json files. - return $name === 'composer.json'|| substr($name, -9) == '.info.yml'; + // Only accept extension info files. + return substr($name, -9) == '.info.yml'; } }