luk Thu Jun 20 17:19:12 2002 EDT
Added files:
/phpdoc-cs/reference/network/functions socket-set-blocking.xml
socket-set-timeout.xml
syslog.xml
Log:
Index: phpdoc-cs/reference/network/functions/socket-set-blocking.xml
+++ phpdoc-cs/reference/network/functions/socket-set-blocking.xml
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.2 Maintainer: luk Status: ready -->
<refentry id="function.socket-set-blocking">
<refnamediv>
<refname>socket_set_blocking</refname>
<refpurpose>Nastavuje blokuj�c�/neblokuj�c� re�im socketu</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>int</type><methodname>socket_set_blocking</methodname>
<methodparam><type>int</type><parameter>socket
descriptor</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
Pokud m� <parameter>mode</parameter> hodnotu &false;, p��slu�n� deskriptor
socketu se p�epne do neblokuj�c�ho re�imu; je-li &true;, p�epne se do
blokuj�c�ho re�imu. To m� vliv na vol�n� jako je
<function>fgets</function>, kter� �tou ze socketu. V neblokuj�c�m
re�imu vol�n� funkce <function>fgets</function> v�dy p�ed�v� ��zen� zp�t,
zat�mco v blokuj�c�m re�imu bude �ekat na to, a� budou na socketu dostupn�
data.
</para>
<para>
Tato funkce se d��ve jmenovala <function>set_socket_blocking</function>,
ale tento n�zev je nyn� zavr�en�.
</para>
</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:"../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
Index: phpdoc-cs/reference/network/functions/socket-set-timeout.xml
+++ phpdoc-cs/reference/network/functions/socket-set-timeout.xml
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.2 Maintainer: luk Status: ready -->
<refentry id="function.socket-set-timeout">
<refnamediv>
<refname>socket_set_timeout</refname>
<refpurpose>Nastav� �asov� limit (timeout) socketu</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>bool</type><methodname>socket_set_timeout</methodname>
<methodparam><type>int</type><parameter>socket
descriptor</parameter></methodparam>
<methodparam><type>int</type><parameter>seconds</parameter></methodparam>
<methodparam><type>int</type><parameter>microseconds</parameter></methodparam>
</methodsynopsis>
<para>
Nastavuje velikost �asov�ho limitu socketu dan�ho hodnotou
<parameter>socket descriptor</parameter>, ve form� sou�tu sekund
(<parameter>seconds</parameter>) a mikrosekund
(<parameter>microseconds</parameter>).
<example>
<title><function>socket_set_timeout</function> P��klad</title>
<programlisting role="php">
<![CDATA[
<?php
$fp = fsockopen("www.example.com", 80);
if(!$fp) {
echo "Nelze otev��t\n";
} else {
fputs($fp,"GET / HTTP/1.0\n\n");
$start = time();
socket_set_timeout($fp, 2);
$res = fread($fp, 2000);
var_dump(socket_get_status($fp));
fclose($fp);
print $res;
}
?>
]]>
</programlisting>
</example>
</para>
<para>
Tato funkce se d��ve jmenovala <function>set_socket_timeout</function>,
ale tento n�zev je nyn� zavr�en�.
</para>
<para>
Viz tak�: <function>fsockopen</function> a <function>fopen</function>.
</para>
</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:"../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->
Index: phpdoc-cs/reference/network/functions/syslog.xml
+++ phpdoc-cs/reference/network/functions/syslog.xml
<?xml version="1.0" encoding="iso-8859-2"?>
<!-- EN-Revision: 1.2 Maintainer: luk Status: ready -->
<refentry id="function.syslog">
<refnamediv>
<refname>syslog</refname>
<refpurpose>Vygeneruje zpr�vu do syst�mov�ho protokolu</refpurpose>
</refnamediv>
<refsect1>
<title>Popis</title>
<methodsynopsis>
<type>int</type><methodname>syslog</methodname>
<methodparam><type>int</type><parameter>priority</parameter></methodparam>
<methodparam><type>string</type><parameter>message</parameter></methodparam>
</methodsynopsis>
<para>
<function>syslog</function> vygeneruje zpr�vu do protokolu, kter� se
distribuuje prost�ednictv�m d�mona syst�mov�ho protokolu.
<parameter>priority</parameter> p�edstavuje kombinaci charakteru a
�rovn� zpr�vy; hodnoty popisuje n�sleduj�c� sekce. Zb�vaj�c� argument je
zpr�va, kter� se m� odeslat. Dva znaky ve zpr�v� (<literal>%m</literal>)
se v�ak nahrad� �et�zcem chybov� zpr�vy (strerror) odpov�daj�c�
aktu�ln� hodnot� <errortype>errno</errortype>.
</para>
<para>
<table>
<title><function>syslog</function> Priority (v klesaj�c�m po��dku)</title>
<tgroup cols="2">
<thead>
<row>
<entry>Konstanta</entry>
<entry>Popis</entry>
</row>
</thead>
<tbody>
<row>
<entry>LOG_EMERG</entry>
<entry>syst�m je nepou�iteln�</entry>
</row>
<row>
<entry>LOG_ALERT</entry>
<entry>je nutn� okam�it� z�sah</entry>
</row>
<row>
<entry>LOG_CRIT</entry>
<entry>kritick� situace</entry>
</row>
<row>
<entry>LOG_ERR</entry>
<entry>chyba</entry>
</row>
<row>
<entry>LOG_WARNING</entry>
<entry>varov�n�</entry>
</row>
<row>
<entry>LOG_NOTICE</entry>
<entry>norm�ln�, av�ak v�znamn�, zpr�va</entry>
</row>
<row>
<entry>LOG_INFO</entry>
<entry>informativn� zpr�va</entry>
</row>
<row>
<entry>LOG_DEBUG</entry>
<entry>ladic� zpr�va</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
<para>
<example>
<title>Pou�it� <function>syslog</function></title>
<programlisting role="php">
<![CDATA[
<?php
define_syslog_variables();
// otev�e syslog, vlo�� ID procesu a ode�le tak� na standardn� chybov�
// v�stup; pou�ije u�ivatelsky definovan� protokolovac� mechanismus
openlog("myScripLog", LOG_PID | LOG_PERROR, LOG_LOCAL0);
// n�jak� k�d
if (authorized_client()) {
// n�co ud�lej
} else {
// neautorizovan� klient!
// zaznamenej pokus o p��stup
$access = date("Y/m/d H:i:s");
syslog(LOG_WARNING,"Neautorizovan� klient: $access $REMOTE_ADDR
($HTTP_USER_AGENT)");
}
closelog();
?>
]]>
</programlisting>
</example>
V�ce informac� o nastaven� u�ivatelsk� obsluhy protokolov�n� -- viz
unixovou manu�lovou str�nku
<citerefentry><refentrytitle>syslog.conf</refentrytitle>
<manvolnum>5</manvolnum></citerefentry>. V�ce informac� o mo�nostech
a volb�ch mechanismu syslog najdete (na unixov�ch stroj�ch) v manu�lov�ch
str�nk�ch pro <citerefentry><refentrytitle>syslog</refentrytitle>
<manvolnum>3</manvolnum></citerefentry>.
</para>
<para>
Na Windows NT je slu�ba syslog emulov�na pomoc� slu�by Event Log.
</para>
<para>
Viz tak� <function>define_syslog_variables</function>,
<function>openlog</function> a
<function>closelog</function>.
</para>
</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:"../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->