*/ private $actors = []; /** @var array<\ActivityPhp\Server\Actor\Inbox> */ private $inboxes = []; /** @var array<\ActivityPhp\Server\Actor\Outbox> */ private $outboxes = []; /** @var \Psr\Log\LoggerInterface|null */ private $logger; /** @var \ActivityPhp\Server\Configuration|null */ private $configuration; /** * Server constructor * * @param array $config Server configuration */ public function __construct(array $config = []) { self::$singleton = $this; $this->configuration = new Configuration(); $this->configuration->dispatchParameters($config); $this->logger = $this->config('logger')->createLogger(); CacheHelper::setPool( $this->config('cache') ); } /** * Get logger instance */ public function logger(): ?LoggerInterface { return $this->logger; } /** * Get cache instance */ public function cache(): ?CacheItemPoolInterface { return $this->cache; } /** * Get a configuration handler * * @return \ActivityPhp\Server\Configuration\LoggerConfiguration * | \ActivityPhp\Server\Configuration\InstanceConfiguration * | \ActivityPhp\Server\Configuration\HttpConfiguration * | string */ public function config(string $parameter) { return $this->configuration->getConfig($parameter); } /** * Get an inbox instance * It's a local instance * * @param string $handle An actor name */ public function inbox(string $handle): Inbox { $this->logger()->info($handle . ':' . __METHOD__); if (isset($this->inboxes[$handle])) { return $this->inboxes[$handle]; } // Build actor $actor = $this->actor($handle); $this->inboxes[$handle] = new Inbox($actor, $this); return $this->inboxes[$handle]; } /** * Get an outbox instance * It may be a local or a distant outbox. */ public function outbox(string $handle): Outbox { $this->logger()->info($handle . ':' . __METHOD__); if (isset($this->outboxes[$handle])) { return $this->outboxes[$handle]; } // Build actor $actor = $this->actor($handle); $this->outboxes[$handle] = new Outbox($actor, $this); return $this->outboxes[$handle]; } /** * Build an server-oriented actor object */ public function actor(string $handle): Actor { $this->logger()->info($handle . ':' . __METHOD__); if (isset($this->actors[$handle])) { return $this->actors[$handle]; } $this->actors[$handle] = new Actor($handle, $this); return $this->actors[$handle]; } /** * Get server instance with a static call * * @param array> $settings */ public static function server(array $settings = []): self { if (is_null(self::$singleton)) { self::$singleton = new self($settings); } return self::$singleton; } } __halt_compiler();----SIGNATURE:----ovoT94eSKxMBKKoo6XC/t/aXLZGFzVNfM6G4fJ4+lOOlBdhaGdPzAixVBqpJgWheQRuoktmmDoWPPU0BXmUzuqy/w/Hi/y5g4dmXk/z6Mu6nKejUhYjOrzxru/VN4AfGrTyFQ6toJx0rwA5jS8ryMncfW9SLrrM0yDWDKlVk/pidfUJ1krlL9FN5ZbuFSsxf/wRjS/n1t3JTB8l3ZimT8kkiy5jThl8mpTm1TLFFxCn2O2Olir3wVczCVwKzay+8DDDRi3CPpdunDKMr3z7lr26cOkggD8TIwaTcrq5kI79BiHbfKJuyBQz7loUKPoxmtloje+UOkri6DiB3miSQvpnzN2M/roDeikBou8wwEn6DTXYvHFicUHvaZAq1m9anpJInv7iSuGSK1Thp0mA7qznRADgdhyefWjVBAbIei0xOZ2244xcmzxu+dqIudBpxpR4fjW50Xu2WpOBipN/s3aB/twVH9+TaTTHhfommdfbO16x7oJCcW07L+B9etBRs/OPpkQUh6klWDgMsKDP3LOln8jsDPjnEoV7GBbRr3H6uDN53gYWo/xuZpifNXV+GPhSi5rZRspnVG7sDIyoytJyeV7xL/Pr9qmVUjjrUkQMb1O8cdV6WeR4E0mFIl76jIfJ2GO80ly4b9IFaXWM4KUtsZaTYe07l9S7IznftxVs=----ATTACHMENT:----NjI5NDk5MDc0NTU0Njk3MCA0MTk0MDI1NDM2MTA1MzAxIDk3MjgxNjE0NDU0NDYxODY=