Fixed creating shortest paths in AutoloadGenerator
parent
fde38dacec
commit
afc04c9e53
|
@ -58,7 +58,7 @@ EOF;
|
|||
|
||||
$filesystem = new Filesystem();
|
||||
$vendorPath = strtr(realpath($installationManager->getVendorPath()), '\\', '/');
|
||||
$relVendorPath = $filesystem->findShortestPath(getcwd(), $vendorPath);
|
||||
$relVendorPath = $filesystem->findShortestPath(getcwd().'/inDir', $vendorPath);
|
||||
$vendorDirCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true);
|
||||
|
||||
$appBaseDir = $filesystem->findShortestPathCode($vendorPath, getcwd(), true);
|
||||
|
@ -85,11 +85,7 @@ EOF;
|
|||
$path = strtr($path, '\\', '/');
|
||||
$baseDir = '';
|
||||
if (!$filesystem->isAbsolutePath($path)) {
|
||||
// vendor dir == working dir
|
||||
if (preg_match('{^(\./?)?$}', $relVendorPath)) {
|
||||
$path = '/'.$path;
|
||||
$baseDir = '$vendorDir . ';
|
||||
} elseif (strpos($path, $relVendorPath) === 0) {
|
||||
if (strpos($path, $relVendorPath) === 0) {
|
||||
// path starts with vendor dir
|
||||
$path = substr($path, strlen($relVendorPath));
|
||||
$baseDir = '$vendorDir . ';
|
||||
|
@ -129,7 +125,7 @@ EOF;
|
|||
$autoloads['classmap'] = new \RecursiveIteratorIterator(new \RecursiveArrayIterator($autoloads['classmap']));
|
||||
foreach ($autoloads['classmap'] as $dir) {
|
||||
foreach (ClassMapGenerator::createMap($dir) as $class => $path) {
|
||||
$path = '/'.$filesystem->findShortestPath(getcwd(), $path);
|
||||
$path = '/'.$filesystem->findShortestPath(getcwd().'/inDir', $path);
|
||||
$classmapFile .= ' '.var_export($class, true).' => $baseDir . '.var_export($path, true).",\n";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue