Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit b9e6cb6

Browse files
committed
fix : fixed class loading for active check
1 parent 17f471b commit b9e6cb6

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

Plugin.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -75,18 +75,6 @@ class Plugin implements EventSubscriberInterface, PluginInterface
7575
*/
7676
public function activate(Composer $composer, IOInterface $io): void
7777
{
78-
if (($errorMessage = $this->getErrorMessage()) !== null) {
79-
self::$activated = false;
80-
81-
$io->writeError('<warning>Narrowspark Automatic Prefetcher has been disabled. ' . $errorMessage . '</warning>');
82-
83-
return;
84-
}
85-
86-
if (! \class_exists(AbstractContainer::class)) {
87-
require __DIR__ . \DIRECTORY_SEPARATOR . 'alias.php';
88-
}
89-
9078
// to avoid issues when Automatic Prefetcher is upgraded, we load all PHP classes now
9179
// that way, we are sure to use all classes from the same version.
9280
foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator(\dirname(__DIR__, 1), FilesystemIterator::SKIP_DOTS)) as $file) {
@@ -96,6 +84,18 @@ public function activate(Composer $composer, IOInterface $io): void
9684
}
9785
}
9886

87+
if (! \class_exists(AbstractContainer::class)) {
88+
require __DIR__ . \DIRECTORY_SEPARATOR . 'alias.php';
89+
}
90+
91+
if (($errorMessage = $this->getErrorMessage()) !== null) {
92+
self::$activated = false;
93+
94+
$io->writeError('<warning>Narrowspark Automatic Prefetcher has been disabled. ' . $errorMessage . '</warning>');
95+
96+
return;
97+
}
98+
9999
$this->container = new Container($composer, $io);
100100

101101
if ($this->container->get(InputInterface::class) === null) {

0 commit comments

Comments
 (0)