Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX Include require-dev in modules list when building models #54

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/Tasks/UpdatePackageInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace BringYourOwnIdeas\Maintenance\Tasks;

use BuildTask;
use BringYourOwnIdeas\Maintenance\Util\ComposerLoader;
use Injector;
use BuildTask;
use Package;
use SQLDelete;
use SS_HTTPRequest;

/**
* Parses a composer lock file in order to cache information about the installation.
Expand Down Expand Up @@ -71,15 +71,17 @@ public function getDescription()
*/
public function run($request)
{
$packages = $this->getPackageInfo($this->getComposerLoader()->getLock()->packages);
$composerLock = $this->getComposerLoader()->getLock();
$rawPackages = array_merge($composerLock->packages, $composerLock->{'packages-dev'});
$packages = $this->getPackageInfo($rawPackages);

// Extensions to the process that add data may rely on external services.
// There may be a communication issue between the site and the external service,
// so if there are 'none' we should assume this is untrue and _not_ proceed
// to remove everything. Stale information is better than no information.
if ($packages) {
// There is no onBeforeDelete for Package
SQLDelete::create(Package::class)->execute();
SQLDelete::create('Package')->execute();
foreach ($packages as $package) {
Package::create()->update($package)->write();
}
Expand Down