Skip to content

Commit

Permalink
[BUGFIX] Avoid error on uninstall last package
Browse files Browse the repository at this point in the history
  • Loading branch information
benjaminkott committed Jul 30, 2020
1 parent b6ae9d5 commit 8b1d260
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Installer/ConfigurationInstaller.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,12 @@

namespace BK2K\ConfigurationInstaller\Installer;

use BK2K\ConfigurationInstaller\Configuration\File;
use BK2K\ConfigurationInstaller\Configuration\GitignoreEntry;
use BK2K\ConfigurationInstaller\Configuration\InstallerConfiguration;
use BK2K\ConfigurationInstaller\Factory\ConfigurationFactory;
use BK2K\ConfigurationInstaller\Handler;
use BK2K\ConfigurationInstaller\Service\GitignoreService;
use Composer\Composer;
use Composer\Installer\BinaryInstaller;
use Composer\Installer\LibraryInstaller;
Expand All @@ -31,6 +34,17 @@ public function __construct(IOInterface $io, Composer $composer, $type = 'projec
'files' => Handler\FileHandler::class,
'gitignore' => Handler\GitignoreHandler::class
];

// Force early autoloading of needed classes to
// keep them in memory during uninstallation of
// the last configuration package.
class_exists(File::class, true);
class_exists(GitignoreEntry::class, true);
class_exists(InstallerConfiguration::class, true);
class_exists(ConfigurationFactory::class, true);
class_exists(Handler\FileHandler::class, true);
class_exists(Handler\GitignoreHandler::class, true);
class_exists(GitignoreService::class, true);
}

public function getHandler($key)
Expand Down

0 comments on commit 8b1d260

Please sign in to comment.