function AutoloadGenerator::getPathCode
Return value
string
3 calls to AutoloadGenerator::getPathCode()
- AutoloadGenerator::dump in vendor/
composer/ composer/ src/ Composer/ Autoload/ AutoloadGenerator.php - AutoloadGenerator::getIncludeFilesFile in vendor/
composer/ composer/ src/ Composer/ Autoload/ AutoloadGenerator.php - AutoloadGenerator::getIncludePathsFile in vendor/
composer/ composer/ src/ Composer/ Autoload/ AutoloadGenerator.php
File
-
vendor/
composer/ composer/ src/ Composer/ Autoload/ AutoloadGenerator.php, line 744
Class
- AutoloadGenerator
- @author Igor Wiedler <igor@wiedler.ch> @author Jordi Boggiano <j.boggiano@seld.be>
Namespace
Composer\AutoloadCode
protected function getPathCode(Filesystem $filesystem, string $basePath, string $vendorPath, string $path) {
if (!$filesystem->isAbsolutePath($path)) {
$path = $basePath . '/' . $path;
}
$path = $filesystem->normalizePath($path);
$baseDir = '';
if (strpos($path . '/', $vendorPath . '/') === 0) {
$path = (string) substr($path, strlen($vendorPath));
$baseDir = '$vendorDir . ';
}
else {
$path = $filesystem->normalizePath($filesystem->findShortestPath($basePath, $path, true));
if (!$filesystem->isAbsolutePath($path)) {
$baseDir = '$baseDir . ';
$path = '/' . $path;
}
}
if (strpos($path, '.phar') !== false) {
$baseDir = "'phar://' . " . $baseDir;
}
return $baseDir . var_export($path, true);
}