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

Issue #3301844 by phenaproxima, tedbow, TravisCarden: DEVELOPING.md...

Issue #3301844 by phenaproxima, tedbow, TravisCarden: DEVELOPING.md instructions do not work for running build test
parent 1abfe54b
No related branches found
No related tags found
Loading
......@@ -11,7 +11,6 @@ For development and running the module's tests, Automatic Updates assumes you ar
```
git clone https://git.drupalcode.org/project/drupal.git --branch 9.5.x auto-updates-dev
cd auto-updates-dev
composer config platform.php 7.4.0
composer install
```
Replace `9.5.x` with the desired development branch of Drupal core. Be sure to point your web server to the `auto-updates-dev` directory, so you can access this code base in a browser.
......@@ -25,7 +24,7 @@ git clone --branch '8.x-2.x' https://git.drupalcode.org/project/automatic_update
### Step 3: Install dependencies
From the Drupal repository root:
```
composer require php-tuf/composer-stager "symfony/config:^4.4 || ^6.1"
composer require php-tuf/composer-stager "symfony/config:^4.4 || ^6.1" --ignore-platform-req php
git reset --hard
```
Note: If you switch to a different branch of Drupal core and delete the `vendor` directory, you will need to do this step again after running `composer install`.
......@@ -237,7 +237,7 @@ END;
$packages = [];
$drupal_root = $this->getDrupalRoot();
foreach ($this->getPackagesFromLockFile() as $package) {
foreach ($this->getInstalledPackages() as $package) {
$name = $package['name'];
$path = "$drupal_root/vendor/$name";
......@@ -273,23 +273,19 @@ END;
}
/**
* Returns all package information from the lock file.
* Returns all package information from the `installed.json` file.
*
* @return mixed[][]
* All package data from the lock file.
* All package data from the `installed.json` file.
*/
private function getPackagesFromLockFile(): array {
$lock = $this->getDrupalRoot() . '/composer.lock';
$this->assertFileExists($lock);
private function getInstalledPackages(): array {
$installed = $this->getDrupalRoot() . '/vendor/composer/installed.json';
$this->assertFileExists($installed);
$lock = file_get_contents($lock);
$lock = json_decode($lock, TRUE, JSON_THROW_ON_ERROR);
$installed = file_get_contents($installed);
$installed = json_decode($installed, TRUE, JSON_THROW_ON_ERROR);
$lock += [
'packages' => [],
'packages-dev' => [],
];
return array_merge($lock['packages'], $lock['packages-dev']);
return $installed['packages'];
}
/**
......
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