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 958abce

Browse filesBrowse files
authored
Added expireat(key, timestamp)` method (#97)
1 parent 8884530 commit 958abce
Copy full SHA for 958abce

1 file changed

+6-1Lines changed: 6 additions & 1 deletion

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/M6Web/Component/RedisMock/RedisMock.php‎

Copy file name to clipboardExpand all lines: src/M6Web/Component/RedisMock/RedisMock.php
+6-1Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,17 @@ public function ttl($key)
164164
}
165165

166166
public function expire($key, $seconds)
167+
{
168+
return $this->expireat($key, time() + $seconds);
169+
}
170+
171+
public function expireat($key, $timestamp)
167172
{
168173
if (!array_key_exists($key, self::$dataValues[$this->storage]) || $this->deleteOnTtlExpired($key)) {
169174
return $this->returnPipedInfo(0);
170175
}
171176

172-
self::$dataTtl[$this->storage][$key] = time() + $seconds;
177+
self::$dataTtl[$this->storage][$key] = $timestamp;
173178

174179
return $this->returnPipedInfo(1);
175180
}

0 commit comments

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