You are here

private function SocketHandler::createSocketResource in Lagoon Logs 8

1 call to SocketHandler::createSocketResource()
SocketHandler::connect in src/Logger/SocketHandler.php

File

src/Logger/SocketHandler.php, line 306

Class

SocketHandler
Stores to any socket - uses fsockopen() or pfsockopen().

Namespace

Drupal\lagoon_logs\Logger

Code

private function createSocketResource() {
  if ($this
    ->isPersistent()) {
    $resource = $this
      ->pfsockopen();
  }
  else {
    $resource = $this
      ->fsockopen();
  }
  if (!$resource) {
    throw new \UnexpectedValueException("Failed connecting to {$this->connectionString} ({$this->errno}: {$this->errstr})");
  }
  $this->resource = $resource;
}