Skip to content

[7.x] Restore app()->getCached*Path() absolute '/' behavior in Windows - #32969

Merged
taylorotwell merged 1 commit into
laravel:7.xfrom
derekmd:fix-app-cache-config-windows-forward-slash
May 26, 2020
Merged

[7.x] Restore app()->getCached*Path() absolute '/' behavior in Windows#32969
taylorotwell merged 1 commit into
laravel:7.xfrom
derekmd:fix-app-cache-config-windows-forward-slash

Conversation

@derekmd

@derekmd derekmd commented May 26, 2020

Copy link
Copy Markdown
Contributor

Fixes: #32960

testEnvPathsAreUsedForCachePathsWhenSpecified is currently failing when run in Windows environments.

7.2.1 started enforcing DIRECTORY_SEPARATOR (#31985) as the path prefix to be treated as absolute. For a point release, this breaks Windows environments in existing apps that use environment variables to set absolute '/'-prefixed paths.

$_SERVER['APP_CONFIG_CACHE'] = '/ext/cache/config.php';
echo app()->getCachedConfigPath();
// C:\Users\Foo\projects\blog\/ext/cache/config.php

This should still be '/ext/cache/config.php' which PHP will likely resolve to 'C:\ext\cache\config.php'.

7.2.1 started enforcing DIRECTORY_SEPARATOR
as the path prefix to be treated as absolute.
For a point release, this breaks Windows
environments in existing apps that use
environment variables to set absolute
'/'-prefixed paths.

$_SERVER['APP_CONFIG_CACHE'] = '/ext/cache/config.php';
echo app()->getCachedConfigPath();
// C:\Users\Foo\projects\blog\/ext/cache/config.php

This should still be '/ext/cache/config.php'.
@taylorotwell
taylorotwell merged commit 29d714d into laravel:7.x May 26, 2020
@derekmd
derekmd deleted the fix-app-cache-config-windows-forward-slash branch May 26, 2020 15:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[7.2.1 to 7.12.0] Config cache path breaking change in Windows environments

2 participants