- класс
HttpServer(php\http\HttpServer) - пакет
http - исходники
php/http/HttpServer.php
Описание
Class HttpServer
->__construct()- Server constructor.->stopAtShutdown()- If true, this server instance will be explicitly stopped when the->minThreads()->maxThreads()->threadIdleTimeout()->listen()- Add connector to server:->unlisten()->connectors()- All connectors (host+port)->run()- Run server in current thread.->runInBackground()- Run server in background thread.->shutdown()- Stop server.->handlers()->filters()->addWebSocket()->addFilter()->addHandler()->clearHandlers()- Remove all handlers.->setRequestLogHandler()->setErrorHandler()->isRunning()->isFailed()->isStopped()->isStopping()->isStarting()->filtrate()->route()- Route a handler by method and path.->any()- Route any methods.->get()- Route a handler by GET method + path.->post()- Route a handler by POST method + path.->put()- Route a handler by PUT method + path.->delete()- Route a handler by DELETE method + path.->options()- Route a handler by OPTIONS method + path.->patch()- Route a handler by PATCH method + path.->head()- Route a handler by HEAD method + path.
__construct(int $port, string $host): voidServer constructor.
stopAtShutdown(bool $value): boolIf true, this server instance will be explicitly stopped when the JVM is shutdown. Otherwise the JVM is stopped with the server running.
minThreads(int $min): intmaxThreads(int $max): intthreadIdleTimeout(int $timeout): intlisten(string $portOrHostPort): voidAdd connector to server: 127.0.0.1:8080 8080, 127.0.0.1
unlisten(string $portOrHostPort): voidconnectors(): string[]All connectors (host+port)
run(): voidRun server in current thread.
runInBackground(): voidRun server in background thread.
shutdown(): voidStop server.
handlers(): callable[]filters(): callable[]addWebSocket(string $path, array $handlers): voidaddFilter(callable $callback): voidaddHandler(callable $callback): voidclearHandlers(): voidRemove all handlers.
setRequestLogHandler([ callable|null $handler): voidsetErrorHandler([ callable|null $handler): voidisRunning(): boolisFailed(): boolisStopped(): boolisStopping(): boolisStarting(): boolfiltrate(string|array $methods, string $path, callable $filter): php\http\HttpRouteFilterroute(string|array $methods, string $path, callable $handler): php\http\HttpRouteHandlerRoute a handler by method and path.
any(string $path, callable $handler): php\http\HttpRouteHandlerRoute any methods.
get(string $path, callable $handler): php\http\HttpRouteHandlerRoute a handler by GET method + path.
post(string $path, callable $handler): php\http\HttpRouteHandlerRoute a handler by POST method + path.
put(string $path, callable $handler): php\http\HttpRouteHandlerRoute a handler by PUT method + path.
delete(string $path, callable $handler): php\http\HttpRouteHandlerRoute a handler by DELETE method + path.
options(string $path, callable $handler): php\http\HttpRouteHandlerRoute a handler by OPTIONS method + path.
patch(string $path, callable $handler): php\http\HttpRouteHandlerRoute a handler by PATCH method + path.
head(string $path, callable $handler): php\http\HttpRouteHandlerRoute a handler by HEAD method + path.