cvs: phpdoc-cs /reference/network/functions socket-set-blocking.xml socket-set-timeout.xml syslog.xml
| From: | Lukas Jelinek | Date: | Thu, 20 Jun 2002 21:19:12 +0000 |
| Subject: | cvs: phpdoc-cs /reference/network/functions socket-set-blocking.xml socket-set-timeout.xml syslog.xml | ||
| Groups: | php.doc | ||
| Request: | Send a blank email to phpdoc+get-969346841@lists.php.net to get a copy of this message | ||
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: -->
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: -->