Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Draft
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
2ab3d1e
use `Composer\Util\Platform::realpath()`
BrianHenryIE May 2, 2025
708c809
use `Composer\Util\Platform::realpath()`
BrianHenryIE May 2, 2025
e8a516f
Always treat stream wrappers as absolute paths
BrianHenryIE May 2, 2025
198a7ea
Remove `false` check which no longer can evaluate to false
BrianHenryIE May 2, 2025
9f03eba
Add `::testIsAbsolutePath()`
BrianHenryIE May 2, 2025
ed968c0
Do not treat `file://` paths as absolute path without check it un-pre…
BrianHenryIE May 13, 2025
27fac4b
Recursively call `::realpath()` until `$path` does not change
BrianHenryIE May 13, 2025
d1081a3
Replace `realpath()` with `Platform::realpath()`
BrianHenryIE May 13, 2025
4b5129b
Update src/Composer/Util/Filesystem.php
BrianHenryIE May 13, 2025
21b7a7e
Refactor `::isStreamWrapperPath()` to `public static` method
BrianHenryIE Jun 6, 2025
a23e7ce
Do not treat `file://` as a streamwrapper
BrianHenryIE Jun 6, 2025
40eb099
Return existing path for streamwrapper; throw exception for invalid path
BrianHenryIE Jun 6, 2025
0cd95aa
Move `stream_wrapper_register()` to `bootstrap.php`
BrianHenryIE Jun 6, 2025
598e88e
Replace `realpath()` with `Platform::realpath()`
BrianHenryIE Jun 12, 2025
413dd88
Add test `::realpath()` throws `RuntimeException`
BrianHenryIE Jul 3, 2025
d859488
Add `::testIsStreamWrapperPath()`
BrianHenryIE Jul 3, 2025
7542d71
Add `::testIsLocalPath()`
BrianHenryIE Jul 3, 2025
faeac42
Remove outdated redundant throw
BrianHenryIE Jul 4, 2025
aa70941
Return `false` on `::realpath()` `RuntimeException`
BrianHenryIE Jul 4, 2025
1430918
`continue` on failed `::realpath()`
BrianHenryIE Jul 4, 2025
1baf8bd
Strip `file://` before running system `realpath()`
BrianHenryIE Jul 4, 2025
2c9ed1f
Add `::testRealPathFileStreamStripsScheme()`
BrianHenryIE Jul 4, 2025
d32e015
Update `::isStreamWrapperPath()
BrianHenryIE Jul 4, 2025
463cebe
Don't `file://` prefix stream paths
BrianHenryIE Jul 4, 2025
32e6c08
No need to catch and throw `RuntimeException` here, the message was fine
BrianHenryIE Jul 4, 2025
d359604
Preserve `null` or `realpath()`
BrianHenryIE Jul 4, 2025
6592d1d
Update PhpDoc arguing we how we treat stream wrappers in `::isLocalPa…
BrianHenryIE Jul 4, 2025
95353bc
Preserver behaviour; redundant throw
BrianHenryIE Jul 4, 2025
ea4e18b
Update `::configFromString()` to return pretty `url` in `$repoConfig`
BrianHenryIE Jul 24, 2025
59bdaec
Use `::realpath()` early on `$targetDir` after `::ensureDirectoryExis…
BrianHenryIE Jul 24, 2025
dc204f7
Undo accidental double-prefix of `$targetDir`
BrianHenryIE Jul 24, 2025
6dd3cf8
Add `::testGetPackageTime()` for `realpath()` change
BrianHenryIE Jul 26, 2025
8184e1e
Add `::testCreatesComposerJsonIfNotExists()`
BrianHenryIE Jul 30, 2025
89d71b2
Add `::testClearCacheCommandDirectoryDoesNotExist()`
BrianHenryIE Jul 30, 2025
8bb5b15
Add `::isInstalled()` tests for symlinks
BrianHenryIE Jul 31, 2025
f3ae074
Improve comment explaining `stream_wrapper_register()`
BrianHenryIE Jul 31, 2025
79e9bc5
Check the full `.../composer.json` path
BrianHenryIE Jul 31, 2025
5adaa86
Use `Platform::getCwd()`
BrianHenryIE Aug 1, 2025
f2db2ca
Use `Platform::getCwd()`
BrianHenryIE Aug 1, 2025
9d8b179
Catch more specific `RuntimeException`
BrianHenryIE Aug 1, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use Platform::getCwd()
  • Loading branch information
BrianHenryIE committed Aug 1, 2025
commit 5adaa868c7eb5f696da6a301ff27a779197afddb
2 changes: 1 addition & 1 deletion src/Composer/Command/InitCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ protected function interact(InputInterface $input, OutputInterface $output)

$name = $input->getOption('name');
if (null === $name) {
$cwd = Platform::realpath(".");
$cwd = Platform::getCwd();
Copy link
Author

@BrianHenryIE BrianHenryIE Aug 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Covered by existing tests InitCommandTest::testRunGuessNameFromDirSanitizesDir() and ::testInteractiveRun()

simple-phpunit --filter="testRunGuessNameFromDirSanitizesDir|testInteractiveRun"

  • TODO: more thoroughly test here

$name = basename($cwd);
$name = $this->sanitizePackageNameComponent($name);

Expand Down