|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<!-- $Revision$ --> |
| 3 | +<refentry xml:id="ziparchive.getstreamname" xmlns="http://docbook.org/ns/docbook"> |
| 4 | + <refnamediv> |
| 5 | + <refname>ZipArchive::getStreamName</refname> |
| 6 | + <refpurpose>Get a file handler to the entry defined by its name (read only)</refpurpose> |
| 7 | + </refnamediv> |
| 8 | + <refsect1 role="description"> |
| 9 | + &reftitle.description; |
| 10 | + <methodsynopsis> |
| 11 | + <modifier>public</modifier> <type class="union"><type>resource</type><type>false</type></type><methodname>ZipArchive::getStreamName</methodname> |
| 12 | + <methodparam><type>string</type><parameter>name</parameter></methodparam> |
| 13 | + <methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>0</initializer></methodparam> |
| 14 | + </methodsynopsis> |
| 15 | + <para> |
| 16 | + Get a file handler to the entry defined by its name. For now it only |
| 17 | + supports read operations. |
| 18 | + </para> |
| 19 | + </refsect1> |
| 20 | + <refsect1 role="parameters"> |
| 21 | + &reftitle.parameters; |
| 22 | + <para> |
| 23 | + <variablelist> |
| 24 | + <varlistentry> |
| 25 | + <term><parameter>name</parameter></term> |
| 26 | + <listitem> |
| 27 | + <para> |
| 28 | + The name of the entry to use. |
| 29 | + </para> |
| 30 | + </listitem> |
| 31 | + </varlistentry> |
| 32 | + <varlistentry> |
| 33 | + <term><parameter>flags</parameter></term> |
| 34 | + <listitem> |
| 35 | + <para> |
| 36 | + If flags is set to <constant>ZipArchive::FL_UNCHANGED</constant>, the original unchanged |
| 37 | + stream is returned. |
| 38 | + </para> |
| 39 | + </listitem> |
| 40 | + </varlistentry> |
| 41 | + </variablelist> |
| 42 | + </para> |
| 43 | + </refsect1> |
| 44 | + <refsect1 role="returnvalues"> |
| 45 | + &reftitle.returnvalues; |
| 46 | + <para> |
| 47 | + Returns a file pointer (resource) on success&return.falseforfailure;. |
| 48 | + </para> |
| 49 | + </refsect1> |
| 50 | + <refsect1 role="examples"> |
| 51 | + &reftitle.examples; |
| 52 | + <example> |
| 53 | + <title>Get the entry contents with <function>fread</function> and store it</title> |
| 54 | + <programlisting role="php"> |
| 55 | +<![CDATA[ |
| 56 | +<?php |
| 57 | +$contents = ''; |
| 58 | +$z = new ZipArchive(); |
| 59 | +if ($z->open('test.zip')) { |
| 60 | + $fp = $z->getStreamName('test', ZipArchive::FL_UNCHANGED); |
| 61 | + if(!$fp) die($z->getStatusString()); |
| 62 | +
|
| 63 | + echo stream_get_contents($fp); |
| 64 | +
|
| 65 | + fclose($fp); |
| 66 | +} |
| 67 | +?> |
| 68 | +]]> |
| 69 | + </programlisting> |
| 70 | + </example> |
| 71 | + </refsect1> |
| 72 | + |
| 73 | + <refsect1 role="seealso"> |
| 74 | + &reftitle.seealso; |
| 75 | + <para> |
| 76 | + <simplelist> |
| 77 | + <member><methodname>ZipArchive::getStreamIndex</methodname></member> |
| 78 | + </simplelist> |
| 79 | + </para> |
| 80 | + </refsect1> |
| 81 | + |
| 82 | +</refentry> |
| 83 | + |
| 84 | +<!-- Keep this comment at the end of the file |
| 85 | +Local variables: |
| 86 | +mode: sgml |
| 87 | +sgml-omittag:t |
| 88 | +sgml-shorttag:t |
| 89 | +sgml-minimize-attributes:nil |
| 90 | +sgml-always-quote-attributes:t |
| 91 | +sgml-indent-step:1 |
| 92 | +sgml-indent-data:t |
| 93 | +indent-tabs-mode:nil |
| 94 | +sgml-parent-document:nil |
| 95 | +sgml-default-dtd-file:"~/.phpdoc/manual.ced" |
| 96 | +sgml-exposed-tags:nil |
| 97 | +sgml-local-catalogs:nil |
| 98 | +sgml-local-ecat-files:nil |
| 99 | +End: |
| 100 | +vim600: syn=xml fen fdm=syntax fdl=2 si |
| 101 | +vim: et tw=78 syn=sgml |
| 102 | +vi: ts=1 sw=1 |
| 103 | +--> |
0 commit comments