PHP Класс SimpleSAML\Test\BuiltInServer

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$address string The address (host:port) where the server is listening for connections after being started.
$docroot string The document root of the server.
$pid integer The PID of the running server.
$router string The name of a "router" file to run for every request performed to this server.

Открытые методы

Метод Описание
__construct ( string | null $router = null, string | null $docroot = null ) BuiltInServer constructor.
get ( string $query, array $parameters, array $curlopts = [] ) : array | string This function performs an HTTP GET request to the built-in server.
getPid ( ) : integer Get the PID of the running server.
getRouter ( ) : string Get the name of the "router" file.
setRouter ( string $router ) Set the "router" file.
start ( ) : string Start the built-in server in a random port.
stop ( ) Stop the built-in server.

Описание методов

__construct() публичный Метод

BuiltInServer constructor.
См. также: http://php.net/manual/en/features.commandline.webserver.php
public __construct ( string | null $router = null, string | null $docroot = null )
$router string | null The name of a "router" file to run first for every request performed to this server.
$docroot string | null The document root to use when starting the server.

get() публичный Метод

This function performs an HTTP GET request to the built-in server.
public get ( string $query, array $parameters, array $curlopts = [] ) : array | string
$query string The query to perform.
$parameters array An array (can be empty) with parameters for the requested URI.
$curlopts array An array (can be empty) with options for cURL.
Результат array | string The response obtained from the built-in server.

getPid() публичный Метод

Get the PID of the running server.
public getPid ( ) : integer
Результат integer The PID of the server, or 0 if the server was not started.

getRouter() публичный Метод

Get the name of the "router" file.
public getRouter ( ) : string
Результат string The name of the "router" file.

setRouter() публичный Метод

Set the "router" file.
public setRouter ( string $router )
$router string The name of a "router" file to use when starting the server.

start() публичный Метод

This method will wait up to 5 seconds for the server to start. When it returns an address, it is guaranteed that the server has started and is listening for connections. If it returns false on the other hand, there will be no guarantee that the server started properly.
public start ( ) : string
Результат string The address where the server is listening for connections, or false if the server failed to start for some reason.

stop() публичный Метод

Stop the built-in server.
public stop ( )

Описание свойств

$address защищенное свойство

The address (host:port) where the server is listening for connections after being started.
protected string $address
Результат string

$docroot защищенное свойство

The document root of the server.
protected string $docroot
Результат string

$pid защищенное свойство

The PID of the running server.
protected int $pid
Результат integer

$router защищенное свойство

The name of a "router" file to run for every request performed to this server.
protected string $router
Результат string