function ComposerJsonTargetDir::writeToAdapter in X Autoload 7.4
Same name and namespace in other branches
- 7.5 src/Discovery/ComposerJsonTargetDir.php \Drupal\xautoload\Discovery\ComposerJsonTargetDir::writeToAdapter()
Parameters
ClassFinderAdapter $adapter:
Throws
\Exception
Overrides ComposerJson::writeToAdapter
File
- lib/
Discovery/ ComposerJsonTargetDir.php, line 31
Class
Namespace
Drupal\xautoload\DiscoveryCode
function writeToAdapter($adapter) {
if (!empty($data['include-path'])) {
$paths = $this
->pathsResolveTargetDir((array) $data['include-path']);
$this
->addIncludePaths($paths, $this->pathPrefix);
}
if (!empty($data['autoload']['psr-0'])) {
$this
->addMultipleWithTargetDir($adapter, $data['autoload']['psr-0']);
}
if (!empty($data['autoload']['psr-4'])) {
throw new \Exception("PSR-4 is incompatible with target-dir.");
}
if (!empty($data['autoload']['classmap'])) {
$paths = $this
->pathsResolveTargetDir($data['autoload']['classmap']);
$this
->addClassmapSources($adapter, $paths);
}
if (!empty($data['autoload']['files'])) {
$paths = $this
->pathsResolveTargetDir($data['autoload']['files']);
foreach ($paths as $file) {
require $this->pathPrefix . $file;
}
}
}