cvs: phpdoc-ru /reference/http reference.xml /reference/http/functions headers-list.xml headers-sent.xml setrawcookie.xml

From: Date: Wed, 25 Feb 2004 17:58:07 +0000
Subject: cvs: phpdoc-ru /reference/http reference.xml /reference/http/functions headers-list.xml headers-sent.xml setrawcookie.xml
Groups: php.doc.ru 
Request: Send a blank email to doc-ru+get-225@lists.php.net to get a copy of this message
lovchy Wed Feb 25 12:58:07 2004 EDT Added files: /phpdoc-ru/reference/http reference.xml /phpdoc-ru/reference/http/functions headers-list.xml headers-sent.xml setrawcookie.xml Log: Translation complete.

http://cvs.php.net/co.php/phpdoc-ru/reference/http/reference.xml?r=1.1&p=1 Index: phpdoc-ru/reference/http/reference.xml +++ phpdoc-ru/reference/http/reference.xml <?xml version="1.0" encoding="windows-1251"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.7 Maintainer: venya Status: ready --> <reference id="ref.http"> <title>Ôóíêöèè ïðîòîêîëà HTTP</title> <titleabbrev>HTTP</titleabbrev> <partintro> <section id="http.intro"> &reftitle.intro; <para> Ýòè ôóíêöèè ïîçâîëÿþò âàì ðàáîòàòü ñ äàííûìè, êîòîðûå îòïðàâëÿþòñÿ áðîóçåðó óäàëåííîãî ïîëüçîâàòåëÿ, íà óðîâíå ïðîòîêîëà HTTP. </para> </section> <section id="http.requirements"> &reftitle.required; &no.requirement; </section> <section id="http.installation"> &reftitle.install; &no.install; </section> <section id="http.configuration"> &reftitle.runtime; &no.config; </section> <section id="http.resources"> &reftitle.resources; &no.resource; </section> <section id="http.constants"> &reftitle.constants; &no.constants; </section> </partintro> &reference.http.functions; </reference> <!-- 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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-ru/reference/http/functions/headers-list.xml?r=1.1&p=1 Index: phpdoc-ru/reference/http/functions/headers-list.xml +++ phpdoc-ru/reference/http/functions/headers-list.xml <?xml version="1.0" encoding="windows-1251"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.3 Maintainer: venya Status: ready --> <refentry id="function.headers-list"> <refnamediv> <refname>headers_list</refname> <refpurpose>Âîçâðàùàåò ñïèñîê îòïðàâëåííûõ HTTP-çàãîëîâêîâ (èëè ãîòîâûõ ê îòïðàâêå)</refpurpose> </refnamediv> <refsect1> <title>Îïèñàíèå</title> <methodsynopsis> <type>array</type><methodname>headers_list</methodname> <void/> </methodsynopsis> <simpara> <function>headers_list</function> âîçâðàùàåò íóìåðîâàííûé ìàññèâ çàãîëîâêîâ, ãîòîâûõ äëÿ îòïðàâêè áðîóçåðó / êëèåíòó. ×òîáû óçíàòü áûëè ëè îíè óæå îòïðàâëåíû - èñïîëüçóéòå ôóíêöèþ <function>headers_sent</function>. </simpara> <para> <example> <title>Ïðèìåð èñïîëüçîâàíèÿ <function>headers_list</function></title> <programlisting role="php"> <![CDATA[ <?php /* setcookie() äîáàâëÿåò ñâîé ñîáñòâåííûé çàãîëîâîê */ setcookie('foo', 'bar'); /* Îïðåäåëÿåì ñîáñòâåííûé çàãîëîâîê Áîëüøèíñòâî êëèåíòîâ åãî ïðîèãíîðèðóþò. */ header("X-Sample-Test: foo"); /* Êîíòåíò ïðåäîñòàâëåí â âèäå îáû÷íîãî òåêñòà */ header('Content-type: text/plain'); /* Êàêèå çàãîëîâêè áóäóò îòïðàâëåíû? */ var_dump(headers_list()); ?> ]]> </programlisting> <para> ðåçóëüòàò ðàáîòû : </para> <screen> <![CDATA[ array(4) { [0]=> string(29) "X-Powered-By: PHP/5.0.0" [1]=> string(19) "Set-Cookie: foo=bar" [2]=> string(18) "X-Sample-Test: foo" [3]=> string(24) "Content-type: text/plain" } ]]> </screen> </example> </para> <simpara> Ñìîòðèòå òàêæå: <function>headers_sent</function>, <function>header</function>, è <function>setcookie</function>. </simpara> </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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-ru/reference/http/functions/headers-sent.xml?r=1.1&p=1 Index: phpdoc-ru/reference/http/functions/headers-sent.xml +++ phpdoc-ru/reference/http/functions/headers-sent.xml <?xml version="1.0" encoding="windows-1251"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.15 Maintainer: venya Status: ready --> <!-- splitted from ./en/functions/http.xml, last change in rev 1.7 --> <refentry id="function.headers-sent"> <refnamediv> <refname>headers_sent</refname> <refpurpose>Ïðîâåðÿåò îòïðàâëåíû ëè HTTP-çàãîëîâêè êëèåíòó è, åñëè îòïðàâëåíû, òî ãäå</refpurpose> </refnamediv> <refsect1> <title>Îïèñàíèå</title> <methodsynopsis> <type>bool</type><methodname>headers_sent</methodname> <methodparam choice="opt"><type>string</type><parameter>&amp;file</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>&amp;line</parameter></methodparam> </methodsynopsis> <simpara> <function>headers_sent</function> âîçâðàùàåò &false;, åñëè HTTP çàãîëîâêè åùå íå áûëè îòïðàâëåíû êëèåíòó, è &true; â ïðîòèâîïîëîæíîì ñëó÷àå. Åñëè áûëè óêàçàíû íåîáÿçàòåëüíûå ïàðàìåòðû <parameter>file</parameter> è <parameter>line</parameter>, <function>headers_sent</function> âåðíåò èìÿ ôàéëà è íîìåð ñòðîêè, ãäå áûë íà÷àò âûâîä äàííûõ â ïåðåìåííûå <parameter>file</parameter> è <parameter>line</parameter> ñîîòâåòñòâåííî. </simpara> <simpara> Âû íå ìîæåòå äîáàâèòü íîâûå çàãîëîâêè ïðè ïîìîùè ôóíêöèè <function>header</function>, åñëè çàãîëîâêè óæå áûëè îòïðàâëåíû êëèåíòó. Èñïîëüçîâàíèå äàííîé ôóíêöèè ïîçâîëèò âàì ëèøü èçáåæàòü ñîîáùåíèé îá îøèáêàõ, ñâÿçàííûõ ïîâòîðíîé îòïðàâêîé HTTP-çàãîëîâêîâ. Äðóãîé âûõîä - èñïîëüçîâàòü <link linkend="ref.outcontrol">áóôåðèçàöèþ âûâîäà</link>. </simpara> <note> <simpara> Íåîáÿçàòåëüíûå ïàðàìåòðû <parameter>file</parameter> è <parameter>line</parameter> áûëè äîáàâëåíû â PHP 4.3.0. </simpara> </note> <para> <example> <title>Ïðèìåð èñïîëüçîâàíèÿ <function>headers_sent</function></title> <programlisting role="php"> <![CDATA[ <?php // Åñëè çàãîëîâêè åùå íå îòïðàâëåíû, äîáàâèòü if (!headers_sent()) { header('Location: http://www.example.com/'); exit; } // Ïðèìåð èñïîëüçîâàíèÿ îïöèîíàëüíûõ ïàðàìåòðîâ, äîáàâëåííûõ â PHP 4.3.0 // Îáðàòèòå âíèìàíèå, ÷òî $filename è $linenum ïåðåäàþòñÿ äëÿ ïîñëåäóþùåãî // èñïîëüçîâàíèÿ. Íå óñòàíàâëèâàéòå èõ ïðåäâàðèòåëüíî! if (!headers_sent($filename, $linenum)) { header('Location: http://www.example.com/'); exit; // Îáû÷íî çäåñü èäåò îáðàáîòêà îøèáîê. } else { echo "Çàãîëîâêè óæå îòïðàâëåíû â $filename íà ñòðîêå $linenum\n" . "Ðåäèðåêò íåâîçìîæåí, ïîæàëóéñòà íàæìèòå <a " . "href=\"http://www.example.com\">Çäåñü</a> ñàìîñòîÿòåëüíî\n"; exit; } ?> ]]> </programlisting> </example> </para> <para> Ñìîòðèòå òàêæå ôóíêöèè <function>ob_start</function>, <function>trigger_error</function>, è <function>header</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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 --> http://cvs.php.net/co.php/phpdoc-ru/reference/http/functions/setrawcookie.xml?r=1.1&p=1 Index: phpdoc-ru/reference/http/functions/setrawcookie.xml +++ phpdoc-ru/reference/http/functions/setrawcookie.xml <?xml version="1.0" encoding="windows-1251"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: venya Status: ready --> <!-- splitted from ./en/functions/http.xml, last change in rev 1.2 --> <refentry id="function.setrawcookie"> <refnamediv> <refname>setrawcookie</refname> <refpurpose>Óñòàíàâëèâàåò cookie áåç url-êîäèðîâàíèÿ å¸ çíà÷åíèÿ</refpurpose> </refnamediv> <refsect1> <title>Îïèñàíèå</title> <methodsynopsis> <type>bool</type><methodname>setrawcookie</methodname> <methodparam><type>string</type><parameter>name</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>value</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>expire</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>path</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>domain</parameter></methodparam> <methodparam choice="opt"><type>int</type><parameter>secure</parameter></methodparam> </methodsynopsis> <para> <function>setrawcookie</function> ðàáîò÷àåò òî÷íî òàê æå, êàê è <function>setcookie</function> çà èñêëþ÷åíèåì òîãî, ÷òî çíà÷åíèå cookie íå ïîäâåðãàåòñÿ àâòîìàòè÷åñêîé îáðàáîòêå ôóíêöèåé urlencode ïðè îòïðàâêå êëèåíòó. </para> <para> Ñìîòðèòå òàêæå <function>header</function>, <function>setcookie</function> è <link linkend="features.cookies">ðàçäåë Cookies</link>. </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: vim600: syn=xml fen fdm=syntax fdl=2 si vim: et tw=78 syn=sgml vi: ts=1 sw=1 -->
« previous php.doc.ru (#225) next »