Skip to content

Commit 228cfa0

Browse files
committed
feat(phar): rename real_path to normalize_path
1 parent d96b9d5 commit 228cfa0

File tree

10 files changed

+12
-12
lines changed

10 files changed

+12
-12
lines changed

packages/console/src/Highlight/TempestConsoleLanguage/Injections/FileInjection.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ public function parse(string $content, Highlighter $highlighter): ParsedInjectio
2222
pattern: '/(?<match>\<file=(?<quote>[\"\'])(?<file>.+)\k<quote>\s*\/?>)/',
2323
callback: function (array $matches) {
2424
$href = $matches['file'];
25-
$exists = Filesystem\real_path($href) !== null;
25+
$exists = Filesystem\normalize_path($href) !== null;
2626
$file = $exists
27-
? str(Filesystem\real_path($href))->replace('\\', '/')->stripStart(root_path())->stripStart('/')
27+
? str(Filesystem\normalize_path($href))->replace('\\', '/')->stripStart(root_path())->stripStart('/')
2828
: $href;
2929

3030
return TerminalStyle::UNDERLINE((string) $file);

packages/core/src/Commands/DiscoveryStatusCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function __invoke(
6363
$this->console->writeln();
6464

6565
foreach ($this->kernel->discoveryLocations as $discoveryLocation) {
66-
$path = str(Filesystem\real_path($discoveryLocation->path))
66+
$path = str(Filesystem\normalize_path($discoveryLocation->path))
6767
->replaceStart(root_path(), '.')
6868
->toString();
6969

packages/core/src/DiscoveryConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public function skipPaths(string ...$paths): self
2727
foreach ($paths as $path) {
2828
$path = str_replace(['\\', '/'], DIRECTORY_SEPARATOR, $path);
2929

30-
$realpath = Filesystem\real_path($path);
30+
$realpath = Filesystem\normalize_path($path);
3131

3232
if ($realpath === null) {
3333
continue;

packages/core/src/FrameworkKernel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public static function boot(
7676

7777
public function validateRoot(): self
7878
{
79-
$root = Filesystem\real_path($this->root);
79+
$root = Filesystem\normalize_path($this->root);
8080

8181
if (! is_dir($root)) {
8282
throw new RuntimeException('The specified root directory is not valid.');
@@ -197,7 +197,7 @@ public function registerInternalStorage(): self
197197
throw CouldNotRegisterInternalStorage::noPermission($path);
198198
}
199199

200-
$this->internalStorage = Filesystem\real_path($path);
200+
$this->internalStorage = Filesystem\normalize_path($path);
201201

202202
return $this;
203203
}

packages/core/src/Kernel/LoadConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ public function find(): array
8686
*/
8787
private function scan(string $path, MutableArray $configPaths): void
8888
{
89-
$input = Filesystem\real_path($path);
89+
$input = Filesystem\normalize_path($path);
9090

9191
// Make sure the path is valid
9292
if ($input === null) {

packages/core/src/Kernel/LoadDiscoveryClasses.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ private function discover(array $discoveries): void
106106
*/
107107
private function scan(DiscoveryLocation $location, array $discoveries, string $path): void
108108
{
109-
$input = Filesystem\real_path($path);
109+
$input = Filesystem\normalize_path($path);
110110

111111
// Make sure the path is valid
112112
if ($input === null) {

packages/discovery/src/DiscoveryLocation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(
2020
string $path,
2121
) {
2222
$this->namespace = $namespace;
23-
$this->path = Filesystem\real_path(rtrim($path, '\\/'));
23+
$this->path = Filesystem\normalize_path(rtrim($path, '\\/'));
2424
}
2525

2626
public function isVendor(): bool

packages/support/src/Filesystem/functions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ function read_symbolic_link(string $path): string
507507
/**
508508
* Returns the real path for the specified $path or null if it doesn't exist.
509509
*/
510-
function real_path(string $path): ?string
510+
function normalize_path(string $path): ?string
511511
{
512512
if (class_exists(\Phar::class) && \Phar::running(false) !== '' && str_starts_with($path, 'phar:')) {
513513
return $path;

packages/vite/src/TagsResolver/DevelopmentTagsResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private function fileToAssetPath(string $file): string
6060
return str($file)
6161
->when(
6262
condition: fn ($file) => $file->startsWith('./'),
63-
callback: fn ($file) => str(Filesystem\real_path(root_path($file->toString()))),
63+
callback: fn ($file) => str(Filesystem\normalize_path(root_path($file->toString()))),
6464
)
6565
->replace('\\', '/') // `realpath` makes slashes backwards, so replacements below wouldn't work
6666
->replaceStart(root_path('public'), '')

packages/vite/src/TagsResolver/ManifestTagsResolver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ private function fileToAssetPath(string $file): string
254254
return str($file)
255255
->when(
256256
condition: fn ($file) => $file->startsWith('./'),
257-
callback: fn ($file) => str(Filesystem\real_path(root_path($file->toString()))),
257+
callback: fn ($file) => str(Filesystem\normalize_path(root_path($file->toString()))),
258258
)
259259
->replaceStart(root_path('public'), '')
260260
->replaceStart(root_path(), '')

0 commit comments

Comments
 (0)