mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-10 05:58:42 +00:00
update stats
This commit is contained in:
parent
2f0e9d1c8c
commit
61eb86ae6f
|
|
@ -12,7 +12,7 @@
|
||||||
*/
|
*/
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace phpOMS\Message\Statistic;
|
namespace phpOMS\Message\Http;
|
||||||
|
|
||||||
use phpOMS\Localization\ISO3166TwoEnum;
|
use phpOMS\Localization\ISO3166TwoEnum;
|
||||||
use phpOMS\Localization\ISO639x1Enum;
|
use phpOMS\Localization\ISO639x1Enum;
|
||||||
|
|
@ -34,9 +34,7 @@ class ImpressionStat
|
||||||
|
|
||||||
public string $country = ISO3166TwoEnum::_XXX;
|
public string $country = ISO3166TwoEnum::_XXX;
|
||||||
|
|
||||||
public int $datetime = 0;
|
public \DateTime $datetime;
|
||||||
|
|
||||||
public string $browser = '';
|
|
||||||
|
|
||||||
public string $host = '';
|
public string $host = '';
|
||||||
|
|
||||||
|
|
@ -56,7 +54,7 @@ class ImpressionStat
|
||||||
$this->host = $request->uri->host;
|
$this->host = $request->uri->host;
|
||||||
$this->path = \substr($request->uri->path, 0, 255);
|
$this->path = \substr($request->uri->path, 0, 255);
|
||||||
$this->address = $request->header->getRequestIp();
|
$this->address = $request->header->getRequestIp();
|
||||||
$this->datetime = $request->header->getRequestTime();
|
$this->datetime = new \DateTime('@' . $request->header->getRequestTime());
|
||||||
$this->referer = \substr($request->header->getReferer(), 0, 255);
|
$this->referer = \substr($request->header->getReferer(), 0, 255);
|
||||||
$this->userAgent = $request->header->getBrowserName();
|
$this->userAgent = $request->header->getBrowserName();
|
||||||
}
|
}
|
||||||
|
|
@ -65,8 +63,8 @@ class ImpressionStat
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'address' => $this->address,
|
'address' => $this->address,
|
||||||
'date' => \date('d-m-y', $this->datetime),
|
'date' => $this->datetime->format('Y-m-d'),
|
||||||
'hour' => \date('H', $this->datetime),
|
'hour' => $this->datetime->format('H'),
|
||||||
'host' => $this->host,
|
'host' => $this->host,
|
||||||
'path' => $this->path,
|
'path' => $this->path,
|
||||||
'uri' => $this->uri,
|
'uri' => $this->uri,
|
||||||
|
|
@ -74,7 +72,7 @@ class ImpressionStat
|
||||||
'language' => $this->language,
|
'language' => $this->language,
|
||||||
'country' => $this->country,
|
'country' => $this->country,
|
||||||
'referer' => $this->referer,
|
'referer' => $this->referer,
|
||||||
'datetime' => $this->datetime,
|
'datetime' => $this->datetime->getTimestamp(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,7 +60,7 @@ final class HttpUri implements UriInterface
|
||||||
* @var string
|
* @var string
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private string $uri;
|
public string $uri;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Uri scheme.
|
* Uri scheme.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user