svn: /phpdoc/ru/trunk/reference/filesystem/functions/ readfile.xml

From: Date: Sat, 12 Mar 2011 18:55:30 +0000
Subject: svn: /phpdoc/ru/trunk/reference/filesystem/functions/ readfile.xml
Groups: php.doc.ru 
Request: Send a blank email to doc-ru+get-1514@lists.php.net to get a copy of this message
shein Sat, 12 Mar 2011 18:55:30 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=309145 Log: Updated translation. Changed paths: U phpdoc/ru/trunk/reference/filesystem/functions/readfile.xml Modified: phpdoc/ru/trunk/reference/filesystem/functions/readfile.xml =================================================================== --- phpdoc/ru/trunk/reference/filesystem/functions/readfile.xml 2011-03-12 18:49:25 UTC (rev 309144) +++ phpdoc/ru/trunk/reference/filesystem/functions/readfile.xml 2011-03-12 18:55:30 UTC (rev 309145) @@ -1,44 +1,132 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- EN-Revision: n/a Maintainer: freespace Status: ready --> +<!-- EN-Revision: 297028 Maintainer: shein Status: ready --> +<!-- Reviewed: no --> <!-- $Revision$ --> -<!-- splitted from ./en/functions/filesystem.xml, last change in rev 1.2 --> - <refentry xml:id="function.readfile" xmlns="http://docbook.org/ns/docbook"> - <refnamediv> - <refname>readfile</refname> - <refpurpose>Выводит файл</refpurpose> - </refnamediv> - <refsect1> - <title>Описание</title> - <methodsynopsis> - <type>int</type><methodname>readfile</methodname> - <methodparam><type>string</type><parameter>filename</parameter></methodparam> - <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter></methodparam> - <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> - </methodsynopsis> - <para> - Читает файл и записывает его в буфер вывода. - </para> - <para> - Возвращает количество прочитанных из файла байт. В случае возникновения - ошибки вернёт &false;, если только функция не была вызвана как - @<function>readfile</function>, и выведет сообщение об ошибке. - </para> - &tip.fopen-wrapper; - <para> - Вы можете установить в &true; необязательный второй аргумент, - если вы также хотите попытаться найти файл в <link - linkend="ini.include-path">include_path</link>. - </para> - <para> - См. также описание функций <function>fpassthru</function>, - <function>file</function>, <function>fopen</function>, - <function>include</function>, <function>require</function>, - <function>virtual</function>, <function>file_get_contents</function> - и <xref linkend="wrappers"/>. - </para> - </refsect1> - </refentry> +<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.readfile"> + <refnamediv> + <refname>readfile</refname> + <refpurpose>Выводит файл</refpurpose> + </refnamediv> + <refsect1 role="description"> + &reftitle.description; + <methodsynopsis> + <type>int</type><methodname>readfile</methodname> + <methodparam><type>string</type><parameter>filename</parameter></methodparam> + <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>false</initializer></methodparam> + <methodparam choice="opt"><type>resource</type><parameter>context</parameter></methodparam> + </methodsynopsis> + <para> + Читает файл и записывает его в буфер вывода. + </para> + </refsect1> + + <refsect1 role="parameters"> + &reftitle.parameters; + <para> + <variablelist> + <varlistentry> + <term><parameter>filename</parameter></term> + <listitem> + <para> + Имя читаемого файла. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>use_include_path</parameter></term> + <listitem> + <para> + Вы можете установить в &true; необязательный второй аргумент, + если вы также хотите попытаться найти файл в <link + linkend="ini.include-path">include_path</link>. + </para> + </listitem> + </varlistentry> + <varlistentry> + <term><parameter>context</parameter></term> + <listitem> + <para> + Ресурс (<type>resource</type>) с контекстом потока. + </para> + </listitem> + </varlistentry> + </variablelist> + </para> + </refsect1> + + <refsect1 role="returnvalues"> + &reftitle.returnvalues; + <para> + Возвращает количество прочитанных из файла байт. В случае возникновения + ошибки вернёт &false;, если только функция не была вызвана как + @<function>readfile</function>, и выведет сообщение об ошибке. + </para> + </refsect1> + + <refsect1 role="examples"> + &reftitle.examples; + <para> + <example> + <title>Форсирование скачки с помощью <function>readfile</function></title> + <programlisting role="php"> +<![CDATA[ +<?php +$file = 'monkey.gif'; + +if (file_exists($file)) { + header('Content-Description: File Transfer'); + header('Content-Type: application/octet-stream'); + header('Content-Disposition: attachment; filename='.basename($file)); + header('Content-Transfer-Encoding: binary'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Pragma: public'); + header('Content-Length: ' . filesize($file)); + ob_clean(); + flush(); + readfile($file); + exit; +} +?> +]]> + </programlisting> + &example.outputs.similar; + <mediaobject> + <alt>Диалог открытия / сохранения файла</alt> + <imageobject> + <imagedata fileref="en/reference/filesystem/figures/readfile.png"/> + </imageobject> + </mediaobject> + </example> + </para> + </refsect1> + + <refsect1 role="notes"> + &reftitle.notes; + + &tip.fopen-wrapper; + &note.context-support; + </refsect1> + + <refsect1 role="seealso"> + &reftitle.seealso; + <para> + <simplelist> + <member><function>fpassthru</function></member> + <member><function>file</function></member> + <member><function>fopen</function></member> + <member><function>include</function></member> + <member><function>require</function></member> + <member><function>virtual</function></member> + <member><function>file_get_contents</function></member> + <member><xref linkend="wrappers"/></member> + </simplelist> + </para> + </refsect1> + +</refentry> + <!-- Keep this comment at the end of the file Local variables: mode: sgml @@ -50,7 +138,7 @@ sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil -sgml-default-dtd-file:"../~/.phpdoc/manual.ced" +sgml-default-dtd-file:"~/.phpdoc/manual.ced" sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil

« previous php.doc.ru (#1514) next »