add the new 'data:' wrapper

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@220361 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Nuno Lopes 2006-09-22 15:36:16 +00:00
parent 66066d5236
commit 752c7c0489

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.62 $ -->
<!-- $Revision: 1.63 $ -->
<appendix id="wrappers">
<title>List of Supported Protocols/Wrappers</title>
<para>
@ -889,6 +889,99 @@ file_put_contents("php://filter/write=string.rot13/resource=example.txt","Hello
</table>
</para>
</section>
<section id="wrappers.data">
<title>Data (RFC 2397)</title>
<simpara>
The <filename>data:</filename> (<ulink url="&url.rfc;2397">RFC
2397</ulink>) is available since PHP 5.2.0.
</simpara>
<example>
<title>Print data:// contents</title>
<programlisting role="php">
<![CDATA[
<?php
// prints "I love PHP"
echo file_get_contents('data://text/plain;base64,' . base64_encode("I love PHP\n"));
?>
]]>
</programlisting>
</example>
<example>
<title>Fetch the media type</title>
<programlisting role="php">
<![CDATA[
<?php
$fp = fopen('data://text/plain;base64,', 'r');
$meta = stream_get_meta_data($fp);
// prints "text/plain"
echo $meta['mediatype'];
?>
]]>
</programlisting>
</example>
<para>
<table>
<title>Wrapper Summary</title>
<tgroup cols="2">
<thead>
<row>
<entry>Attribute</entry>
<entry>Supported</entry>
</row>
</thead>
<tbody>
<row>
<entry>Restricted by <link linkend="ini.allow-url-fopen">allow_url_fopen</link></entry>
<entry>No</entry>
</row>
<row>
<entry>Allows Reading</entry>
<entry>Yes</entry>
</row>
<row>
<entry>Allows Writing</entry>
<entry>No</entry>
</row>
<row>
<entry>Allows Appending</entry>
<entry>No</entry>
</row>
<row>
<entry>Allows Simultaneous Reading and Writing</entry>
<entry>No</entry>
</row>
<row>
<entry>Supports <function>stat</function></entry>
<entry>No</entry>
</row>
<row>
<entry>Supports <function>unlink</function></entry>
<entry>No</entry>
</row>
<row>
<entry>Supports <function>rename</function></entry>
<entry>No</entry>
</row>
<row>
<entry>Supports <function>mkdir</function></entry>
<entry>No</entry>
</row>
<row>
<entry>Supports <function>rmdir</function></entry>
<entry>No</entry>
</row>
</tbody>
</tgroup>
</table>
</para>
</section>
<section id="wrappers.ssh2">
<title>Secure Shell 2</title>
<simpara>