Files
iblogs/src/Frontend/Cookie/TokenCookie.php
indifferentketchup 4aeebf3732 refactor: rename Aternos\Mclogs to IndifferentKetchup\Iblogs
Bulk substitution across all PHP files in src/, build.php, worker.php,
and web/frontend/. Updates composer.json's package name and PSR-4
autoload root accordingly. Casing matches the existing
IndifferentKetchup\Codex package's namespace convention (capital K).

Strictly a namespace rename. Aternos\Codex\* imports remain in place;
those get re-pointed in a follow-up commit when the codex Composer
dependency itself is swapped. Filename renames (docker/mclogs.ini,
web/public/css/mclogs.css), README walk-through, env-var prefix changes,
and visible-text branding land in subsequent commits.
2026-05-01 22:11:13 +00:00

52 lines
986 B
PHP

<?php
namespace IndifferentKetchup\Iblogs\Frontend\Cookie;
use IndifferentKetchup\Iblogs\Config\Config;
use IndifferentKetchup\Iblogs\Config\ConfigKey;
use IndifferentKetchup\Iblogs\Log;
class TokenCookie extends Cookie
{
/**
* @param Log $log
* @return $this
*/
public function setLog(Log $log): static
{
$this->log = $log;
return $this;
}
/**
* @inheritDoc
*/
protected function getKey(): string
{
return "IBLOGS_LOG_TOKEN";
}
/**
* @param Log|null $log
*/
public function __construct(protected ?Log $log = null)
{
parent::__construct();
}
/**
* @return string
*/
protected function getPath(): string
{
if (!$this->log) {
return "/";
}
return "/" . $this->log->getId()->get();
}
protected function getMaxAge(): ?int
{
return Config::getInstance()->get(ConfigKey::STORAGE_TTL);
}
}