nlopess Fri Sep 22 15:36:16 2006 UTC
Modified files: /phpdoc/en/appendices wrappers.xml Log: add the new 'data:' wrapper http://cvs.php.net/viewvc.cgi/phpdoc/en/appendices/wrappers.xml?r1=1.62&r2=1.63&diff_format=u Index: phpdoc/en/appendices/wrappers.xml diff -u phpdoc/en/appendices/wrappers.xml:1.62 phpdoc/en/appendices/wrappers.xml:1.63 --- phpdoc/en/appendices/wrappers.xml:1.62 Fri Aug 11 22:00:05 2006 +++ phpdoc/en/appendices/wrappers.xml Fri Sep 22 15:36:16 2006 @@ -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 @@ </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>