Skip to content

Commit

Permalink
Merge pull request #54 from creative-commoners/pulls/1.0/include-requ…
Browse files Browse the repository at this point in the history
…ire-dev

FIX Include require-dev in modules list when building models
  • Loading branch information
NightJar committed May 23, 2018
2 parents 6e1daec + 220e001 commit f941e38
Showing 1 changed file with 6 additions and 4 deletions.
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 @@ -82,15 +82,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

0 comments on commit f941e38

Please sign in to comment.