Skip to content

Commit

Permalink
Pre-load all of our sources on initial load so that we will not get a…
Browse files Browse the repository at this point in the history
… more recent version of one of our classes e.g. after a 'composer update' operation. (#82)
  • Loading branch information
greg-1-anderson authored and webflo committed Jun 14, 2018
1 parent f94a689 commit 80c7d27
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,27 @@ public function __construct(Composer $composer, IOInterface $io) {
$this->composer = $composer;
$this->io = $io;
$this->progress = TRUE;

// Pre-load all of our sources so that we do not run up
// against problems in `composer update` operations.
$this->manualLoad();
}

protected function manualLoad() {
$src_dir = __DIR__;

$classes = [
'CommandProvider',
'DrupalScaffoldCommand',
'FileFetcher',
'PrestissimoFileFetcher',
];

foreach ($classes as $src) {
if (!class_exists('\\DrupalComposer\\DrupalScaffold\\' . $src)) {
include "{$src_dir}/{$src}.php";
}
}
}

/**
Expand Down

0 comments on commit 80c7d27

Please # to comment.