-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Improve stream wrapper support #12396
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
2ab3d1e
708c809
e8a516f
198a7ea
9f03eba
ed968c0
27fac4b
d1081a3
4b5129b
21b7a7e
a23e7ce
40eb099
0cd95aa
598e88e
413dd88
d859488
7542d71
faeac42
aa70941
1430918
1baf8bd
2c9ed1f
d32e015
463cebe
32e6c08
d359604
6592d1d
95353bc
ea4e18b
59bdaec
dc204f7
6dd3cf8
8184e1e
89d71b2
8bb5b15
f3ae074
79e9bc5
5adaa86
f2db2ca
9d8b179
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
Composer\Util\Platform::realpath()
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -214,15 +214,15 @@ public function dump(Config $config, InstalledRepositoryInterface $localRepo, Ro | |
| // Do not remove double realpath() calls. | ||
| // Fixes failing Windows realpath() implementation. | ||
| // See https://bugs.php.net/bug.php?id=72738 | ||
| $basePath = $filesystem->normalizePath(realpath(realpath(Platform::getCwd()))); | ||
| $vendorPath = $filesystem->normalizePath(realpath(realpath($config->get('vendor-dir')))); | ||
| $basePath = $filesystem->normalizePath(Platform::realpath(Platform::realpath(Platform::getCwd()))); | ||
| $vendorPath = $filesystem->normalizePath(Platform::realpath(Platform::realpath($config->get('vendor-dir')))); | ||
| $useGlobalIncludePath = $config->get('use-include-path'); | ||
| $prependAutoloader = $config->get('prepend-autoloader') === false ? 'false' : 'true'; | ||
| $targetDir = $vendorPath.'/'.$targetDir; | ||
| $filesystem->ensureDirectoryExists($targetDir); | ||
|
|
||
| $vendorPathCode = $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true); | ||
| $vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, realpath($targetDir), true); | ||
| $vendorPathCode = $filesystem->findShortestPathCode(Platform::realpath($targetDir), $vendorPath, true); | ||
| $vendorPathToTargetDirCode = $filesystem->findShortestPathCode($vendorPath, Platform::realpath($targetDir), true); | ||
|
|
||
| $appBaseDirCode = $filesystem->findShortestPathCode($vendorPath, $basePath, true); | ||
| $appBaseDirCode = str_replace('__DIR__', '$vendorDir', $appBaseDirCode); | ||
|
|
@@ -493,7 +493,7 @@ private function buildExclusionRegex(string $dir, array $excluded): ?string | |
| // if $dir does not exist, it should anyway not find anything there so no trouble | ||
| if (file_exists($dir)) { | ||
| // transform $dir in the same way that exclude-from-classmap patterns are transformed so we can match them against each other | ||
| $dirMatch = preg_quote(strtr(realpath($dir), '\\', '/')); | ||
| $dirMatch = preg_quote(strtr(Platform::realpath($dir), '\\', '/')); | ||
| foreach ($excluded as $index => $pattern) { | ||
| // extract the constant string prefix of the pattern here, until we reach a non-escaped regex special character | ||
| $pattern = Preg::replace('{^(([^.+*?\[^\]$(){}=!<>|:\\\\#-]+|\\\\[.+*?\[^\]$(){}=!<>|:#-])*).*}', '$1', $pattern); | ||
|
|
@@ -1165,10 +1165,10 @@ class ComposerStaticInit$suffix | |
|
|
||
| $filesystem = new Filesystem(); | ||
|
|
||
| $vendorPathCode = ' => ' . $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true, true) . " . '/"; | ||
| $vendorPharPathCode = ' => \'phar://\' . ' . $filesystem->findShortestPathCode(realpath($targetDir), $vendorPath, true, true) . " . '/"; | ||
| $appBaseDirCode = ' => ' . $filesystem->findShortestPathCode(realpath($targetDir), $basePath, true, true) . " . '/"; | ||
| $appBaseDirPharCode = ' => \'phar://\' . ' . $filesystem->findShortestPathCode(realpath($targetDir), $basePath, true, true) . " . '/"; | ||
| $vendorPathCode = ' => ' . $filesystem->findShortestPathCode(Platform::realpath($targetDir), $vendorPath, true, true) . " . '/"; | ||
| $vendorPharPathCode = ' => \'phar://\' . ' . $filesystem->findShortestPathCode(Platform::realpath($targetDir), $vendorPath, true, true) . " . '/"; | ||
| $appBaseDirCode = ' => ' . $filesystem->findShortestPathCode(Platform::realpath($targetDir), $basePath, true, true) . " . '/"; | ||
| $appBaseDirPharCode = ' => \'phar://\' . ' . $filesystem->findShortestPathCode(Platform::realpath($targetDir), $basePath, true, true) . " . '/"; | ||
|
|
||
| $absoluteVendorPathCode = ' => ' . substr(var_export(rtrim($vendorDir, '\\/') . '/', true), 0, -1); | ||
| $absoluteVendorPharPathCode = ' => ' . substr(var_export(rtrim('phar://' . $vendorDir, '\\/') . '/', true), 0, -1); | ||
|
|
@@ -1291,7 +1291,7 @@ static function ($matches) use (&$updir): string { | |
| $installPath = strtr(Platform::getCwd(), '\\', '/'); | ||
| } | ||
|
|
||
| $resolvedPath = realpath($installPath . '/' . $updir); | ||
| $resolvedPath = Platform::realpath($installPath . '/' . $updir); | ||
|
||
| if (false === $resolvedPath) { | ||
| continue; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file_exists()was just called (previous line) so we can assume that$diris a valid path, and omit the try/catch