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

Appearance settings

Commit d5746ec

Browse filesBrowse files
committed
fix directory resource considers same timestamp not fresh
1 parent 96107e2 commit d5746ec
Copy full SHA for d5746ec

File tree

2 files changed

+5
-3
lines changed
Filter options

2 files changed

+5
-3
lines changed

‎src/Symfony/Component/Config/Resource/DirectoryResource.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Resource/DirectoryResource.php
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ public function isFresh($timestamp)
6868
return false;
6969
}
7070

71-
if ($timestamp <= filemtime($this->resource)) {
71+
if ($timestamp < filemtime($this->resource)) {
7272
return false;
7373
}
7474

@@ -85,7 +85,7 @@ public function isFresh($timestamp)
8585
}
8686

8787
// early return if a file's mtime exceeds the passed timestamp
88-
if ($timestamp <= $file->getMTime()) {
88+
if ($timestamp < $file->getMTime()) {
8989
return false;
9090
}
9191
}

‎src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Config/Tests/Resource/DirectoryResourceTest.php
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,10 @@ public function testIsFreshNewFileWithDifferentPattern()
9696
public function testIsFreshDeleteFile()
9797
{
9898
$resource = new DirectoryResource($this->directory);
99+
$time = time();
100+
sleep(1);
99101
unlink($this->directory.'/tmp.xml');
100-
$this->assertFalse($resource->isFresh(time()), '->isFresh() returns false if an existing file is removed');
102+
$this->assertFalse($resource->isFresh($time), '->isFresh() returns false if an existing file is removed');
101103
}
102104

103105
public function testIsFreshDeleteDirectory()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.