cryptal  latest
Cryptography Abstraction Layer
ComposerPlugin.php
1 <?php
2 
3 namespace fpoirotte\Cryptal;
4 
9 
10 class ComposerPlugin implements PluginInterface
11 {
12  public function activate(Composer $composer, IOInterface $io)
13  {
14  $installer = new ComposerInstaller($io, $composer);
15  $composer->getInstallationManager()->addInstaller($installer);
16 
17  // Try to register the root package if it is a Cryptal plugin.
18  $rootPkg = $composer->getPackage();
19  if ($installer->supports($rootPkg->getType())) {
20  $installer->registerRootPackage($rootPkg);
21  }
22  }
23 }