Skip to content

Commit 64a0e19

Browse files
committed
wip
1 parent 1dee08e commit 64a0e19

4 files changed

Lines changed: 5 additions & 8 deletions

File tree

src/Http/Response.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ public function setExpiration(?string $expire): static
176176
}
177177

178178
$expire = DateTime::from($expire);
179-
$this->setHeader('Cache-Control', 'max-age=' . ($expire->format('U') - time()));
179+
$this->setHeader('Cache-Control', 'max-age=' . ($expire->getTimestamp() - time())); // TODO: tady opravdu jen přepočítám slovní interval na sekundy
180180
$this->setHeader('Expires', Helpers::formatDate($expire));
181181
return $this;
182182
}
@@ -231,7 +231,7 @@ public function getHeaders(): array
231231
public function setCookie(
232232
string $name,
233233
string $value,
234-
string|int|\DateTimeInterface|null $expire,
234+
string|int|\DateTimeInterface|null $expire, // TODO: misto DateTimeInterface by se měl používat interval, i když nevím
235235
?string $path = null,
236236
?string $domain = null,
237237
?bool $secure = null,
@@ -241,7 +241,7 @@ public function setCookie(
241241
{
242242
self::checkHeaders();
243243
setcookie($name, $value, [
244-
'expires' => $expire ? (int) DateTime::from($expire)->format('U') : 0,
244+
'expires' => $expire ? (int) DateTime::from($expire)->getTimestamp() : 0, // TODO: změnit na max-age!!! od 8.2 jako GMT
245245
'path' => $path ?? ($domain ? '/' : $this->cookiePath),
246246
'domain' => $domain ?? ($path ? '' : $this->cookieDomain),
247247
'secure' => $secure ?? $this->cookieSecure,

src/Http/Session.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ public function setExpiration(?string $expire): static
486486
]);
487487

488488
} else {
489-
$expire = Nette\Utils\DateTime::from($expire)->format('U') - time();
489+
$expire = Nette\Utils\DateTime::from($expire)->getTimestamp() - time(); // TODO: tady opravdu jen přepočítám slovní interval na sekundy
490490
return $this->setOptions([
491491
'gc_maxlifetime' => $expire,
492492
'cookie_lifetime' => $expire,

src/Http/SessionSection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ public function setExpiration(?string $expire, string|array|null $variables = nu
166166
$this->session->autoStart((bool) $expire);
167167
$meta = &$this->getMeta();
168168
if ($expire) {
169-
$expire = Nette\Utils\DateTime::from($expire)->format('U');
169+
$expire = Nette\Utils\DateTime::from($expire)->getTimestamp(); // TODO: tady opravdu jen přepočítám slovní interval na sekundy
170170
$max = (int) ini_get('session.gc_maxlifetime');
171171
if (
172172
$max !== 0 // 0 - unlimited in memcache handler

src/Http/Url.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
* @property-read string $absoluteUrl
3939
* @property-read string $authority
4040
* @property-read string $hostUrl
41-
* @property-read string $basePath
42-
* @property-read string $baseUrl
43-
* @property-read string $relativeUrl
4441
* @property-read array $queryParameters
4542
*/
4643
class Url implements \JsonSerializable

0 commit comments

Comments
 (0)