function Compiler::getRelativeFilePath
1 call to Compiler::getRelativeFilePath()
- Compiler::addFile in vendor/
composer/ composer/ src/ Composer/ Compiler.php
File
-
vendor/
composer/ composer/ src/ Composer/ Compiler.php, line 203
Class
- Compiler
- The Compiler class compiles composer into a phar
Namespace
ComposerCode
private function getRelativeFilePath(\SplFileInfo $file) : string {
$realPath = $file->getRealPath();
$pathPrefix = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR;
$pos = strpos($realPath, $pathPrefix);
$relativePath = $pos !== false ? substr_replace($realPath, '', $pos, strlen($pathPrefix)) : $realPath;
return strtr($relativePath, '\\', '/');
}