You are here

function drush_composer_manager_update_classmap in Composer Manager 7.2

Same name and namespace in other branches
  1. 7 composer_manager.drush.inc \drush_composer_manager_update_classmap()

Add new class maps to the class loader.

Parameters

\Composer\Autoload\ClassLoader $loader: The autoloader to attach the updated class map to.

string $composer: Path to the Composer library.

1 call to drush_composer_manager_update_classmap()
drush_composer_manager_update_autoloader in ./composer_manager.drush.inc
Add new autoloader paths to the Class Loader.

File

./composer_manager.drush.inc, line 179
Drush hook implementations for the Composer Manager module.

Code

function drush_composer_manager_update_classmap(\Composer\Autoload\ClassLoader $loader, $composer) {
  $autoload_classmap = $composer . '/autoload_classmap.php';
  if (file_exists($autoload_classmap)) {
    $class_map = $loader
      ->getClassMap();
    $updated_class_map = (require $autoload_classmap);
    $loader
      ->addClassMap(array_diff($updated_class_map, $class_map));
  }
}