You are here

public static function Server::createServer in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-diactoros/src/Server.php \Zend\Diactoros\Server::createServer()

Create a Server instance

Creates a server instance from the callback and the following PHP environmental values:

  • server; typically this will be the $_SERVER superglobal
  • query; typically this will be the $_GET superglobal
  • body; typically this will be the $_POST superglobal
  • cookies; typically this will be the $_COOKIE superglobal
  • files; typically this will be the $_FILES superglobal

Parameters

callable $callback:

array $server:

array $query:

array $body:

array $cookies:

array $files:

Return value

static

File

vendor/zendframework/zend-diactoros/src/Server.php, line 110

Class

Server
"Serve" incoming HTTP requests

Namespace

Zend\Diactoros

Code

public static function createServer(callable $callback, array $server, array $query, array $body, array $cookies, array $files) {
  $request = ServerRequestFactory::fromGlobals($server, $query, $body, $cookies, $files);
  $response = new Response();
  return new static($callback, $request, $response);
}