Last 5.3 release ever available: PHP 5.3.29 - 5.3 now EOL


(PECL event >= 1.4.0-beta)

EventHttp::addServerAliasAdds a server alias to the HTTP server object


public bool EventHttp::addServerAlias ( string $alias )

Adds a server alias to the HTTP server object.

Elenco dei parametri


The alias to add.

Valori restituiti

Returns TRUE on success. Otherwise FALSE.


Example #1 EventHttp::addServerAlias() example

= new EventBase();
$http = new EventHttp($base);

$socket socket_create(AF_INETSOCK_STREAMSOL_TCP);

if (!
$http->bind(""8088)) {
"bind(1) failed\n");

if (!
$http->addServerAlias("")) {
"Failed to add server alias\n");

$http->setCallback("/about", function($req) {
"URI: "$req->getUri(), PHP_EOL;

Vedere anche:

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top