You are here

function drush_composer_manager_update_psr0 in Composer Manager 7

Same name and namespace in other branches
  1. 7.2 composer_manager.drush.inc \drush_composer_manager_update_psr0()

Add new PSR-0 namespaces to the class loader.

Parameters

\Composer\Autoload\ClassLoader $loader: The autoloader to add the new namespaces to.

string $composer: Path to the Composer library.

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

File

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

Code

function drush_composer_manager_update_psr0($loader, $composer) {
  $autoload_psr0 = $composer . '/autoload_namespaces.php';
  if (file_exists($autoload_psr0)) {
    $updated_psr0 = (require $autoload_psr0);
    foreach ($updated_psr0 as $prefix => $paths) {
      $loader
        ->add($prefix, $paths);
    }
  }
}