D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
dateitor
/
public_html
/
vendor
/
opcodesio
/
log-viewer
/
src
/
Filename :
Host.php
back
Copy
<?php namespace Opcodes\LogViewer; use Opcodes\LogViewer\Utils\Utils; class Host { public bool $is_remote; public function __construct( public ?string $identifier, public string $name, public ?string $host = null, public ?array $headers = null, public ?array $auth = null, ) { $this->is_remote = $this->isRemote(); } public static function fromConfig(string|int $identifier, array $config = []): self { return new static( is_string($identifier) ? $identifier : Utils::shortMd5($config['host']), $config['name'] ?? (is_string($identifier) ? $identifier : $config['host']), $config['host'] ?? null, $config['headers'] ?? [], $config['auth'] ?? [], ); } public function isRemote(): bool { return ! is_null($this->host); } }