mirror of
https://github.com/php/doc-en.git
synced 2026-03-24 07:42:10 +01:00
104 lines
2.3 KiB
XML
104 lines
2.3 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<refentry xml:id="eventhttp.addserveralias" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>EventHttp::addServerAlias</refname>
|
|
<refpurpose>Adds a server alias to the HTTP server object</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier>
|
|
<type>bool</type>
|
|
<methodname>EventHttp::addServerAlias</methodname>
|
|
<methodparam>
|
|
<type>string</type>
|
|
<parameter>alias</parameter>
|
|
</methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Adds a server alias to the HTTP server object.
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term>
|
|
<parameter>alias</parameter>
|
|
</term>
|
|
<listitem>
|
|
<para>
|
|
The alias to add.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</refsect1>
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<example>
|
|
<title>
|
|
<function>EventHttp::addServerAlias</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$base = new EventBase();
|
|
$http = new EventHttp($base);
|
|
|
|
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
|
|
|
if (!$http->bind("127.0.0.1", 8088)) {
|
|
exit("bind(1) failed\n");
|
|
};
|
|
|
|
if (!$http->addServerAlias("local.net")) {
|
|
exit("Failed to add server alias\n");
|
|
}
|
|
|
|
$http->setCallback("/about", function($req) {
|
|
echo "URI: ", $req->getUri(), PHP_EOL;
|
|
$req->sendReply(200, "OK");
|
|
});
|
|
$base->dispatch();
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</refsect1>
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<simplelist>
|
|
<member>
|
|
<methodname>EventHttp::removeServerAlias</methodname>
|
|
</member>
|
|
</simplelist>
|
|
</refsect1>
|
|
</refentry>
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|