Merge branch '4.4' into 5.2
* 4.4: [HttpKernel] Fixes tests for PHP7.4+ [Filesystem] fix readlink for Windows
This commit is contained in:
commit
4e3912e050
@ -399,14 +399,14 @@ class Filesystem
|
||||
return null;
|
||||
}
|
||||
|
||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
||||
if ('\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 70410) {
|
||||
$path = readlink($path);
|
||||
}
|
||||
|
||||
return realpath($path);
|
||||
}
|
||||
|
||||
if ('\\' === \DIRECTORY_SEPARATOR) {
|
||||
if ('\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 70400) {
|
||||
return realpath($path);
|
||||
}
|
||||
|
||||
|
@ -376,7 +376,7 @@ class FilesystemTest extends FilesystemTestCase
|
||||
|
||||
// create symlink to nonexistent dir
|
||||
rmdir($basePath.'dir');
|
||||
$this->assertFalse('\\' === \DIRECTORY_SEPARATOR ? @readlink($basePath.'dir-link') : is_dir($basePath.'dir-link'));
|
||||
$this->assertFalse('\\' === \DIRECTORY_SEPARATOR && \PHP_VERSION_ID < 70400 ? @readlink($basePath.'dir-link') : is_dir($basePath.'dir-link'));
|
||||
|
||||
$this->filesystem->remove($basePath);
|
||||
|
||||
@ -1076,7 +1076,12 @@ class FilesystemTest extends FilesystemTestCase
|
||||
$this->filesystem->symlink($link1, $link2);
|
||||
|
||||
$this->assertEquals($file, $this->filesystem->readlink($link1));
|
||||
|
||||
if (!('\\' == \DIRECTORY_SEPARATOR && \PHP_MAJOR_VERSION === 7 && \PHP_MINOR_VERSION === 3)) {
|
||||
// Skip for Windows with PHP 7.3.*
|
||||
$this->assertEquals($link1, $this->filesystem->readlink($link2));
|
||||
}
|
||||
|
||||
$this->assertEquals($file, $this->filesystem->readlink($link1, true));
|
||||
$this->assertEquals($file, $this->filesystem->readlink($link2, true));
|
||||
$this->assertEquals($file, $this->filesystem->readlink($file, true));
|
||||
|
@ -347,7 +347,7 @@ class Store implements StoreInterface
|
||||
{
|
||||
$path = $this->getPath($key);
|
||||
|
||||
return is_file($path) && false !== ($contents = file_get_contents($path)) ? $contents : null;
|
||||
return is_file($path) && false !== ($contents = @file_get_contents($path)) ? $contents : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user