Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit37585eb

Browse files
committed
use copy() instead of rename() on Windows
On Windows depending on the PHP version rename() can fail if the targetfile is being executed. Since the source file is not used by anotherprocess using copy() instead should be safe to be used.
1 parente67bfc1 commit37585eb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

‎src/Symfony/Component/Cache/Traits/FilesystemCommonTrait.php‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,12 @@ private function write(string $file, string $data, ?int $expiresAt = null)
114114
touch($this->tmp,$expiresAt ?:time() +31556952);// 1 year in seconds
115115
}
116116

117-
$success =rename($this->tmp,$file);
117+
if ('\\' === \DIRECTORY_SEPARATOR) {
118+
$success =copy($this->tmp,$file);
119+
}else {
120+
$success =rename($this->tmp,$file);
121+
}
122+
118123
$unlink = !$success;
119124

120125
return$success;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp