Skip to content
Snippets Groups Projects
Commit 5673d3bf authored by Adam G-H's avatar Adam G-H
Browse files

Issue #3304036 by phenaproxima: Convert core_packages.json to YAML

parent 10950a57
No related branches found
No related tags found
No related merge requests found
[
"drupal/core",
"drupal/core-composer-scaffold",
"drupal/core-dev",
"drupal/core-dev-pinned",
"drupal/core-project-message",
"drupal/core-recommended",
"drupal/core-vendor-hardening"
]
# This file exists so that \Drupal\package_manager\ComposerUtility can discern
# which installed packages are considered part of Drupal core. There's no way
# to tell by package type alone, since these packages have varying types, but
# are all part of Drupal core's repository. This file is for internal use and
# may be changed or removed at any time. Code external to Package Manager
# should not use it in any way.
[
drupal/core,
drupal/core-composer-scaffold,
drupal/core-dev,
drupal/core-dev-pinned,
drupal/core-project-message,
drupal/core-recommended,
drupal/core-vendor-hardening
]
...@@ -7,7 +7,6 @@ use Composer\Factory; ...@@ -7,7 +7,6 @@ use Composer\Factory;
use Composer\IO\NullIO; use Composer\IO\NullIO;
use Composer\Package\PackageInterface; use Composer\Package\PackageInterface;
use Composer\Semver\Comparator; use Composer\Semver\Comparator;
use Drupal\Component\Serialization\Json;
use Drupal\Component\Serialization\Yaml; use Drupal\Component\Serialization\Yaml;
/** /**
...@@ -98,11 +97,11 @@ class ComposerUtility { ...@@ -98,11 +97,11 @@ class ComposerUtility {
*/ */
protected static function getCorePackageList(): array { protected static function getCorePackageList(): array {
if (self::$corePackages === NULL) { if (self::$corePackages === NULL) {
$file = __DIR__ . '/../core_packages.json'; $file = __DIR__ . '/../core_packages.yml';
assert(file_exists($file), "$file does not exist."); assert(file_exists($file), "$file does not exist.");
$core_packages = file_get_contents($file); $core_packages = file_get_contents($file);
$core_packages = Json::decode($core_packages); $core_packages = Yaml::decode($core_packages);
assert(is_array($core_packages), "$file did not contain a list of core packages."); assert(is_array($core_packages), "$file did not contain a list of core packages.");
self::$corePackages = $core_packages; self::$corePackages = $core_packages;
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
namespace Drupal\Tests\package_manager\Kernel; namespace Drupal\Tests\package_manager\Kernel;
use Drupal\Component\Serialization\Json; use Drupal\Component\Serialization\Json;
use Drupal\Component\Serialization\Yaml;
use Drupal\KernelTests\KernelTestBase; use Drupal\KernelTests\KernelTestBase;
use Symfony\Component\Finder\Finder; use Symfony\Component\Finder\Finder;
...@@ -44,8 +45,8 @@ class CorePackageManifestTest extends KernelTestBase { ...@@ -44,8 +45,8 @@ class CorePackageManifestTest extends KernelTestBase {
sort($packages); sort($packages);
// Ensure that the packages we detected matches the hard-coded list we ship. // Ensure that the packages we detected matches the hard-coded list we ship.
$manifest = file_get_contents(__DIR__ . '/../../../core_packages.json'); $manifest = file_get_contents(__DIR__ . '/../../../core_packages.yml');
$manifest = Json::decode($manifest); $manifest = Yaml::decode($manifest);
$this->assertSame($packages, $manifest); $this->assertSame($packages, $manifest);
} }
......
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