public function ClassLoader::add

Registers a set of classes

Parameters

string $prefix The classes prefix:

array|string $paths The location(s) of the classes:

File

drupal/core/vendor/composer/ClassLoader.php, line 83

Class

ClassLoader
ClassLoader implements a PSR-0 class loader

Namespace

Composer\Autoload

Code

public function add($prefix, $paths) {
  if (!$prefix) {
    foreach ((array) $paths as $path) {
      $this->fallbackDirs[] = $path;
    }
    return;
  }
  if (isset($this->prefixes[$prefix])) {
    $this->prefixes[$prefix] = array_merge($this->prefixes[$prefix], (array) $paths);
  }
  else {
    $this->prefixes[$prefix] = (array) $paths;
  }
}