cvs: phpdoc-ja /internals/streams common.xml constants.xml dir.xml file.xml index.xml socket.xml structs.xml
| From: | TAKAGI Masahiro | Date: | Mon, 22 Aug 2005 08:17:12 +0000 |
| Subject: | cvs: phpdoc-ja /internals/streams common.xml constants.xml dir.xml file.xml index.xml socket.xml structs.xml | ||
| Groups: | php.doc.ja | ||
| Request: | Send a blank email to doc-ja+get-1153@lists.php.net to get a copy of this message | ||
takagi Mon Aug 22 04:17:12 2005 EDT
Added files:
/phpdoc-ja/internals/streams structs.xml socket.xml index.xml
file.xml dir.xml constants.xml
common.xml
Log:
moved from /phpdoc-ja/chapters/streams* .
http://cvs.php.net/co.php/phpdoc-ja/internals/streams/structs.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/structs.xml +++ phpdoc-ja/internals/streams/structs.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.structs"> <title>ã¹ããªã¼ã æ§é ä½</title> <refentry id="streams.struct-php-stream-statbuf"> <refnamediv> <refname>struct php_stream_statbuf</refname> <refpurpose>ãã¡ã¤ã«ã¾ãã¯URLã«é¢ããæ å ±ãä¿æãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <synopsis> <structname>php_stream_statbuf</structname> <type>struct stat</type> <structfield>sb</structfield> </synopsis> <para> <structfield>sb</structfield> ã¯ãé常ã®ã·ã¹ãã ãå®ç¾©ãã struct statã§ãã </para> </refsect1> </refentry> <refentry id="streams.struct-php-stream-dirent"> <refnamediv> <refname>struct php_stream_dirent</refname> <refpurpose> ãã£ã¬ã¯ããªæ¢ç´¢ã®éã«ä¸ã¤ã®ãã¡ã¤ã«ã«é¢ããæ å ±ãä¿æãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <synopsis> <structname>php_stream_dirent</structname> <type>char</type> <structfield>d_name[MAXPATHLEN]</structfield> </synopsis> <para> <structfield>d_name</structfield> ã¯ãæ¢ç´¢ãããã£ã¬ã¯ããªã«é¢ã㦠ç¸å¯¾çãªãã¡ã¤ã«åãä¿æãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.struct-php-stream-ops"> <refnamediv> <refname>struct php_stream_ops</refname> <refpurpose>Holds member functions for a stream implementation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <programlisting role="c"> <![CDATA[ typedef struct _php_stream_ops { /* all streams MUST implement these operations */ size_t (*write)(php_stream *stream, const char *buf, size_t count TSRMLS_DC); size_t (*read)(php_stream *stream, char *buf, size_t count TSRMLS_DC); int (*close)(php_stream *stream, int close_handle TSRMLS_DC); int (*flush)(php_stream *stream TSRMLS_DC); const char *label; /* name describing this class of stream */ /* these operations are optional, and may be set to NULL if the stream does not * support a particular operation */ int (*seek)(php_stream *stream, off_t offset, int whence TSRMLS_DC); char *(*gets)(php_stream *stream, char *buf, size_t size TSRMLS_DC); int (*cast)(php_stream *stream, int castas, void **ret TSRMLS_DC); int (*stat)(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); } php_stream_ops; ]]> </programlisting> </refsect1> </refentry> <refentry id="streams.struct-php-stream-wrapper"> <refnamediv> <refname>struct php_stream_wrapper</refname> <refpurpose>Holds wrapper properties and pointer to operations</refpurpose> </refnamediv> <refsect1> <title>Description</title> <programlisting role="c"> <![CDATA[ struct _php_stream_wrapper { php_stream_wrapper_ops *wops; /* operations the wrapper can perform */ void *abstract; /* context for the wrapper */ int is_url; /* so that PG(allow_url_fopen) can be respected */ /* support for wrappers to return (multiple) error messages to the stream opener */ int err_count; char **err_stack; } php_stream_wrapper; ]]> </programlisting> </refsect1> </refentry> <refentry id="streams.struct-php-stream-wrapper-ops"> <refnamediv> <refname>struct php_stream_wrapper_ops</refname> <refpurpose>Holds member functions for a stream wrapper implementation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <programlisting role="c"> <![CDATA[ typedef struct _php_stream_wrapper_ops { /* open/create a wrapped stream */ php_stream *(*stream_opener)(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); /* close/destroy a wrapped stream */ int (*stream_closer)(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC); /* stat a wrapped stream */ int (*stream_stat)(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSR$ /* stat a URL */ int (*url_stat)(php_stream_wrapper *wrapper, char *url, php_stream_statbuf *ssb TSRMLS_DC); /* open a "directory" stream */ php_stream *(*dir_opener)(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); const char *label; /* Delete/Unlink a file */ int (*unlink)(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); } php_stream_wrapper_ops; ]]> </programlisting> </refsect1> </refentry> <refentry id="streams.struct-php-stream-filter"> <refnamediv> <refname>struct php_stream_filter</refname> <refpurpose>Holds filter properties and pointer to operations</refpurpose> </refnamediv> <refsect1> <title>Description</title> <programlisting role="c"> <![CDATA[ struct _php_stream_filter { php_stream_filter_ops *fops; void *abstract; /* for use by filter implementation */ php_stream_filter *next; php_stream_filter *prev; int is_persistent; /* link into stream and chain */ php_stream_filter_chain *chain; /* buffered buckets */ php_stream_bucket_brigade buffer; } php_stream_filter; ]]> </programlisting> </refsect1> </refentry> <refentry id="streams.struct-php-stream-filter-ops"> <refnamediv> <refname>struct php_stream_filter_ops</refname> <refpurpose>Holds member functions for a stream filter implementation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <programlisting role="c"> <![CDATA[ typedef struct _php_stream_filter_ops { php_stream_filter_status_t (*filter)( php_stream *stream, php_stream_filter *thisfilter, php_stream_bucket_brigade *buckets_in, php_stream_bucket_brigade *buckets_out, size_t *bytes_consumed, int flags TSRMLS_DC); void (*dtor)(php_stream_filter *thisfilter TSRMLS_DC); const char *label; } php_stream_filter_ops; ]]> </programlisting> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/socket.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/socket.xml +++ phpdoc-ja/internals/streams/socket.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.socket-api"> <title>ã¹ããªã¼ã ã½ã±ãã API ãªãã¡ã¬ã³ã¹</title> <refentry id="streams.php-stream-sock-open-from-socket"> <refnamediv> <refname>php_stream_sock_open_from_socket</refname> <refpurpose>ã½ã±ãããã¹ã¯ãªãã¿ãã¹ããªã¼ã ã«å¤æãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_sock_open_from_socket</methodname> <methodparam><type>int</type><parameter>socket</parameter></methodparam> <methodparam><type>int</type><parameter>persistent</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_sock_open_from_socket</function> ã¯ã <parameter>socket</parameter> ãå ã«ããã¹ããªã¼ã ãè¿ãã¾ãã <parameter>persistent</parameter> ã¯ãã¹ããªã¼ã ãæä¹ çã¹ããªã¼ã ã¨ã㦠éããã©ãããæå®ãã¾ããä¸è¬çã«ã¯ããã®å¤ã¯ 0 ã«ãªããã¨ãã»ã¨ãã©ã§ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-sock-open-host"> <refnamediv> <refname>php_stream_sock_open_host</refname> <refpurpose>ãã¹ãã¸ã®æ¥ç¶ããªã¼ãã³ããã¹ããªã¼ã ãè¿ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_sock_open_host</methodname> <methodparam><type>const char *</type><parameter>host</parameter></methodparam> <methodparam><type>unsigned short</type><parameter>port</parameter></methodparam> <methodparam><type>int</type><parameter>socktype</parameter></methodparam> <methodparam><type>struct timeval *</type><parameter>timeout</parameter></methodparam> <methodparam><type>int</type><parameter>persistent</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_sock_open_host</function> ã¯ãæå®ããããã¹ã <parameter>host</parameter> ã®ãã¼ã <parameter>port</parameter> ã«å¯¾ãã æ¥ç¶ã確ç«ãã¾ãã<parameter>socktype</parameter> ã¯ã æ¥ç¶ã«é©ç¨ãããæ§å¼ãæå®ãã¾ãã<parameter>socktype</parameter> ã« æå®ã§ããå¤ã¯ã·ã¹ãã ã«ä¾åãã¦ãã¾ããã大æµã¯ (å°ãªãã¨ã) <constant>SOCK_STREAM</constant> ããæç³»åçãªãä¿¡é ¼æ§ã®ããã 忹忥ç¶ã®ã½ã±ãã (TCP)ã <constant>SOCK_DGRAM</constant> ãã æ¥ç¶åã§ãªãä¿¡é ¼æ§ã®å°ãªãåºå®é·ã¡ãã»ã¼ã¸ã®ã½ã±ãã (UDP) ã«å¯¾ã㦠æå®ã§ãã¾ãã </para> <para> <parameter>persistent</parameter> ã¯ãã¹ããªã¼ã ãæä¹ çã¹ããªã¼ã ã¨ã㦠éããã©ãããæå®ãã¾ããä¸è¬çã«ã¯ããã®å¤ã¯ 0 ã«ãªããã¨ãã»ã¨ãã©ã§ãã </para> <para> <parameter>timeout</parameter> ã NULL ã§ãªãå ´åãæ¥ç¶ããéã«è¨±ããã æé·ã®æéãæå®ãã¾ãã ãããã¿ã¤ã ã¢ã¦ãã®å¤ãããé·ãæ¥ç¶ã«æéãããã£ãã¨ãã¯ã æ¥ç¶ã¯ä¸æãããã¹ããªã¼ã ããªã¼ãã³ã§ããªãã£ããã¨ã示ããã NULL ãè¿ããã¾ãã </para> <note> <simpara> ã¿ã¤ã ã¢ã¦ãã®å¤ã¯ DNS ã«ãã¯ã¢ããã«ãããæéãå«ã¿ã¾ããã ãããã¯ããªã DNS ã«ãã¯ã¢ãããå®è£ ããç§»æ¤æ§ã®é«ãæ¹æ³ããªãããã§ãã </simpara> <simpara> ã¾ããã¿ã¤ã ã¢ã¦ãã¯ãæ¥ç¶ãã§ã¼ãºã«ã®ã¿é©ç¨ããã¾ãã ãããå¾ã«ç¶ãèªã¿åºããæ¸ãè¾¼ã¿æä½ã«ã¤ãã¦ã¿ã¤ã ã¢ã¦ãæéãè¨å®ãããå ´åã¯ã 䏿¦éãããã¹ããªã¼ã ã«å¯¾ãã <function>php_stream_sock_set_timeout</function> ã使ã£ã¦ãã ããã </simpara> </note> <para> ã¹ããªã¼ã API ã¯ã<parameter>socktype</parameter> ã«æå®ã§ããå¤ã« å¶éãè¨ãã¦ãã¾ããããèªåã®æ¡å¼µã¢ã¸ã¥ã¼ã«ããªãªã¼ã¹ããéã«ã¯ã ãã®å¤ãã©ããããã®ç§»æ¤å¯è½æ§ãæã¤ãã«ã¤ãã¦èæ ®ãã¾ãããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-sock-open-unix"> <refnamediv> <refname>php_stream_sock_open_unix</refname> <refpurpose> Unix ãã¡ã¤ã³ã½ã±ããããªã¼ãã³ããã¹ããªã¼ã ã¸å¤æãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_sock_open_unix</methodname> <methodparam><type>const char *</type><parameter>path</parameter></methodparam> <methodparam><type>int</type><parameter>pathlen</parameter></methodparam> <methodparam><type>int</type><parameter>persistent</parameter></methodparam> <methodparam><type>struct timeval *</type><parameter>timeout</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_sock_open_unix</function> 㯠<parameter>path</parameter> ã§æå®ããã Unix ãã¡ã¤ã³ã½ã±ãããéãã¾ãã<parameter>pathlen</parameter> ã¯ã<parameter>path</parameter> ã®é·ããæå®ãã¾ãã <parameter>timeout</parameter> 㯠NULL ã§ãªãå ´åã æ¥ç¶è©¦è¡ã«ãããã¿ã¤ã ã¢ã¦ãæéãæå®ãã¾ãã <parameter>persistent</parameter> ã¯ãã¹ããªã¼ã ãæä¹ çã¹ããªã¼ã ã¨ã㦠éããã©ãããæå®ãã¾ããä¸è¬çã«ã¯ããã®å¤ã¯ 0 ã«ãªããã¨ãã»ã¨ãã©ã§ãã </para> <note> <simpara> ãã®é¢æ°ã¯ Unix ãã¡ã¤ã³ã½ã±ãããå®è£ ããã¦ããªã Windows ã§ã¯åãã¾ããã ãã ãPHP ã®ãã¤ããªã cygwin ãç¨ãã¦ä½ããã¦ããå ´åã¯ãã®éãã§ã¯ããã¾ããã èªåã®æ¡å¼µã¢ã¸ã¥ã¼ã«ããªãªã¼ã¹ããéã«ã¯ãç§»æ¤å¯è½æ§ã«ã¤ãã¦èæ ®ãã¾ãããã </simpara> </note> <note> <simpara> ãã®é¢æ°ã¯ <parameter>path</parameter> ã (Linux ãªã©) æ½è±¡åå空éããã¡ã ãã¹åã®æåã NUL æåã«ãªããã¨ãããã·ã¹ãã ã«é©ãããã ãã¤ããªã»ã¼ãã«æ±ãã¾ãã </simpara> </note> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/index.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/index.xml +++ phpdoc-ja/internals/streams/index.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: working --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <chapter id="streams"> <title>PHPæ¡å¼µã¢ã¸ã¥ã¼ã«ã®ä½è ç¨ã®ã¹ããªã¼ã API</title> <sect1 id="streams.overview"> <title>æ¦è¦</title> <para> PHPã¹ããªã¼ã APIã¯ãPHPæ¡å¼µã¢ã¸ã¥ã¼ã«ã«ãã¡ã¤ã«ããã³ã½ã±ããå¦ç ç¨ã®çµ±ä¸åãããææ®µãå°å ¥ãããã®ã§ãã å ±éã®æä½ãè¡ãªãããã®æ¨æºé¢æ°ãæããåä¸ã®APIã使ç¨ãããã¨ã« ãããã¹ããªã¼ã APIã¯æ¡å¼µã¢ã¸ã¥ã¼ã«ããã¡ã¤ã«ãã½ã±ãããURLãã¡ã¢ãª ã¹ã¯ãªãããå®ç¾©ãããªãã¸ã§ã¯ãã«ã¢ã¯ã»ã¹ãããã¨ãå¯è½ã«ãã¾ãã ã¹ããªã¼ã ã¯ãæ°è¦ã¹ããªã¼ã ãç»é²ããããã«åçã«ãã¼ãããã ã¢ã¸ã¥ã¼ã«(ããã³ã¹ã¯ãªãã!)ã¨ãããã¨ãã§ããå®è¡æã«æ¡å¼µå¯è½ãª APIã§ãã </para> <para> ã¹ããªã¼ã APIã®ç®çã¯ããã¡ã¤ã«ãURLããã®ä»ã®ã¹ããªã¼ã ã«ã§ãããã¼ã¿ ã½ã¼ã¹ãå¹³æãªçµ±ä¸ãããAPIã«ãããéçºè ã容æã«ãªã¼ãã³ã§ããããã« ãããã¨ã§ããAPIã¯ãã»ã¼ANSI C stdio颿°ã¨(å¤ãã®ä¸»ãªé¢æ°ã«ã¤ãã¦åç ã®æå³ãæãã¦ããã)é¡ä¼¼ãã¦ãã¾ãããã®ãããCããã°ã©ãã¯ã ã¹ããªã¼ã ã«æ £ãã¦ããå°è±¡ãåããã¯ãã§ãã </para> <para> ã¹ããªã¼ã APIã¯ãããã¤ãã®ç°ãªãã¬ãã«ãå¦çãã¾ãã åºæ¬ã¬ãã«ã§ã¯ãAPIã¯ã¹ããªã¼ããã«ãªãã¼ã¿ã½ã¼ã¹ã表ã php_streamãªãã¸ã§ã¯ããå®ç¾©ãã¾ãã ããé«ãã¬ãã«ã§ã¯ãAPIã¯ãURLããã®ãã¼ã¿ããã³ã¡ã¿ãã¼ã¿ã®åå¾ã ãµãã¼ãããããã«ä½ã¬ãã«APIãã©ããããphp_stream_wrapper ãªãã¸ã§ã¯ããå®ç¾©ãã¾ãã An additional <literal>context</literal> parameter, accepted by most stream creation functions, is passed to the wrapper's <literal>stream_opener</literal> method to fine-tune the behavior of the wrapper. </para> <para> Any stream, once opened, can also have any number of <literal>filters</literal> applied to it, which process data as it is read from/written to the stream. </para> <para> ã¹ããªã¼ã ã¯ããã¡ã¤ã«å¦çã®ä»ã®å½¢å¼ã«ãã£ã¹ã(夿)ã§ãã 大ããªåé¡ããªããµã¼ããã¼ãã£è£½ã®ã©ã¤ãã©ãªã¨çµã¿åããã¦ä½¿ç¨ãã ãã¨ãã§ãã¾ããããã«ããããããã®ã©ã¤ãã©ãªãURLã½ã¼ã¹ãããã¼ã¿ã« ç´æ¥ã¢ã¯ã»ã¹ã§ããããã«ãªãã¾ãã 使ç¨ããã·ã¹ãã ã«<function>fopencookie</function>ã¾ã㯠<function>funopen</function>颿°ãããå ´åã ä»»æã®PHPã¹ããªã¼ã ãANSI stdioã使ãä»»æã®ã©ã¤ãã©ãªã«æ¸¡ããã¨ãã ã§ãã¾ã! </para> <para> <note> <para> The functions in this chapter are for use in the PHP source code and are not PHP functions. Userland stream functions can be found in the <link linkend="ref.stream">Stream Reference</link>. </para> </note> </para> </sect1> <sect1 id="streams.basics"> <title>ã¹ããªã¼ã ã®åºæ¬</title> <para> ã¹ããªã¼ã ã®ä½¿ç¨æ¹æ³ã¯ãANSI stdio颿°ã®ä½¿ç¨ã¨é常ã«ä¼¼ã¦ãã¾ãã 主ãªéãã¯ã使ç¨ãéå§ããã¹ããªã¼ã ãå¾ãæ¹æ³ã§ãã å¤ãã®å ´åãã¹ããªã¼ã ã®ãã³ãã«ãå¾ãããã« <function>php_stream_open_wrapper</function>ã使ç¨ãã¾ãã ãã®é¢æ°ã®åä½ã¯ã以ä¸ã®ä¾ã§ç¤ºãããã«fopenã¨é常ã«ããã«ã¦ãã¾ãã </para> <para> <example> <title>PHPãã¼ã ãã¼ã¸ã表示ããããã®ç°¡åãªã¹ããªã¼ã ã®ä¾</title> <programlisting role="c"> <![CDATA[ php_stream * stream = php_stream_open_wrapper("http://www.php.net", "rb", REPORT_ERRORS, NULL); if (stream) { while(!php_stream_eof(stream)) { char buf[1024]; if (php_stream_gets(stream, buf, sizeof(buf))) { printf(buf); } else { break; } } php_stream_close(stream); } ]]> </programlisting> </example> </para> <para> 以ä¸ã®è¡¨ã«ãã®ä»ã®ä¸è¬çãªANSI stdio颿°ã¨ç価ãªã¹ããªã¼ã 颿°ã 示ãã¾ããæ³¨è¨ã§é¤å¤ããã¦ããªãéãã颿°ã®æå³ã¯åãã§ãã <table> <title>ANSI stdioã¨ç価ãªã¹ããªã¼ã API颿°</title> <tgroup cols="3"> <thead> <row> <entry>ANSI stdio颿°</entry> <entry>PHP ã¹ããªã¼ã 颿°</entry> <entry>注æ</entry> </row> </thead> <tbody> <row> <entry>fopen</entry> <entry>php_stream_open_wrapper</entry> <entry>ã¹ããªã¼ã ã§ã¯ãã©ã¡ã¼ã¿ãå¢ãã¦ãã¾ã</entry> </row> <row> <entry>fclose</entry> <entry>php_stream_close</entry> <entry></entry> </row> <row> <entry>fgets</entry> <entry>php_stream_gets</entry> <entry></entry> </row> <row> <entry>fread</entry> <entry>php_stream_read</entry> <entry>ãã©ã¡ã¼ã¿nmembã®å¤ã1ã¨ä»®å®ããã¨ããããã¿ã¤ãã¯read(2)ã«ããä¼¼ããã¨ã«ãªãã¾ã</entry> </row> <row> <entry>fwrite</entry> <entry>php_stream_write</entry> <entry>ãã©ã¡ã¼ã¿nmembã®å¤ã1ã¨ä»®å®ããã¨ããããã¿ã¤ãã¯write(2)ã«ããä¼¼ããã¨ã«ãªãã¾ã</entry> </row> <row> <entry>fseek</entry> <entry>php_stream_seek</entry> <entry></entry> </row> <row> <entry>ftell</entry> <entry>php_stream_tell</entry> <entry></entry> </row> <row> <entry>rewind</entry> <entry>php_stream_rewind</entry> <entry></entry> </row> <row> <entry>feof</entry> <entry>php_stream_eof</entry> <entry></entry> </row> <row> <entry>fgetc</entry> <entry>php_stream_getc</entry> <entry></entry> </row> <row> <entry>fputc</entry> <entry>php_stream_putc</entry> <entry></entry> </row> <row> <entry>fflush</entry> <entry>php_stream_flush</entry> <entry></entry> </row> <row> <entry>puts</entry> <entry>php_stream_puts</entry> <entry>fputsã§ã¯ãªããputsã¨åãæå³</entry> </row> <row> <entry>fstat</entry> <entry>php_stream_stat</entry> <entry>ã¹ããªã¼ã ã¯ããæ å ±ã®å¤ãstatæ§é ä½ãæãã¦ãã¾ã</entry> </row> </tbody> </tgroup> </table> </para> </sect1> <sect1 id="streams.resources"> <title>ãªã½ã¼ã¹ã¨ãã¦ã®ã¹ããªã¼ã </title> <para> All streams are registered as resources when they are created. This ensures that they will be properly cleaned up even if there is some fatal error. All of the filesystem functions in PHP operate on streams resources - that means that your extensions can accept regular PHP file pointers as parameters to, and return streams from their functions. The streams API makes this process as painless as possible: </para> <para> <example> <title>How to accept a stream as a parameter</title> <programlisting role="c"> <![CDATA[ PHP_FUNCTION(example_write_hello) { zval *zstream; php_stream *stream; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstream)) return; php_stream_from_zval(stream, &zstream); /* you can now use the stream. However, you do not "own" the stream, the script does. That means you MUST NOT close the stream, because it will cause PHP to crash! */ php_stream_write(stream, "hello\n"); RETURN_TRUE(); } ]]> </programlisting> </example> </para> <para> <example> <title>How to return a stream from a function</title> <programlisting role="c"> <![CDATA[ PHP_FUNCTION(example_open_php_home_page) { php_stream *stream; stream = php_stream_open_wrapper("http://www.php.net", "rb", REPORT_ERRORS, NULL); php_stream_to_zval(stream, return_value); /* after this point, the stream is "owned" by the script. If you close it now, you will crash PHP! */ } ]]> </programlisting> </example> </para> <para> Since streams are automatically cleaned up, it's tempting to think that we can get away with being sloppy programmers and not bother to close the streams when we are done with them. Although such an approach might work, it is not a good idea for a number of reasons: streams hold locks on system resources while they are open, so leaving a file open after you have finished with it could prevent other processes from accessing it. If a script deals with a large number of files, the accumulation of the resources used, both in terms of memory and the sheer number of open files, can cause web server requests to fail. Sounds bad, doesn't it? The streams API includes some magic that helps you to keep your code clean - if a stream is not closed by your code when it should be, you will find some helpful debugging information in you web server error log. </para> <note> <simpara> Always use a debug build of PHP when developing an extension (<option>--enable-debug</option> when running configure), as a lot of effort has been made to warn you about memory and stream leaks. </simpara> </note> <para> In some cases, it is useful to keep a stream open for the duration of a request, to act as a log or trace file for example. Writing the code to safely clean up such a stream is not difficult, but it's several lines of code that are not strictly needed. To save yourself the trouble of writing the code, you can mark a stream as being OK for auto cleanup. What this means is that the streams API will not emit a warning when it is time to auto-cleanup a stream. To do this, you can use <function>php_stream_auto_cleanup</function>. </para> </sect1> &internals.streams.common; &internals.streams.dir; &internals.streams.file; &internals.streams.socket; &internals.streams.structs; &internals.streams.constants; </chapter> <!-- 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-ja/internals/streams/file.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/file.xml +++ phpdoc-ja/internals/streams/file.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.file-api"> <title>ã¹ããªã¼ã ãã¡ã¤ã« API ãªãã¡ã¬ã³ã¹</title> <refentry id="streams.php-stream-fopen-from-file"> <refnamediv> <refname>php_stream_fopen_from_file</refname> <refpurpose>ANSI FILE* ãã¹ããªã¼ã ã«å¤æãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_fopen_from_file</methodname> <methodparam><type>FILE *</type><parameter>file</parameter></methodparam> <methodparam><type>char *</type><parameter>mode</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_fopen_from_file</function> ã¯ã <parameter>file</parameter>ã«åºã¥ãã¹ããªã¼ã ãè¿ãã¾ãã <parameter>mode</parameter> ã¯ã<parameter>file</parameter>ããªã¼ãã³ãã éã«ä½¿ç¨ãããã¢ã¼ãã¨åãã§ããå¿ è¦ãããããããªãã¨ã ã¹ããªã¼ã ããã¡ã¤ã«ã®ã¢ã¼ãã¨ç°ãªã£ãå ´åã«ãæ¸ãè¾¼ã¿ãè¡ãã¨ã ããããªçµæãçããå¯è½æ§ãããã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-fopen-tmpfile"> <refnamediv> <refname>php_stream_fopen_tmpfile</refname> <refpurpose>tmpfile()ã§FILE*ããªã¼ãã³ããã¹ããªã¼ã ã«å¤æãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_fopen_tmpfile</methodname> <methodparam><type>void</type><parameter></parameter></methodparam> </methodsynopsis> <para> <function>php_stream_fopen_tmpfile</function> ã¯ãã¢ã¼ã "w+b" ã§éããã ãã³ãã©ãªãã¡ã¤ã«ãå ã«ããã¹ããªã¼ã ãè¿ãã¾ãã ãã³ãã©ãªãã¡ã¤ã«ã¯ãã¹ããªã¼ã ãéããããããããã»ã¹ã®çµäºæã« åé¤ããã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-fopen-temporary-file"> <refnamediv> <refname>php_stream_fopen_temporary_file</refname> <refpurpose> ãã¡ã¤ã«åãçæãããã®ãã¡ã¤ã«ã¸ã®ã¹ããªã¼ã ããªã¼ãã³ãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_fopen_temporary_file</methodname> <methodparam><type>const char *</type><parameter>dir</parameter></methodparam> <methodparam><type>const char *</type><parameter>pfx</parameter></methodparam> <methodparam><type>char **</type><parameter>opened</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_fopen_temporary_file</function> ã¯ã<parameter>dir</parameter> ã§æå®ããããã£ã¬ã¯ããªã«ã<parameter>pfx</parameter> ã§æå®ããã ãã¬ãã£ãã¯ã¹ãæã¤ãã³ãã©ãªãã¡ã¤ã«ãçæãã¾ãã çæããããã¡ã¤ã«å㯠<parameter>opened</parameter> ãã©ã¡ã¼ã¿ã«è¿ããã¾ããã ãã®å¤ã¯ãå¾ã§ <function>efree</function> ã使ã£ã¦éæ¾ããå¿ è¦ãããã¾ãã ã¹ããªã¼ã ã¯çæããããã¡ã¤ã«åã§ã"w+b" ã¢ã¼ãã§éããã¾ãã ãªãããã¡ã¤ã«ã¯èªåçã«ã¯åé¤ããã¾ããã®ã§ãå©ç¨ãçµãã£ããèªåã§åé¤ ãããé©åãªå ´æã«ç§»åãããããªãã¦ã¯ãªãã¾ããã </para> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/dir.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/dir.xml +++ phpdoc-ja/internals/streams/dir.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.dir-api"> <title>ã¹ããªã¼ã ãã£ã¬ã¯ããªAPIãªãã¡ã¬ã³ã¹</title> <para> æ¬ã»ã¯ã·ã§ã³ã«ç¤ºãä¸é£ã®é¢æ°ã¯ããã¼ã«ã«ãã¡ã¤ã«ããã³ãªã¢ã¼ããã¡ã¤ã« (ãã®æ©è½ãã©ããã¼ããµãã¼ãããå ´å!)ã§åä½ãã¾ãã </para> <refentry id="streams.php-stream-opendir"> <refnamediv> <refname>php_stream_opendir</refname> <refpurpose> ãã¡ã¤ã«ã®ãªã¹ããå¾ãããã«ãã£ã¬ã¯ããªããªã¼ãã³ãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_opendir</methodname> <methodparam><type>char *</type><parameter>path</parameter></methodparam> <methodparam><type>php_stream_context *</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_opendir</function> ã¯ã<parameter>path</parameter> ã§ æå®ããããã£ã¬ã¯ããªå ã®ãã¡ã¤ã«ã®ä¸è¦§ãåå¾ããã®ã«ç¨ããã¹ããªã¼ã ãè¿ãã¾ãã ãã®é¢æ°ã®åä½ã¯ãPOSIX ã® <function>opendir</function> 颿°ã¨ã»ã¼åä¸ã§ãã ãã®é¢æ°ã¯ php_stream ãªãã¸ã§ã¯ããè¿ãã¾ããããã®ã¹ããªã¼ã ãªãã¸ã§ã¯ãã«å¯¾ãã¦å ±é API ã®é¢æ°ã使ããã¨ã¯ãå§ãã§ãã¾ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-readdir"> <refnamediv> <refname>php_stream_readdir</refname> <refpurpose> ãªã¼ãã³ãããã£ã¬ã¯ããªããæ¬¡ã®ãã£ã¬ã¯ããªã¨ã³ããªãå¾ã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream_dirent *</type><methodname>php_stream_readdir</methodname> <methodparam><type>php_stream *</type><parameter>dirstream</parameter></methodparam> <methodparam><type>php_stream_dirent *</type><parameter>ent</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_readdir</function> ã¯ã<parameter>dirstream</parameter> ããæ¬¡ã®ãã£ã¬ã¯ããªã¨ã³ããªãèªã¿åºãã<parameter>ent</parameter> ã«æ ¼ç´ãã¾ãã æåããå ´åã®è¿ãå¤ã¯ <parameter>ent</parameter> ã§ã失æããå ´åã® è¿ãå¤ã¯ <type>NULL</type> ã§ãã åãã£ã¬ã¯ããªã¨ã³ããªã«è¿ãããæ å ±ã«é¢ãããã詳細ã«ã¤ãã¦ã¯ã<link linkend="streams.struct-php-stream-dirent">php_stream_dirent</link> ãåç §ãã¦ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-rewinddir"> <refnamediv> <refname>php_stream_rewinddir</refname> <refpurpose>æåã®ã¨ã³ããªã«ãã£ã¬ã¯ããªã¹ããªã¼ã ãæ»ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>int</type><methodname>php_stream_rewinddir</methodname> <methodparam><type>php_stream *</type><parameter>dirstream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_rewinddir</function> ã¯ã æå®ããããã£ã¬ã¯ããªã¹ããªã¼ã ãæåã®ã¨ã³ããªãæãããå·»ãæ»ãã¾ãã æåæã« 0 ãã失ææã« -1 ãè¿ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-closedir"> <refnamediv> <refname>php_stream_closedir</refname> <refpurpose>ãã£ã¬ã¯ããªã¹ããªã¼ã ãéãããªã½ã¼ã¹ãè§£æ¾ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>int</type><methodname>php_stream_closedir</methodname> <methodparam><type>php_stream *</type><parameter>dirstream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_closedir</function> ã¯ããã£ã¬ã¯ããªã¹ããªã¼ã ãéãã ããã«é¢é£ä»ãããããªã½ã¼ã¹ãéæ¾ãã¾ãã æåæã« 0 ãã失ææã« -1 ãè¿ãã¾ãã </para> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/constants.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/constants.xml +++ phpdoc-ja/internals/streams/constants.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.constants"> <title>ã¹ããªã¼ã 宿°</title> <refentry id="streams.options"> <refnamediv> <refname>ã¹ããªã¼ã ããªã¼ãã³ããéã®ãªãã·ã§ã³</refname> <refpurpose>ã¹ããªã¼ã çæé¢æ°ã®å¦çãè¨å®ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <para> ãããã®å¤ã¯ OR æ¼ç®åã使ã£ã¦ä¸ã¤ä»¥ä¸çµã¿åãããã¨ãã§ãã¾ãã <variablelist> <varlistentry> <term> <constant>IGNORE_PATH</constant> </term> <listitem> <simpara> ããã¯ã¹ããªã¼ã ã®ããã©ã«ãã®ãªãã·ã§ã³ã§ããè¦æ±ããããã¡ã¤ã«ã« ã¤ãã¦ãinclude_path ã«åæããããã¹ãæ¤ç´¢ããªãããã«ãã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>USE_PATH</constant> </term> <listitem> <simpara> è¦æ±ããããã¡ã¤ã«ã«ã¤ãã¦ãinclude_path ã§åæããããã¹ãæ¤ç´¢ãã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>IGNORE_URL</constant> </term> <listitem> <simpara> ã¹ããªã¼ã ãéãéã«ãç»é²ããã URL ã©ããã¼ã®åå¨ãç¡è¦ãã¾ãã é URL ã©ããã¼ã«ã¤ãã¦ã¯èæ ®ããããããããã¹ããã³ã¼ããã¾ãã ãã®ãã©ã°ã®éã¯ããã¾ãã; ã¹ããªã¼ã APIã¯ç»é²ããããã¹ã¦ã® ã©ããã¼ãããã©ã«ãã§ä½¿ç¨ãããã¨ãã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>IGNORE_URL_WIN</constant> </term> <listitem> <simpara> Windows ã«ããã¦ã¯ãIGNORE_URL ã¨ç価ã§ãã ä»ã®ã·ã¹ãã ã§ã¯å¹æã¯ããã¾ããã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>ENFORCE_SAFE_MODE</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãéãåã«ãã¹ããªã¼ã ã®èå¾ã®å®è£ ã safe_mode ãã§ãã¯ã ãã¡ã¤ã«ã«å¯¾ãã¦è¡ãããæç¤ºãã¾ãã ãã®ãã©ã°ãçãã¨ãsafe_mode ãã§ãã¯ãè¡ããããPHP ããã»ã¹ã ã¢ã¯ã»ã¹æ¨©ããã¤ãã¹ã¦ã®ãã¡ã¤ã«ã«å¯¾ãã¦ãªã¼ãã³ãå¯è½ã«ãªãã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>REPORT_ERRORS</constant> </term> <listitem> <simpara> ãã®ãã©ã°ãã»ããããã¦ãã¦ããã¡ã¤ã«ã¾ã㯠URL ãéãéã«ä½ããã®ã¨ã©ã¼ã çºçããå ´åã«ãã¹ããªã¼ã API 㯠php_error 颿°ãããªãã®ä»£ããã« å®è¡ãã¾ããããã¯ããã¹ã URL ãã¦ã¼ã¶åããã¹ã¯ã¼ããªã© ã¨ã©ã¼æã«ãã©ã¦ã¶ã«è¡¨ç¤ºãããã¹ãã§ãªãæ å ±ãå«ãã¨ãã« (ãããã»ãã¥ãªãã£ã¼ä¸ã®ãªã¹ã¯ã«ãªããã) æç¨ã§ãã ã¹ããªã¼ã API ãã¨ã©ã¼ãåºãã¨ãã¯ãã¾ãã¦ã¼ã¶åããã¹ã¯ã¼ãã¨ãã£ã æ å ±ããã¹ããåãé¤ããå¾ã§ãã¨ã©ã¼ã¡ãã»ã¼ã¸ãå®å ¨ãªå½¢ã«ãã¦ãã ã¨ã©ã¼ãåºåãã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>STREAM_MUST_SEEK</constant> </term> <listitem> <simpara> ãã®ãã©ã°ã¯ãæ¡å¼µã¢ã¸ã¥ã¼ã«å ã§ãæ¬å½ã«ã¹ããªã¼ã ãã©ã³ãã ã«ã·ã¼ã¯ ããå¿ è¦ãããã¨ãã«æç¨ã§ãã ããã¤ãã®ç¨®é¡ã®ã¹ããªã¼ã ã¯ãã®ã¾ã¾ã®å½¢ã§ã¯ã·ã¼ã¯ãã§ããªããã¨ã ããã®ã§ããã®ãã©ã°ãã»ãããã¦ããã¨ãã¹ããªã¼ã API ã¯ã ã¾ãéãããã¹ããªã¼ã ãã·ã¼ã¯å¯è½ãã©ããã調ã¹ãã·ã¼ã¯ã§ããªãå ´åã¯ã ã¹ããªã¼ã ã®ãã¼ã¿ãã·ã¼ã¯å¯è½ãªä¸æçãªã¹ãã¬ã¼ã¸ (ãã³ãã©ãªãã¡ã¤ã« ãããã¯ã¡ã¢ãªã¼ã¹ããªã¼ã ) ã«ã³ãã¼ãã¾ãã ãã®ãã©ã°ã¯ãã¹ããªã¼ã ã«å¯¾ãã¦ã·ã¼ã¯åä½ãè¡ã£ã¦ããæ¸ãè¾¼ã¿ãè¡ããããª å ´åã«ã¯é©ãã¦ãã¾ãããã¢ã¯ã»ã¹å¯¾è±¡ã®ã¹ããªã¼ã ã¯å½åã¢ã¯ã»ã¹ãè¦æ±ãã ãªã½ã¼ã¹ã«å¿ ãããé¢é£ä»ãããã¦ããã¨ã¯éããªãããã§ãã </simpara> <note> <simpara> ãããè¦æ±ããããªã½ã¼ã¹ããããã¯ã¼ã¯ãã¼ã¹ã§ãã£ãå ´åã ãã®é¢æ°ã¯ããã¹ã¦ã®ãã¼ã¿ãèªã¿è¾¼ã¾ããã¾ã§ãããã¯ãã¾ãã </simpara> </note> </listitem> </varlistentry> <varlistentry> <term> <constant>STREAM_WILL_CAST</constant> </term> <listitem> <simpara> ããããªãã®æ¡å¼µã¢ã¸ã¥ã¼ã«ããµã¼ããã¼ãã£ã®ã©ã¤ãã©ãªãå©ç¨ãã¦ãã¦ã ãã®ã©ã¤ãã©ãªã«ã¯ FILE* ããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã渡ããªãã¦ã¯ ãªããªãã¨ãããã®ãã©ã°ã使ãã¨ãã¹ããªã¼ã API ã«ãªã½ã¼ã¹ã ãªã¼ãã³ãã¦ãããããã¡ãªã³ã°ã¯è¡ããªãããæç¤ºãããã¨ãã§ãã¾ãã ãã®å¾ã<function>php_stream_cast</function> ã使ãããã®ã©ã¤ãã©ãªã® å¿ è¦ã¨ãã FILE* ã ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãåå¾ã§ãã¾ãã </simpara> <simpara> ãã®ãã©ã°ã¯ HTTP URL ã«ã¢ã¯ã»ã¹ããã¨ãã å®éã®ã¹ããªã¼ã ã®ãã¼ã¿ãä¸å®ãªãªãã»ããã®å ããå§ã¾ããããª å ´åã«ããã¦ãç¹ã«æç¨ã§ãã </simpara> <simpara> ãã®ãªãã·ã§ã³ã¯ã¹ããªã¼ã API ã®ã¬ãã«ã§ã®ãããã¡ãªã³ã°ã ç¡å¹ã«ãããããã¹ããªã¼ã 颿°ã®ããã©ã¼ãã³ã¹ãæªããªããã ããã¾ãããããã®ãªãã·ã§ã³ãå©ç¨ããã¨ãããã¨ã¯ãããªãã ã¹ããªã¼ã ã®èå¾ã«ããå®è£ ã«åããããã ã¹ããªã¼ã API 颿°ã使ããã¨ãã¹ããªã¼ã ã«å®£è¨ããã¨ããã㨠ã§ããããããã¯è¨±å®¹ç¯å²å ã¨èãããã¾ãã ãã®ãªãã·ã§ã³ã¯æ¬å½ã«å¿ è¦ã ã¨ç¢ºä¿¡ãããã¨ãã«ã®ã¿ç¨ãã¦ãã ããã </simpara> </listitem> </varlistentry> </variablelist> </para> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/common.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/common.xml +++ phpdoc-ja/internals/streams/common.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.common-api"> <title>ã¹ããªã¼ã å ±éAPIãªãã¡ã¬ã³ã¹</title> <refentry id="streams.php-stream-stat-path"> <refnamediv> <refname>php_stream_stat_path</refname> <refpurpose>ãã¡ã¤ã«ã¾ãã¯URLã®ã¹ãã¼ã¿ã¹ãå¾ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_stat_path</methodname> <methodparam><type>char *</type><parameter>path</parameter></methodparam> <methodparam><type>php_stream_statbuf *</type><parameter>ssb</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_stat_path</function> ã¯ã <parameter>path</parameter>ã§æå®ãããã¡ã¤ã«ã¾ãã¯URLã調ã¹ã ãã¡ã¤ã«ãµã¤ãºãã¢ã¯ã»ã¹æ¨©ãä½ææ¥æã¨ãã£ãæ å ±ãè¿ãã¾ãã è¿ãå¤ã¯æåæã«0ãã¨ã©ã¼æã«-1ã¨ãªãã¾ããè¿ãããæ å ±ã®è©³ç´°ã« ã¤ãã¦ã¯ã <link linkend="streams.struct-php-stream-statbuf">php_stream_statbuf</link> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-stat"> <refnamediv> <refname>php_stream_stat</refname> <refpurpose>ã¹ããªã¼ã ãä¿æããã¹ãã¬ã¼ã¸ã«é¢ããæ å ±ãå¾ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_stat</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>php_stream_statbuf *</type><parameter>ssb</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_stat</function> ã¯ã<parameter>stream</parameter> ã«ãã¤ã³ãããã¦ããã¹ãã¬ã¼ã¸ã«é¢ããæ å ±ã調ã¹ããã¡ã¤ã«ãµã¤ãºã ã¢ã¯ã»ã¹æ¨©ãä½ææ¥æã¨ãã£ãæ å ±ãè¿ãã¾ãã è¿ãå¤ã¯æåæã«0ãã¨ã©ã¼æã«-1ã¨ãªãã¾ããè¿ãããæ å ±ã®è©³ç´°ã« ã¤ãã¦ã¯ã <link linkend="streams.struct-php-stream-statbuf">php_stream_statbuf</link> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-open-wrapper"> <refnamediv> <refname>php_stream_open_wrapper</refname> <refpurpose>ãã¡ã¤ã«ã¾ãã¯URLããªã¼ãã³ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>php_stream *</type><methodname>php_stream_open_wrapper</methodname> <methodparam><type>char *</type><parameter>path</parameter></methodparam> <methodparam><type>char *</type><parameter>mode</parameter></methodparam> <methodparam><type>int</type><parameter>options</parameter></methodparam> <methodparam><type>char **</type><parameter>opened</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_open_wrapper</function> 㯠<parameter>path</parameter> ã§æå®ããããã¡ã¤ã«ãURLãªã©ã®ã©ããããããªã½ã¼ã¹ã®ã¹ããªã¼ã ãéãã¾ãã <parameter>mode</parameter> ã«ãã£ã¦ãã¹ããªã¼ã ãèªã¿åºãç¨ãæ¸ãåºãç¨ã 追è¨ç¨ããããã¯ãã®çµã¿åããã§éããã¨ãã§ãã¾ããæå®ã§ãã種ã ã®ã¢ã¼ã ã«ã¤ãã¦ã¯ä¸è¨ã®è¡¨ãã覧ãã ããããããã®æååã«å ããæå 'b' ã ã¢ã¼ãæååã®2æåç®ãã¾ãã¯æ«å°¾ã«å«ãããã¨ãã§ãã¾ãã ãã®æå 'b' ã¯ã該å½ããã¹ããªã¼ã ã®å®è£ ã«å¯¾ãããã¤ããªã»ã¼ããªã¢ã¼ãã§ ã¹ããªã¼ã ãéãããæç¤ºãã¾ãã </para> <para> æå 'b' ã¯ããã¹ã¦ã® POSIX ã«æºæ ããã·ã¹ãã ä¸ã§ã¯ããã¤ããªãã¡ã¤ã«ã¨ ããã¹ããã¡ã¤ã«ãååã«æ±ããããããç¡è¦ããã¾ããã¢ã¯ã»ã¹ãããã¼ã¿ ã«ããã¦ã8 ããããã¹ã¦ãéè¦ãªéã«ã¯ããã® 'b' æåãæå®ãã¦ããã®ã¯ã 'b' ãã©ã°ãæå³ãæã¤ã·ã¹ãã ã§ãåãã¹ã¯ãªãããåãããã®ã§ã ããã¢ã¤ãã£ã¢ã¨ããã¾ãã </para> <para> ã¹ããªã¼ã API ã«ãã£ã¦ä½æããããã¹ã¦ã®ãã¼ã«ã«ã«ãããã¡ã¤ã«ã® ãã¼ããã·ã§ã³ã¯ããªãã¬ã¼ãã£ã³ã°ã·ã¹ãã ã®ããã©ã«ãã«å¾ã£ã¦ è¨å®ããã¾ã - Unix ãã¼ã¹ã®ã·ã¹ãã ã§ã¯ããã¡ã¤ã«ã使ããããã»ã¹ã® umask ãåæ ããã¾ããã¾ããWindows ã§ã¯ããã¡ã¤ã«ã使ããããã»ã¹ã ãã¡ã¤ã«ãææãã¾ãã ãªã¢ã¼ãã«ãããã¡ã¤ã«ã«ã¤ãã¦ã¯ããã¡ã¤ã«ãéãã®ã«ç¨ãã URL ã©ããã¼ ã®è¨å®ãããªã¢ã¼ãã®ãµã¼ãã«ä¸ããããä¿¡é ¼æ å ±ã«å¿ãã¦ä½æããã¾ãã </para> <para> <variablelist> <varlistentry> <term> <constant>r</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãèªã¿åºãç¨ã«éãã¾ãããã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ã ãã¡ã¤ã«ã®å é ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>r+</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãèªã¿æ¸ãç¨ã«éãã¾ãããã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ã ãã¡ã¤ã«ã®å é ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>w</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ã®å 容ãé·ã 0 ã«åãè©°ããããæ°è¦ã«ãã¡ã¤ã«ã使ãã æ¸ãåºãã¢ã¼ãã§éãã¾ãããã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ã ãã¡ã¤ã«ã®å é ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>w+</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãèªã¿æ¸ãç¨ã«éãã¾ããããæå®ããããã¡ã¤ã«ãåå¨ ããªãå ´åã¯ãæ°è¦ã«ä½æããåå¨ããå ´åã¯ãé·ããåãè©°ãã¾ãã ãã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ããã¡ã¤ã«ã®å é ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>a</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãæ¸ãåºãç¨ã«éãã¾ãããããã¡ã¤ã«ãåå¨ããªãå ´åã¯ã æ°è¦ã«ä½æãã¾ãããã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ããã¡ã¤ã«ã® æ«å°¾ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>a+</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãèªã¿æ¸ãç¨ã«éãã¾ããããæå®ããããã¡ã¤ã«ãåå¨ ããªãå ´åã¯ãæ°è¦ã«ä½æãã¾ãããã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ã ãã¡ã¤ã«ã®æ«å°¾ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> </variablelist> </para> <para> <parameter>options</parameter> ã¯ãã¹ããªã¼ã ã¸ã®ãã¹ã URL ãã©ã®ããã« è§£éãããããã»ã¼ãã¢ã¼ããã§ãã¯ãã¹ããªã¼ã ãéãã¨ãã«ã¨ã©ã¼ã çºçããå ´åã®ã¢ã¯ã·ã§ã³ã«å½±é¿ãã¾ãããã®ãªãã·ã§ã³ã«é¢ãã¦ã¯ã <link linkend="streams.options">Stream open options</link> ãåç §ãã ããã </para> <para> ãã <parameter>opened</parameter> ã NULL ã§ãªããã°ãå®éã« éããããã¡ã¤ã«ããªã½ã¼ã¹ã®ååãã»ããããã¾ããããã¯ã ãªãã·ã§ã³ã« include_path ã«åæããããã¹ãããã¡ã¤ã«ãæ¢ãããæç¤ºãã <constant>USE_PATH</constant> ãå«ã¾ãã¦ããæã«éè¦ã«ãªãã¾ãã å¼ã³åºãå ã¯ãæå¾ã«ãã®ãã©ã¡ã¼ã¿ã«ãã£ã¦è¿ããããã¡ã¤ã«åã <function>efree</function> ã®å¼ã³åºãã«ãã£ã¦éæ¾ããå¿ è¦ãããã¾ãã </para> <note> <simpara> ããã<constant>STREAM_MUST_SEEK</constant> ã <parameter>options</parameter> ã«æå®ããå ´åã<parameter>opened</parameter> ã«è¿ããããã¡ã¤ã«ã¸ã®ãã¹ ã¯ãå®éã«è¿ãããã¹ããªã¼ã ã®ãã®ã¨éãå ´åãããã¾ãããããããã㯠ã·ã¼ã¯å¯è½ãªã¹ããªã¼ã ãä½ãã®ã«ç¨ããããå ã®ã¹ããªã¼ã ã®ååã«ãªãã¾ãã </simpara> </note> </refsect1> </refentry> <refentry id="streams.php-stream-read"> <refnamediv> <refname>php_stream_read</refname> <refpurpose>ã¹ããªã¼ã ãããããã¡ã«æå®ãã¤ãæ°èªã¿è¾¼ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>size_t</type><methodname>php_stream_read</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>char *</type><parameter>buf</parameter></methodparam> <methodparam><type>size_t</type><parameter>count</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_read</function> 㯠<parameter>count</parameter> ãã¤ãã§æå®ããããã¤ãæ°ã¾ã§ <parameter>stream</parameter> ãã ãã¼ã¿ãèªã¿åãããããã¡ <parameter>buf</parameter> ã«ã³ãã¼ãã¾ãã </para> <para> <function>php_stream_read</function> ã¯ãæ£å¸¸ã«èªã¿è¾¼ããã¨ã®ã§ãã ãã¤ãæ°ãè¿ãã¾ããèªã¿è¾¼ã¿ã失æããã®ãããã¡ã¤ã«ã®çµç«¯ã«éããã®ã ããããç¥ããã¨ã¯ã§ãã¾ããã®ã§ã<function>php_stream_eof</function> ãã<constant>EOF</constant> æ¡ä»¶ã®ãã¹ãã«ä½¿ãã¾ãã </para> <para> ã¹ããªã¼ã ã®å é¨ä½ç½®ã¯ã次å以éç¶ãããèªããããã èªã¿è¾¼ã¾ããåã ãé²ãããã¾ãã </para> <para> ããã<parameter>count</parameter> ãã¤ããããå°ãªããã¼ã¿ããæã£ã¦ ããªãå ´åããã®é¢æ°ã¯ãã¹ããªã¼ã ã®ãããã¯ã¢ã¼ãã®è¨å®ã«å¿ãã¦ã ãã¹ã¦ã®ãã¼ã¿ãæãã¾ã§ãããã¯ãã¾ã(å¾ ã¡ã¾ã)ãããã©ã«ãã§ã¯ã ã¹ããªã¼ã ã¯ãããã¯ã¢ã¼ãã§éããã¾ãã ããé常ã®ãã¡ã¤ã«ããèªã¿è¾¼ãå ´åã¯ããããã¯ã¢ã¼ãã¯ãã¾ãæå³ã æã¡ã¾ãããã¹ããªã¼ã ãã<constant>EOF</constant> ã«éããå ´åã¯ã <function>php_stream_read</function> ã¯ã<parameter>count</parameter> ãããå°ãªãå¤ãè¿ããæ¬¡å以éã¯ã0 ãè¿ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-write"> <refnamediv> <refname>php_stream_write</refname> <refpurpose>ãããã¡ããã¹ããªã¼ã ã«æå®ãã¤ãæ°æ¸ãè¾¼ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>size_t</type><methodname>php_stream_write</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>const char *</type><parameter>buf</parameter></methodparam> <methodparam><type>size_t</type><parameter>count</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_write</function> ã¯ã<parameter>count</parameter> ãã¤ãã®ãã¼ã¿ã <parameter>buf</parameter> ãã <parameter>stream</parameter> ã«æ¸ãåºãã¾ãã </para> <para> <function>php_stream_write</function> ã¯æ£å¸¸ã«æ¸ãè¾¼ããã¨ã®ã§ãã ãã¤ãæ°ãè¿ãã¾ãããããä½ããã®ã¨ã©ã¼ããã£ãå ´åã¯ã æ¸ãè¾¼ããã¨ã®ã§ãããã¤ãæ°ã¯ <parameter>count</parameter> ããã å°ãããªãã¾ãã </para> <para> ã¹ããªã¼ã ã®å é¨ä½ç½®ã¯ã次å以éç¶ãããæ¸ãè¾¼ããããã èªã¿è¾¼ã¾ããåã ãé²ãããã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-eof"> <refnamediv> <refname>php_stream_eof</refname> <refpurpose>ã¹ããªã¼ã ããã¡ã¤ã«çµç«¯ã«éãããã©ãã調ã¹ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_eof</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_eof</function> ã¯ã<parameter>stream</parameter> ãã ãã¡ã¤ã«ã®çµç«¯ã«éãããã©ããã調ã¹ã¾ãã </para> <para> <function>php_stream_eof</function> ã 1 ãè¿ãã¨ãããã¨ã¯ã <constant>EOF</constant> ã«éãããã¨ãæå³ãã¾ãã0 ãªãã°ã ã¾ã <constant>EOF</constant> ã§ãªãã-1 ã¯ã¨ã©ã¼ãæå³ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-getc"> <refnamediv> <refname>php_stream_getc</refname> <refpurpose>ã¹ããªã¼ã ãã1ãã¤ãèªã¿è¾¼ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_getc</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_getc</function> 㯠<parameter>stream</parameter> ãã 1 æåèªã¿è¾¼ã¿ãunsigned char ã int ã¨ãã¦ãã£ã¹ããã形㧠è¿ãã¾ãã ãã¡ã¤ã«ã®çµç«¯ã«éããããã¨ã©ã¼ãçºçããå ´åã¯ã <constant>EOF</constant> ãè¿ãã¾ãã </para> <para> <function>php_stream_getc</function> ã®ãããã¯ã«é¢ããæåã¯ã <function>php_stream_read</function> ã®ãã®ã¨ä¸ç·ã§ãã </para> <para> æ£å¸¸ã«å®è¡ã§ããå ´åãã¹ããªã¼ã ã®å é¨ä½ç½®ã¯ 1 ã ãé²ãããã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-gets"> <refnamediv> <refname>php_stream_gets</refname> <refpurpose>ã¹ããªã¼ã ãããããã¡ã«1è¡åã®ãã¼ã¿ãèªã¿è¾¼ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>char *</type><methodname>php_stream_gets</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>char *</type><parameter>buf</parameter></methodparam> <methodparam><type>size_t</type><parameter>maxlen</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_gets</function> ã¯ãæå¤§ã§ <parameter>count</parameter>-1 ãã¤ãã¾ã§ã®ãã¼ã¿ã <parameter>stream</parameter> ããèªã¿è¾¼ã¿ã ãããã¡ <parameter>buf</parameter> ã«ã³ãã¼ãã¾ããèªã¿è¾¼ã¿ã¯ã <constant>EOF</constant> ãããã¯è¡æ«è¨å·ã«å°éããæç¹ã§ã¹ããããã¾ãã ãããè¡æ«ã¾ã§èªã¿è¾¼ã¾ããå ´åãè¡æ«è¨å·ã¯ã<parameter>buf</parameter> ã®ä¸é¨ã¨ãã¦å«ã¾ãã¾ããNUL çµç«¯æåãããããã¡ã®æ«å°¾ã«ä»å ããã¾ãã </para> <para> <function>php_stream_read</function> ã¯æ£å¸¸ã«çµäºããã¨ã<parameter>buf</parameter> ãããã®ä»ã®å ´å㯠NULL ãè¿ãã¾ãã </para> <para> ã¹ããªã¼ã ã®å é¨ä½ç½®ã¯ã次å以éç¶ãããèªããããã èªã¿è¾¼ã¾ããåã ãé²ãããã¾ãã </para> <para> ãã®é¢æ°ã®ãããã¯ã«é¢ããæåã¯ã<function>php_stream_read</function> ã®ãã®ã¨ä¸ç·ã§ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-close"> <refnamediv> <refname>php_stream_close</refname> <refpurpose>ã¹ããªã¼ã ãéãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_close</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_close</function> ã¯ã<parameter>stream</parameter> ã å®å ¨ã«ã¯ãã¼ãºããããã«é¢é£ä»ãããããªã½ã¼ã¹ãåæã«éæ¾ãã¾ãã 䏿¦ <parameter>stream</parameter> ãéããã¨ããã®å¤ã¯ä¸å®ã«ãªãã¾ãã åã³å©ç¨ãã¦ã¯ããã¾ããã </para> <para> <function>php_stream_close</function> ã¯æ£å¸¸ã«ã¹ããªã¼ã ãéãããã å ´åã0 ããã¨ã©ã¼ãçºçããå ´åã«ã¯ã<constant>EOF</constant> ãè¿ãã¾ãã颿°ã®å®è¡ã®æå¦ã«ãããããã<parameter>stream</parameter> ã¯ä¸å®ã«ãªãã¾ãã®ã§ããã®é¢æ°ã®å®è¡å¾ã«å©ç¨ãã¦ã¯ããã¾ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-flush"> <refnamediv> <refname>php_stream_flush</refname> <refpurpose>ã¹ããªã¼ã ãããã¡ãã¹ãã¬ã¼ã¸ã«ãã©ãã·ã¥ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_flush</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_flush</function> ã¯ã<parameter>stream</parameter> ã®æ¸ãè¾¼ã¿ãããã¡ã«ä¿æããããã¼ã¿ãä¸å±¤ã«ããã¹ãã¬ã¼ã¸ã« ã³ããããã¾ãã </para> <para> <function>php_stream_flush</function> ã¯ããããã¡ããã©ãã·ã¥ã§ããå ´åã« ãããã¯ããããã¡ããã©ãã·ã¥ããå¿ è¦ããªãã£ãå ´åã«ã0 ãè¿ãã¾ãã ã¨ã©ã¼ãçºçããå ´åã¯ã<constant>EOF</constant> ãè¿ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-seek"> <refnamediv> <refname>php_stream_seek</refname> <refpurpose>ã¹ããªã¼ã å ã§ç§»åãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_seek</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>off_t</type><parameter>offset</parameter></methodparam> <methodparam><type>int</type><parameter>whence</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_seek</function> 㯠<parameter>stream</parameter> ã®å é¨ä½ç½®ãç§»åãã¾ãã æ°ããä½ç½®ã¯ã<parameter>offset</parameter> ã®å¤ãã <parameter>whence</parameter> ã§ç¤ºãããä½ç½®ã«å ç®ãããã¨ã§æ±ºå®ããã¾ãã <parameter>whence</parameter> ã <constant>SEEK_SET</constant> ã«ã»ãã ããã¦ããå ´åã¯ãã¹ããªã¼ã ã®éå§ä½ç½®ãã<constant>SEEK_CUR</constant> ã®å ´åã¯ãã¹ããªã¼ã ã®ç¾å¨ä½ç½®ãã<constant>SEEK_END</constant> ã®å ´åã¯ã ã¹ããªã¼ã ã®çµç«¯ä½ç½®ããããããè¨ç®ã®åºæºã¨ãã¾ãã </para> <para> <function>php_stream_seek</function> ã¯æåæã« 0 ãã失ææã« -1 ã è¿ãã¾ãã </para> <note> <para> ãã¹ã¦ã®ç¨®é¡ã®ã¹ããªã¼ã ãã·ã¼ã¯åä½ããµãã¼ããã¦ããããã§ã¯ ããã¾ããããã¹ããªã¼ã API ã¯ã<parameter>whence</parameter> <constant>SEEK_CUR</constant> ã«è¨å®ããã¦ãã¦ãã㤠<parameter>offset</parameter> ãæ£ã®å¤ã®å ´åã <function>php_stream_read</function> ã§ <parameter>offset</parameter> ãã¤ãåã ãèªã¿è¾¼ãã§ãèªã¿è¾¼ã¾ããå 容ãç ´æ£ãããã¨ã§ãã·ã¼ã¯ã ã¨ãã¥ã¬ã¼ããããã¨ãã¾ãã </para> <para> ã¨ãã¥ã¬ã¼ã·ã§ã³ã¯ãä¸å±¤ã«ããã¹ããªã¼ã ã®å®è£ ããã·ã¼ã¯ããµãã¼ã ãã¦ããªãã¨ãã®ã¿ã«è¡ããã¾ããã¤ã¾ããä»®ã«éããã¦ããã¹ããªã¼ã ã ãã¡ã¤ã«ãã¼ã¹ã®ã¹ããªã¼ã ã§ããããã·ã¼ã¯ã§ããªããã¤ãã ã©ãããã¦ããã¨ãã¦ããã¹ããªã¼ã API ã¯ã¨ãã¥ã¬ã¼ã·ã§ã³ãè¡ãã¾ããã ãã¡ã¤ã«ãã¼ã¹ã®ã¹ããªã¼ã ã¯ã·ã¼ã¯åä½ãå®è£ ãã¦ããããã§ãã ãã®ã¨ããã·ã¼ã¯ã¯å¤±æããã¨ã©ã¼ãå¼ã³åºãå ã«è¿ããã¾ãã </para> </note> </refsect1> </refentry> <refentry id="streams.php-stream-tell"> <refnamediv> <refname>php_stream_tell</refname> <refpurpose>ã¹ããªã¼ã å ã®ä½ç½®ã調ã¹ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>off_t</type><methodname>php_stream_tell</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_tell</function> ã¯ã<parameter>stream</parameter> ã® å é¨ä½ç½®ãã¹ããªã¼ã ã®éå§ä½ç½®ããã®ç¸å¯¾å¤ã§è¿ãã¾ãã ã¨ã©ã¼ãçºçããå ´å㯠-1 ãè¿ããã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-copy-to-stream"> <refnamediv> <refname>php_stream_copy_to_stream</refname> <refpurpose> ããã¹ããªã¼ã ããå¥ã®ã¹ããªã¼ã ã¸ãã¼ã¿ãã³ãã¼ãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>size_t</type><methodname>php_stream_copy_to_stream</methodname> <methodparam><type>php_stream *</type><parameter>src</parameter></methodparam> <methodparam><type>php_stream *</type><parameter>dest</parameter></methodparam> <methodparam><type>size_t</type><parameter>maxlen</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_copy_to_stream</function> ã¯ãæå¤§ <parameter>maxlen</parameter> ãã¤ãã®ãã¼ã¿ã <parameter>src</parameter> ããèªã¿è¾¼ã¿ã <parameter>dest</parameter> ã«æ¸ãåºããã®ã¡ãæ£å¸¸ã«ã³ãã¼ã§ãã ãã¤ãæ°ãè¿ãã¾ãã </para> <para> <parameter>src</parameter> ã¹ããªã¼ã ã«ããæ®ãã®(å é¨ä½ç½®ç§»è¡ã«ãã) ãã¼ã¿ãã¹ã¦ãã³ãã¼ãããå ´åã¯ã 宿° <constant>PHP_STREAM_COPY_ALL</constant> ãã <parameter>maxlen</parameter> ã«æå®ãã¦ãã ããã </para> <note> <simpara> ãã®é¢æ°ã¯ããã¼ã¿ããã¡ã¢ãªããããã§ããã°ããã使ãã æå¤§éå¹ççãªæ¹æ³ã§ã³ãã¼ãè¡ããã¨ãã¾ãã </simpara> </note> </refsect1> </refentry> <refentry id="streams.php-stream-copy-to-mem"> <refnamediv> <refname>php_stream_copy_to_mem</refname> <refpurpose> ã¹ããªã¼ã ãã確ä¿ããããããã¡ã«ãã¼ã¿ãã³ãã¼ãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>size_t</type><methodname>php_stream_copy_to_mem</methodname> <methodparam><type>php_stream *</type><parameter>src</parameter></methodparam> <methodparam><type>char **</type><parameter>buf</parameter></methodparam> <methodparam><type>size_t</type><parameter>maxlen</parameter></methodparam> <methodparam><type>int</type><parameter>persistent</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_copy_to_mem</function> 㯠<parameter>maxlen</parameter>+1 ãã¤ãã®ãããã¡ã <function>pemalloc</function> (ãã©ã¡ã¼ã¿ <parameter>persistent</parameter> ã¯ãã®ã¾ã¾æ¸¡ããã¾ã) ã使ã£ã¦ãããã¡ã確ä¿ããã®ã¡ãæå¤§ <parameter>maxlen</parameter> ãã¤ãã <parameter>src</parameter> ããèªã¿è¾¼ãã§ããã®å 容ã確ä¿ããããããã¡ã« æ ¼ç´ãã¾ãã </para> <para> 確ä¿ããããããã¡ã <parameter>buf</parameter> ã§ç¤ºããããã¤ã³ã¿ã« è¿ããã®ã¡ãæ£å¸¸ã«èªã¿è¾¼ãããã¤ãæ°ãè¿ãã¾ãã å¼ã³åºãä¸ã¯ãè¿ããããããã¡ããåã <parameter>persistent</parameter> ãã©ã¡ã¼ã¿ã¨ã¨ãã« <function>pefree</function> ã§éæ¾ããå¿ è¦ãããã¾ãã </para> <para> <parameter>src</parameter> ã¹ããªã¼ã ã«ããæ®ãã®(å é¨ä½ç½®ç§»è¡ã«ãã) ãã¼ã¿ãã¹ã¦ãã³ãã¼ãããå ´åã¯ã 宿° <constant>PHP_STREAM_COPY_ALL</constant> ãã <parameter>maxlen</parameter> ã«æå®ãã¦ãã ããã </para> <note> <simpara> ãã®é¢æ°ã¯ããã¼ã¿ããã¡ã¢ãªããããã§ããã°ããã使ãã æå¤§éå¹ççãªæ¹æ³ã§ã³ãã¼ãè¡ããã¨ãã¾ãã </simpara> </note> </refsect1> </refentry> <refentry id="streams.php-stream-make-seekable"> <refnamediv> <refname>php_stream_make_seekable</refname> <refpurpose>ã¹ããªã¼ã ãã·ã¼ã¯å¯è½ãªã¹ããªã¼ã ã¸å¤æãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_make_seekable</methodname> <methodparam><type>php_stream *</type><parameter>origstream</parameter></methodparam> <methodparam><type>php_stream **</type><parameter>newstream</parameter></methodparam> <methodparam><type>int</type><parameter>flags</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_make_seekable</function> ã¯ãã¾ã <parameter>origstream</parameter> ã ã·ã¼ã¯å¯è½ãã©ãã調ã¹ã¾ããããã·ã¼ã¯ã§ããªãå ´åã¯ãæ°ãã«ä¸æçã¹ããªã¼ã ãä½ããå ã®ã¹ããªã¼ã ã®ãã¼ã¿ããã¹ã¦ããã«ã³ãã¼ãã¾ãã æåã®å ´åã¯ã<parameter>newstream</parameter> ã«ã¯ãå ã®ã¹ããªã¼ã ã ã·ã¼ã¯å¯è½ã ã£ãã¨ãã¦ãã常ã«å©ç¨å¯è½ãªã¹ããªã¼ã ãè¿ããã¾ãã </para> <para> <parameter>flags</parameter> ã§ãã©ã®ãããªå½¢ã®ã·ã¼ã¯å¯è½ãªã¹ããªã¼ã ã è¿ãããããæå®ãããã¨ãã§ãã¾ããããã©ã«ãã®ã·ã¼ã¯å¯è½ãªã¹ããªã¼ã ã å©ç¨ãããå ´åã¯ã<constant>PHP_STREAM_NO_PREFERENCE</constant> ã (é常ã§ã¯åçã«å¢å¤§ããã¡ã¢ãªä¸ã®ãããã¡ãå©ç¨ãããã ããã¹ããªã¼ã å ã®ãã¼ã¿ã巨大ãªå ´åã¯ããã³ãã©ãªãã¡ã¤ã«ã«è£æã¡ããã ã¹ããªã¼ã ã«åãæ¿ãã)ãã¾ãã¯é常ã®ãã³ãã©ãªãã¡ã¤ã«ã«è£æã¡ããã ã¹ããªã¼ã ãå©ç¨ãããå ´åã¯ã<constant>PHP_STREAM_PREFER_STDIO</constant> ãæå®ãã¦ãã ããã </para> <para> <table> <title><function>php_stream_make_seekable</function> ã®è¿ãå¤</title> <tgroup cols="2"> <thead> <row> <entry>Value</entry> <entry>Meaning</entry> </row> </thead> <tbody> <row> <entry>PHP_STREAM_UNCHANGED</entry> <entry>å ã®ã¹ããªã¼ã ãã·ã¼ã¯å¯è½ã ã£ãã<parameter>newstream</parameter> ã«ã¯ <parameter>origstream</parameter> ãã»ããããã¾ãã </entry> </row> <row> <entry>PHP_STREAM_RELEASED</entry> <entry>å ã®ã¹ããªã¼ã ã¯ã·ã¼ã¯å¯è½ã§ã¯ãªãã®ã§ãéæ¾ãããã <parameter>newstream</parameter> ã«ã¯ãæ°ãã«ä½æãããã·ã¼ã¯å¯è½ãªã¹ããªã¼ã ãã»ããããã¾ãã 以å¾ã<parameter>origstream</parameter> ã«ã¢ã¯ã»ã¹ãã¦ã¯ããã¾ããã </entry> </row> <row> <entry>PHP_STREAM_FAILED</entry> <entry>ã¹ããªã¼ã ã®å¤æä¸ã«ã¨ã©ã¼ãçºçããã <parameter>newstream</parameter> ã«ã¯ NULL ãã»ããããã¾ãã ãã®ã¨ã <parameter>origstream</parameter> ã¯ã¾ã æå¹ãªã¹ããªã¼ã ã§ãã </entry> </row> <row> <entry>PHP_STREAM_CRITICAL</entry> <entry>ã¹ããªã¼ã ã®å¤æä¸ã«ã¨ã©ã¼ãçºçããå ã®ã¹ããªã¼ã 㯠<parameter>origstream</parameter> ä¸å®ãªç¶æ ã«ãªã£ã¦ããã<parameter>newstream</parameter> ã«ã¯ NULL ãã»ããããã¾ãããã®ã¨ãã¯ã<parameter>origstream</parameter> ãéãããã¨ãå¼·ãæ¨å¥¨ãã¾ãã </entry> </row> </tbody> </tgroup> </table> </para> <note> <simpara> æ°ããã¹ããªã¼ã ã«å¯¾ãã¦ã·ã¼ã¯ãè¡ãæ¸ãè¾¼ã¿ãè¡ããããªå ´åã ãã®ã¹ããªã¼ã ã¯ãå¿ ãããå ã®ã¹ããªã¼ã ã¨åããªã½ã¼ã¹ã« é¢é£ä»ãããã¦ããã¨ä¿è¨¼ããã¦ããããã§ã¯ãªãã®ã§ã ãã®é¢æ°ãå¼ã³åºãæå³ã¯ãã¾ãããã¾ããã </simpara> </note> <note> <simpara> ãããåæ¹ã¸ã®ã·ã¼ã¯ã®ã¿ãå¿ è¦ãªã¨ãã¯ããã®é¢æ°ãå©ç¨ãã¦ã¹ããªã¼ã ã ã·ã¼ã¯å¯è½ã«ããå¿ è¦ã¯ããã¾ãããã¹ããªã¼ã API ã¯ã whence ãã©ã¡ã¼ã¿ã <constant>SEEK_CUR</constant> ã®æãåæ¹ã·ã¼ã¯ã ã¨ãã¥ã¬ã¼ãããããã§ãã </simpara> </note> <note> <simpara> ããã<parameter>origstream</parameter> ããããã¯ã¼ã¯ãã¼ã¹ã®ã¹ããªã¼ã ã®å ´åã¯ããã®é¢æ°ã¯ããã¹ã¦ã®ãã¼ã¿ãèªã¿è¾¼ã¾ããã¾ã§ãããã¯ãã¾ãã </simpara> </note> <note> <simpara> 絶対ã«ãPHP ã¹ã¯ãªããå ã§ä½¿ç¨ããã¦ãããã¡ã¤ã«ãã¤ã³ã¿ãåç §ãã ã¹ããªã¼ã ãã<parameter>origstream</parameter> ã«æå®ããªãã§ãã ããã ãã®é¢æ°ã¯ããã®ã¹ããªã¼ã ãéããå ´åãããã®ã§ãã¹ã¯ãªããå ã§æ¬¡ã« ãã®ãã¡ã¤ã«ãã¤ã³ã¿ã«å¯¾ãã¦ã¢ã¯ã»ã¹ãè¡ãããå ´åã«ãã¯ã©ãã·ã¥ã èµ·ããå¯è½æ§ãããã¾ãã </simpara> </note> <note> <simpara> ã»ã¨ãã©ã®å ´åã«ããã¦ããã®é¢æ°ã¯ã<parameter>origstream</parameter> ãæ°ãã«éãããã¹ããªã¼ã ã§ããããã¹ããªã¼ã 層ã«ããã¦ãã¼ã¿ã ãããã¡ãªã³ã°ããã¦ããªãæã«ã®ã¿æåãã¾ããããã«ããã ã¾ãããã®é¢æ°ã¯æ£ãã使ãã«ã¯å¤å°è¤éãªã®ã§ãã§ããã°ã ãã®é¢æ°ãç´æ¥å¼ã³åºãã®ã§ã¯ãªãã <function>php_stream_open_wrapper</function> ã使ãã <constant>PHP_STREAM_MUST_SEEK</constant> ããªãã·ã§ã³ã¨ãã¦æ¸¡ãæ¹æ³ ãæ¤è¨ãã¦ã¿ã¦ãã ããã </simpara> </note> </refsect1> </refentry> <refentry id="streams.php-stream-cast"> <refnamediv> <refname>php_stream_cast</refname> <refpurpose> ã¹ããªã¼ã ãFILE*ã¾ãã¯ã½ã±ããã®ãããªä»ã®å½¢å¼ã«å¤æãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_cast</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>int</type><parameter>castas</parameter></methodparam> <methodparam><type>void **</type><parameter>ret</parameter></methodparam> <methodparam><type>int</type><parameter>flags</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_cast</function> 㯠<parameter>stream</parameter> ã§ æå®ãããã¹ããªã¼ã ã <parameter>castas</parameter> ã§æç¤ºããããªã½ã¼ã¹ã« 夿ãããã¨è©¦ã¿ã¾ãã ããã<parameter>ret</parameter> ã NULL ã§ãã£ãå ´åã¯ãå®éã« å¤æã¯è¡ããããåã«ã¹ããªã¼ã ã«å¯¾ãã¦ãã®ãããªå¤æãå¯è½ã§ãããã©ãã ã ãã調ã¹ã¾ãã(ãããããã®å ´åä½ããã®ã¹ããªã¼ã ã®ç¶æ ãå¤åãããã¨ã ããã¾ãã) ããã<parameter>flags</parameter> ã« <constant>REPORT_ERRORS</constant> ã ã»ããããã¦ããå ´åã¯ã夿ä¸ã«ã¨ã©ã¼ãããã¨ãã¨ã©ã¼ã¡ãã»ã¼ã¸ã 表示ããã¾ãã </para> <note> <para> ãã®é¢æ°ã¯ãæåæã« <constant>SUCCESS</constant> ãã失ææã« <constant>FAILURE</constant> ãè¿ãã¾ãã è¿ãå¤ã®å¤å®ã®éã¯åç´ã«å¤ã®çå½ãè¦ãã®ã§ã¯ãªãã 宿° <constant>SUCCESS</constant> ã <constant>FAILURE</constant> 㨠æç¤ºçã«æ¯è¼ããªããã°ãªããªããã¨ã«æ³¨æãã¦ãã ããã ãããã®å®æ°å¤ã¯åç´ãªãã¼ã«å¤ã§ã¯ãªãããã§ãã </para> </note> <para> <table> <title><parameter>castas</parameter> ã«æå®ã§ãããªã½ã¼ã¹ã®ç¨®é¡</title> <tgroup cols="2"> <thead> <row> <entry>å¤</entry> <entry>æå³</entry> </row> </thead> <tbody> <row> <entry>PHP_STREAM_AS_STDIO</entry> <entry>ã¹ããªã¼ã ã表ã ANSI FILE* ãã¡ã¤ã«ãã¤ã³ã¿ãè¦æ±ãã</entry> </row> <row> <entry>PHP_STREAM_AS_FD</entry> <entry>ã¹ããªã¼ã ã表ã POSIX ãã¡ã¤ã«ãã¹ã¯ãªãã¿ãè¦æ±ãã</entry> </row> <row> <entry>PHP_STREAM_AS_SOCKETD</entry> <entry>ã¹ããªã¼ã ã表ãã½ã±ããã®ãã¹ã¯ãªãã¿ãè¦æ±ãã</entry> </row> </tbody> </tgroup> </table> </para> <para> ä¸ã«ç¤ºãããããªåºæ¬çãªãªã½ã¼ã¹ã®ç¨®é¡ãæå®ããã®ã«å ãã 夿åä½ãããªã½ã¼ã¹ã®ç¨®é¡ã表ãå¤ã¨æ¬¡ã«ç¤ºããå¤ã¨ã OR æ¼ç®åã§ çµã¿åããããã¨ã§ãã¦ããããã¨ãã§ãã¾ã: <table> <title>Resource types for <parameter>castas</parameter></title> <tgroup cols="2"> <thead> <row> <entry>å¤</entry> <entry>æå³</entry> </row> </thead> <tbody> <row> <entry>PHP_STREAM_CAST_TRY_HARD</entry> <entry>å¥ã®ãªã½ã¼ã¹ãããã¦å©ç¨ãããªã©ãã§ããã ã夿ãæåãããããªè©¦è¡ãè¡ã</entry> </row> <row> <entry>PHP_STREAM_CAST_RELEASE</entry> <entry>ã¹ããªã¼ã API ã«ããã®é¢æ°ãå¼ã³åºãã ã¹ããªã¼ã API 以å¤ã®ã³ã¼ã (ããããã¯ãµã¼ããã¼ãã£ã®ã©ã¤ãã©ãª) ã®å é¨ã§ãã¹ããªã¼ã ãã©ãããã¦ãããªã½ã¼ã¹ããã³ãã«ãéãããã¨ã éç¥ãã¾ããããã«ããã<parameter>stream</parameter> ãã ã¹ããªã¼ã ã®èå¾ã«ãããã³ãã«ãã®ãã®ãéããã« <parameter>ret</parameter> ã«è¿ããã¨ããã§éãããã¾ãã ãã®ã¨ãããã®é¢æ°ãæåãããã <parameter>stream</parameter> ã¯ãã®æç¹ã§éããããã¨å¤æãããã¹ãã§ã 以éãã®ã¹ããªã¼ã ã使ã£ã¦ã¯ããã¾ããã </entry> </row> </tbody> </tgroup> </table> </para> <note> <simpara> ãã使ã£ã¦ããã·ã¹ãã (glibc 2 ã¾ãã¯ä»¥éã使ã£ã¦ããã·ã¹ãã )ã <function>fopencookie</function> ããµãã¼ããã¦ããå ´åã ã¹ããªã¼ã API ã¯å¸¸ã«ã©ã®ã¹ããªã¼ã ããã ANSI FILE * ãã¤ã³ã¿ã åæã§ãã¾ãããã®ç¹é·ã¯ãããã PHP ã¹ããªã¼ã ããµã¼ããã¼ãã£ã® ã©ã¤ãã©ãªã«æ¸¡ããã®ã§é常ã«ä¾¿å©ã§ããã䏿¹ã§ãç§»æ¤å¯è½æ§ã¯é«ã ããã¾ããããã®å ´åã¯ãããªãã®ä½æããæ¡å¼µã¢ã¸ã¥ã¼ã«ãé å¸ããéã«ã ç§»æ¤å¯è½æ§ã«ã¤ãã¦ã®è¡¨ç¤ºãè¡ã£ã¦ãããã»ããããã§ãããã ãã fopencookie ã«ããåæãæã¾ãããªãå ´åã¯ãåé¡ã¨ããã¹ããªã¼ã ã ãã¤ãã£ãã« FILE* ããµãã¼ããã¦ãããã©ãã <function>php_stream_is</function> ã§èª¿ã¹ã¾ãããã </simpara> </note> <note> <simpara> ã½ã±ãããã¼ã¹ã®ã¹ããªã¼ã ã FILE* ã«å¤æããéãã¹ããªã¼ã API 㯠<function>fdopen</function> ã使ã£ã¦ãããçæãã¾ãã ãããããã¨ã¯ãã¹ããªã¼ã API ã®ã³ã¼ã«ã¨ ANSI æ¨æºå ¥åºå API ã®ã³ã¼ã«ã 交äºã«è¡ã£ãéã«ãã¹ããªã¼ã 層ã«ããã¦ãããã¡ããããã¼ã¿ã失ããã å±éºæ§ãçãããã¨ã«æ³¨æãã¦ãã ããã </simpara> </note> <para> <function>php_stream_is</function> 㨠<function>php_stream_can_cast</function> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-can-cast"> <refnamediv> <refname>php_stream_can_cast</refname> <refpurpose> ã¹ããªã¼ã ãFILE*ã¾ãã¯ã½ã±ããã®ãããªä»ã®å½¢å¼ã«å¤æã§ãããã©ããã 調ã¹ã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_can_cast</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>int</type><parameter>castas</parameter></methodparam> </methodsynopsis> <para> ãã®é¢æ°ã®æåã¯ã<function>php_stream_cast</function> ã® <parameter>ret</parameter> 弿°ã NULL ã«ãã<parameter>flags</parameter> ã 0 ã«ããæã®å¼ã³åºãã¨ç価ã§ãã è¦æ±ãããå½¢ã«ã¹ããªã¼ã ã夿ã§ããã¨ãã¯ã<constant>SUCCESS</constant> ãã夿ãã§ããªãã¨ãã¯ã<constant>FAILURE</constant> ãè¿ãã¾ãã </para> <note> <simpara> ãã®é¢æ°ã¯å®éã«å¤æãè¡ãããã§ã¯ããã¾ããããä½ããã®ã¹ããªã¼ã ã®ç¶æ ã å¤åããå¯è½æ§ãããã¾ãã </simpara> </note> <note> <simpara> ãã®é¢æ°ã®è¿ãå¤ã¯ã<function>php_stream_cast</function> ã§èª¬æãããããã«ã æç¤ºçã«å®æ°ã¨æ¯è¼ãããå¿ è¦ãããã¾ãã </simpara> </note> <para> <function>php_stream_cast</function> 㨠<function>php_stream_is</function> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-is-persistent"> <refnamediv> <refname>php_stream_is_persistent</refname> <refpurpose> ã¹ããªã¼ã ãæç¶çãªã¹ããªã¼ã ã§ãããã©ããã調ã¹ã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_is_persistent</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_is_persistent</function> ã¯ãã¹ããªã¼ã ãæä¹ çã§ããã¨ã1 ããããã§ãªãå ´å㯠0 ãè¿ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-is"> <refnamediv> <refname>php_stream_is</refname> <refpurpose>ã¹ããªã¼ã ãç¹å®ã®åã§ãããã©ããã調ã¹ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_is</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>int</type><parameter>istype</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_is</function> 㯠<parameter>stream</parameter> ã <parameter>istype</parameter> ã§æå®ãããåã§ããæã« 1 ããããã§ãªãå ´åã« 0 ãè¿ãã¾ãã <table> <title><parameter>istype</parameter>ã«æå®ã§ããå¤</title> <tgroup cols="2"> <thead> <row> <entry>å¤</entry> <entry>æå³</entry> </row> </thead> <tbody> <row> <entry>PHP_STREAM_IS_STDIO</entry> <entry>ã¹ããªã¼ã ã¯æ¨æºå ¥åºåã®å®è£ ãç¨ãã¦å®è£ ããã¦ãã</entry> </row> <row> <entry>PHP_STREAM_IS_SOCKET</entry> <entry>ã¹ããªã¼ã ã¯ã½ã±ãããç¨ãã¦å®è£ ããã¦ãã</entry> </row> <row> <entry>PHP_STREAM_IS_USERSPACE</entry> <entry>ã¹ããªã¼ã ã¯ã¦ã¼ã¶ç©ºéã«ãããªãã¸ã§ã¯ããç¨ãã¦å®è£ ããã¦ãã</entry> </row> <row> <entry>PHP_STREAM_IS_MEMORY</entry> <entry>ã¹ããªã¼ã ã¯åçã«ãµã¤ãºãå¢ããã¡ã¢ãªã¼ã¹ããªã¼ã ã®å®è£ ãç¨ãã¦å®è£ ããã¦ãã</entry> </row> </tbody> </tgroup> </table> </para> <note> <simpara> PHP_STREAM_IS_XXX "宿°ã¯" å®éã«ã¯ãã¹ããªã¼ã æä½ãå®ç¾©ããæ§é ä½ã¸ã® ãã¤ã³ã¿ã§ããããããªãã®æ¡å¼µã¢ã¸ã¥ã¼ã«ããå¥ã®æ¡å¼µã¢ã¸ã¥ã¼ã«å ã§ã æ°ããªã¹ããªã¼ã ã®å®è£ ãå®ç¾©ããã¦ããå ´åãåæã«ãã®é¢æ°ã«ããæ¯è¼ã« 使ãããã㪠PHP_STREAM_IS_XXX 宿°ããã®ãããã¼ãã¡ã¤ã«å ã§ å®ç¾©ãã¦ããã¹ãã§ãã </simpara> </note> <note> <simpara> ãã®é¢æ°ã¯ãåç´ãª(ãã¤é«éãª) ãã¤ã³ã¿ã¼ã®æ¯è¼ã ããè¡ããã å®è£ ããã¦ãããã¹ããªã¼ã ã®ç¶æ ã夿´ãããã¨ã¯ããã¾ããã </simpara> </note> <para> <function>php_stream_cast</function> ã <function>php_stream_can_cast</function> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-passthru"> <refnamediv> <refname>php_stream_passthru</refname> <refpurpose>ã¹ããªã¼ã ããæ®ãã®ãã¼ã¿ãå ¨ã¦åºåãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>size_t</type><methodname>php_stream_passthru</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_passthru</function> ã¯ã<parameter>stream</parameter> ã«æ®ããããã¹ã¦ã®ãã¼ã¿ããç¾å¨æå¹ãªåºåãããã¡ã«å¯¾ãã¦åºåãã ä½ãã¤ãåºåãããããè¿ãã¾ãã ããåºåãããã¡ãªã³ã°ãç¡å¹ã«ãªã£ã¦ããå ´åã¯ããã¼ã¿ã¯ ç´æ¥åºåå ã«æ¸ãè¾¼ã¾ãã¾ãããã®åºåå ã¯ãPHP ãã¦ã§ããµã¼ãã®ä¸ã§ åãã¦ããéã«ã¯ãã©ã¦ã¶ã«ãªããCLI ãã¼ã¹ã® PHP ã®å ´åã¯æ¨æºåºå ã¨ãªãã¾ãã ãã®é¢æ°ã¯ããã©ã¼ãã³ã¹åä¸ã®ãããå¯è½ã§ããã°ã¡ã¢ãªãããã³ã° ãå©ç¨ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-register-url-stream-wrapper"> <refnamediv> <refname>php_register_url_stream_wrapper</refname> <refpurpose>ã¹ããªã¼ã APIç¨ã®ã©ãããç»é²ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_register_url_stream_wrapper</methodname> <methodparam><type>char *</type><parameter>protocol</parameter></methodparam> <methodparam><type>php_stream_wrapper *</type><parameter>wrapper</parameter></methodparam> <methodparam><type>TSRMLS_DC</type><parameter></parameter></methodparam> </methodsynopsis> <para> <function>php_register_url_stream_wrapper</function> 㯠<parameter>wrapper</parameter> ã <parameter>protocol</parameter> ã§æå®ããããã³ãã©ã¨ã㦠ç»é²ãã¾ãã </para> <note> <simpara> ãããã®é¢æ°ããã¼ãå¯è½ãªã¢ã¸ã¥ã¼ã«ããå¼ã³åºãå ´åã å¿ ã <function>php_unregister_url_stream_wrapper</function> ã ãã®ã¢ã¸ã¥ã¼ã«ã®ã·ã£ãããã¦ã³ã«ã¼ãã³ããå¼ã³åºãã¦ãã ããã ããããªãã¨ãPHP ã¯ã¯ã©ãã·ã¥ãã¦ãã¾ãã¾ãã </simpara> </note> </refsect1> </refentry> <refentry id="streams.php-unregister-url-stream-wrapper"> <refnamediv> <refname>php_unregister_url_stream_wrapper</refname> <refpurpose>ã¹ããªã¼ã APIç¨ã®ã©ããã®ç»é²ãè§£é¤ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_unregister_url_stream_wrapper</methodname> <methodparam><type>char *</type><parameter>protocol</parameter></methodparam> <methodparam><type>TSRMLS_DC</type><parameter></parameter></methodparam> </methodsynopsis> <para> <function>php_unregister_url_stream_wrapper</function> 㯠<parameter>protocol</parameter> ã«é¢é£ä»ããããã©ããã¼ã®ç»é²ãè§£é¤ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-open-wrapper-ex"> <refnamediv> <refname>php_stream_open_wrapper_ex</refname> <refpurpose> ã³ã³ããã¹ããæå®ãã¦ããã¡ã¤ã«ã¾ãã¯URLã«ã¹ããªã¼ã ããªã¼ãã³ãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>php_stream *</type><methodname>php_stream_open_wrapper_ex</methodname> <methodparam><type>char *</type><parameter>path</parameter></methodparam> <methodparam><type>char *</type><parameter>mode</parameter></methodparam> <methodparam><type>int</type><parameter>options</parameter></methodparam> <methodparam><type>char **</type><parameter>opened</parameter></methodparam> <methodparam><type>php_stream_context *</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_open_wrapper_ex</function> 㯠<function>php_stream_open_wrapper</function> ã¨é常ã«ä¼¼ã¦ãã¾ããã php_stream_context ãªãã¸ã§ã¯ãã <parameter>context</parameter> ã§ æå®ãããã¨ãã§ããç¹ã§ç°ãªãã¾ãã ã¹ããªã¼ã ã³ã³ããã¹ãã«é¢ãã詳細㯠<link linkend="stream.contexts">ã¹ããªã¼ã ã³ã³ããã¹ã</link> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-open-wrapper-as-file"> <refnamediv> <refname>php_stream_open_wrapper_as_file</refname> <refpurpose> ãã¡ã¤ã«ã¾ãã¯URLããªã¼ãã³ããFILE*ã«å¤æãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>FILE *</type><methodname>php_stream_open_wrapper_as_file</methodname> <methodparam><type>char *</type><parameter>path</parameter></methodparam> <methodparam><type>char *</type><parameter>mode</parameter></methodparam> <methodparam><type>int</type><parameter>options</parameter></methodparam> <methodparam><type>char **</type><parameter>opened</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_open_wrapper_as_file</function> 㯠<function>php_stream_open_wrapper</function> ã¨é常ã«ä¼¼ã¦ãã¾ããã ã¹ããªã¼ã ã ANSI æ¨æºå ¥åºåã® FILE* ãã¤ã³ã¿ã«å¤æãã¦ã¹ããªã¼ã ã®ä»£ããã« ãããè¿ãç¹ãç°ãªãã¾ãã ãã®é¢æ°ã¯ããµã¼ããã¼ãã£ã®ã©ã¤ãã©ãªã« FILE* ãç´æ¥æ¸¡ãããã® è¿éã¨ãã¦ç¨æããã¦ãã¾ãã </para> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/structs.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/structs.xml +++ phpdoc-ja/internals/streams/structs.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.structs"> <title>ã¹ããªã¼ã æ§é ä½</title> <refentry id="streams.struct-php-stream-statbuf"> <refnamediv> <refname>struct php_stream_statbuf</refname> <refpurpose>ãã¡ã¤ã«ã¾ãã¯URLã«é¢ããæ å ±ãä¿æãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <synopsis> <structname>php_stream_statbuf</structname> <type>struct stat</type> <structfield>sb</structfield> </synopsis> <para> <structfield>sb</structfield> ã¯ãé常ã®ã·ã¹ãã ãå®ç¾©ãã struct statã§ãã </para> </refsect1> </refentry> <refentry id="streams.struct-php-stream-dirent"> <refnamediv> <refname>struct php_stream_dirent</refname> <refpurpose> ãã£ã¬ã¯ããªæ¢ç´¢ã®éã«ä¸ã¤ã®ãã¡ã¤ã«ã«é¢ããæ å ±ãä¿æãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <synopsis> <structname>php_stream_dirent</structname> <type>char</type> <structfield>d_name[MAXPATHLEN]</structfield> </synopsis> <para> <structfield>d_name</structfield> ã¯ãæ¢ç´¢ãããã£ã¬ã¯ããªã«é¢ã㦠ç¸å¯¾çãªãã¡ã¤ã«åãä¿æãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.struct-php-stream-ops"> <refnamediv> <refname>struct php_stream_ops</refname> <refpurpose>Holds member functions for a stream implementation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <programlisting role="c"> <![CDATA[ typedef struct _php_stream_ops { /* all streams MUST implement these operations */ size_t (*write)(php_stream *stream, const char *buf, size_t count TSRMLS_DC); size_t (*read)(php_stream *stream, char *buf, size_t count TSRMLS_DC); int (*close)(php_stream *stream, int close_handle TSRMLS_DC); int (*flush)(php_stream *stream TSRMLS_DC); const char *label; /* name describing this class of stream */ /* these operations are optional, and may be set to NULL if the stream does not * support a particular operation */ int (*seek)(php_stream *stream, off_t offset, int whence TSRMLS_DC); char *(*gets)(php_stream *stream, char *buf, size_t size TSRMLS_DC); int (*cast)(php_stream *stream, int castas, void **ret TSRMLS_DC); int (*stat)(php_stream *stream, php_stream_statbuf *ssb TSRMLS_DC); } php_stream_ops; ]]> </programlisting> </refsect1> </refentry> <refentry id="streams.struct-php-stream-wrapper"> <refnamediv> <refname>struct php_stream_wrapper</refname> <refpurpose>Holds wrapper properties and pointer to operations</refpurpose> </refnamediv> <refsect1> <title>Description</title> <programlisting role="c"> <![CDATA[ struct _php_stream_wrapper { php_stream_wrapper_ops *wops; /* operations the wrapper can perform */ void *abstract; /* context for the wrapper */ int is_url; /* so that PG(allow_url_fopen) can be respected */ /* support for wrappers to return (multiple) error messages to the stream opener */ int err_count; char **err_stack; } php_stream_wrapper; ]]> </programlisting> </refsect1> </refentry> <refentry id="streams.struct-php-stream-wrapper-ops"> <refnamediv> <refname>struct php_stream_wrapper_ops</refname> <refpurpose>Holds member functions for a stream wrapper implementation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <programlisting role="c"> <![CDATA[ typedef struct _php_stream_wrapper_ops { /* open/create a wrapped stream */ php_stream *(*stream_opener)(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); /* close/destroy a wrapped stream */ int (*stream_closer)(php_stream_wrapper *wrapper, php_stream *stream TSRMLS_DC); /* stat a wrapped stream */ int (*stream_stat)(php_stream_wrapper *wrapper, php_stream *stream, php_stream_statbuf *ssb TSR$ /* stat a URL */ int (*url_stat)(php_stream_wrapper *wrapper, char *url, php_stream_statbuf *ssb TSRMLS_DC); /* open a "directory" stream */ php_stream *(*dir_opener)(php_stream_wrapper *wrapper, char *filename, char *mode, int options, char **opened_path, php_stream_context *context STREAMS_DC TSRMLS_DC); const char *label; /* Delete/Unlink a file */ int (*unlink)(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC); } php_stream_wrapper_ops; ]]> </programlisting> </refsect1> </refentry> <refentry id="streams.struct-php-stream-filter"> <refnamediv> <refname>struct php_stream_filter</refname> <refpurpose>Holds filter properties and pointer to operations</refpurpose> </refnamediv> <refsect1> <title>Description</title> <programlisting role="c"> <![CDATA[ struct _php_stream_filter { php_stream_filter_ops *fops; void *abstract; /* for use by filter implementation */ php_stream_filter *next; php_stream_filter *prev; int is_persistent; /* link into stream and chain */ php_stream_filter_chain *chain; /* buffered buckets */ php_stream_bucket_brigade buffer; } php_stream_filter; ]]> </programlisting> </refsect1> </refentry> <refentry id="streams.struct-php-stream-filter-ops"> <refnamediv> <refname>struct php_stream_filter_ops</refname> <refpurpose>Holds member functions for a stream filter implementation</refpurpose> </refnamediv> <refsect1> <title>Description</title> <programlisting role="c"> <![CDATA[ typedef struct _php_stream_filter_ops { php_stream_filter_status_t (*filter)( php_stream *stream, php_stream_filter *thisfilter, php_stream_bucket_brigade *buckets_in, php_stream_bucket_brigade *buckets_out, size_t *bytes_consumed, int flags TSRMLS_DC); void (*dtor)(php_stream_filter *thisfilter TSRMLS_DC); const char *label; } php_stream_filter_ops; ]]> </programlisting> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/socket.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/socket.xml +++ phpdoc-ja/internals/streams/socket.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.socket-api"> <title>ã¹ããªã¼ã ã½ã±ãã API ãªãã¡ã¬ã³ã¹</title> <refentry id="streams.php-stream-sock-open-from-socket"> <refnamediv> <refname>php_stream_sock_open_from_socket</refname> <refpurpose>ã½ã±ãããã¹ã¯ãªãã¿ãã¹ããªã¼ã ã«å¤æãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_sock_open_from_socket</methodname> <methodparam><type>int</type><parameter>socket</parameter></methodparam> <methodparam><type>int</type><parameter>persistent</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_sock_open_from_socket</function> ã¯ã <parameter>socket</parameter> ãå ã«ããã¹ããªã¼ã ãè¿ãã¾ãã <parameter>persistent</parameter> ã¯ãã¹ããªã¼ã ãæä¹ çã¹ããªã¼ã ã¨ã㦠éããã©ãããæå®ãã¾ããä¸è¬çã«ã¯ããã®å¤ã¯ 0 ã«ãªããã¨ãã»ã¨ãã©ã§ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-sock-open-host"> <refnamediv> <refname>php_stream_sock_open_host</refname> <refpurpose>ãã¹ãã¸ã®æ¥ç¶ããªã¼ãã³ããã¹ããªã¼ã ãè¿ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_sock_open_host</methodname> <methodparam><type>const char *</type><parameter>host</parameter></methodparam> <methodparam><type>unsigned short</type><parameter>port</parameter></methodparam> <methodparam><type>int</type><parameter>socktype</parameter></methodparam> <methodparam><type>struct timeval *</type><parameter>timeout</parameter></methodparam> <methodparam><type>int</type><parameter>persistent</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_sock_open_host</function> ã¯ãæå®ããããã¹ã <parameter>host</parameter> ã®ãã¼ã <parameter>port</parameter> ã«å¯¾ãã æ¥ç¶ã確ç«ãã¾ãã<parameter>socktype</parameter> ã¯ã æ¥ç¶ã«é©ç¨ãããæ§å¼ãæå®ãã¾ãã<parameter>socktype</parameter> ã« æå®ã§ããå¤ã¯ã·ã¹ãã ã«ä¾åãã¦ãã¾ããã大æµã¯ (å°ãªãã¨ã) <constant>SOCK_STREAM</constant> ããæç³»åçãªãä¿¡é ¼æ§ã®ããã 忹忥ç¶ã®ã½ã±ãã (TCP)ã <constant>SOCK_DGRAM</constant> ãã æ¥ç¶åã§ãªãä¿¡é ¼æ§ã®å°ãªãåºå®é·ã¡ãã»ã¼ã¸ã®ã½ã±ãã (UDP) ã«å¯¾ã㦠æå®ã§ãã¾ãã </para> <para> <parameter>persistent</parameter> ã¯ãã¹ããªã¼ã ãæä¹ çã¹ããªã¼ã ã¨ã㦠éããã©ãããæå®ãã¾ããä¸è¬çã«ã¯ããã®å¤ã¯ 0 ã«ãªããã¨ãã»ã¨ãã©ã§ãã </para> <para> <parameter>timeout</parameter> ã NULL ã§ãªãå ´åãæ¥ç¶ããéã«è¨±ããã æé·ã®æéãæå®ãã¾ãã ãããã¿ã¤ã ã¢ã¦ãã®å¤ãããé·ãæ¥ç¶ã«æéãããã£ãã¨ãã¯ã æ¥ç¶ã¯ä¸æãããã¹ããªã¼ã ããªã¼ãã³ã§ããªãã£ããã¨ã示ããã NULL ãè¿ããã¾ãã </para> <note> <simpara> ã¿ã¤ã ã¢ã¦ãã®å¤ã¯ DNS ã«ãã¯ã¢ããã«ãããæéãå«ã¿ã¾ããã ãããã¯ããªã DNS ã«ãã¯ã¢ãããå®è£ ããç§»æ¤æ§ã®é«ãæ¹æ³ããªãããã§ãã </simpara> <simpara> ã¾ããã¿ã¤ã ã¢ã¦ãã¯ãæ¥ç¶ãã§ã¼ãºã«ã®ã¿é©ç¨ããã¾ãã ãããå¾ã«ç¶ãèªã¿åºããæ¸ãè¾¼ã¿æä½ã«ã¤ãã¦ã¿ã¤ã ã¢ã¦ãæéãè¨å®ãããå ´åã¯ã 䏿¦éãããã¹ããªã¼ã ã«å¯¾ãã <function>php_stream_sock_set_timeout</function> ã使ã£ã¦ãã ããã </simpara> </note> <para> ã¹ããªã¼ã API ã¯ã<parameter>socktype</parameter> ã«æå®ã§ããå¤ã« å¶éãè¨ãã¦ãã¾ããããèªåã®æ¡å¼µã¢ã¸ã¥ã¼ã«ããªãªã¼ã¹ããéã«ã¯ã ãã®å¤ãã©ããããã®ç§»æ¤å¯è½æ§ãæã¤ãã«ã¤ãã¦èæ ®ãã¾ãããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-sock-open-unix"> <refnamediv> <refname>php_stream_sock_open_unix</refname> <refpurpose> Unix ãã¡ã¤ã³ã½ã±ããããªã¼ãã³ããã¹ããªã¼ã ã¸å¤æãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_sock_open_unix</methodname> <methodparam><type>const char *</type><parameter>path</parameter></methodparam> <methodparam><type>int</type><parameter>pathlen</parameter></methodparam> <methodparam><type>int</type><parameter>persistent</parameter></methodparam> <methodparam><type>struct timeval *</type><parameter>timeout</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_sock_open_unix</function> 㯠<parameter>path</parameter> ã§æå®ããã Unix ãã¡ã¤ã³ã½ã±ãããéãã¾ãã<parameter>pathlen</parameter> ã¯ã<parameter>path</parameter> ã®é·ããæå®ãã¾ãã <parameter>timeout</parameter> 㯠NULL ã§ãªãå ´åã æ¥ç¶è©¦è¡ã«ãããã¿ã¤ã ã¢ã¦ãæéãæå®ãã¾ãã <parameter>persistent</parameter> ã¯ãã¹ããªã¼ã ãæä¹ çã¹ããªã¼ã ã¨ã㦠éããã©ãããæå®ãã¾ããä¸è¬çã«ã¯ããã®å¤ã¯ 0 ã«ãªããã¨ãã»ã¨ãã©ã§ãã </para> <note> <simpara> ãã®é¢æ°ã¯ Unix ãã¡ã¤ã³ã½ã±ãããå®è£ ããã¦ããªã Windows ã§ã¯åãã¾ããã ãã ãPHP ã®ãã¤ããªã cygwin ãç¨ãã¦ä½ããã¦ããå ´åã¯ãã®éãã§ã¯ããã¾ããã èªåã®æ¡å¼µã¢ã¸ã¥ã¼ã«ããªãªã¼ã¹ããéã«ã¯ãç§»æ¤å¯è½æ§ã«ã¤ãã¦èæ ®ãã¾ãããã </simpara> </note> <note> <simpara> ãã®é¢æ°ã¯ <parameter>path</parameter> ã (Linux ãªã©) æ½è±¡åå空éããã¡ã ãã¹åã®æåã NUL æåã«ãªããã¨ãããã·ã¹ãã ã«é©ãããã ãã¤ããªã»ã¼ãã«æ±ãã¾ãã </simpara> </note> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/index.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/index.xml +++ phpdoc-ja/internals/streams/index.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: working --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <chapter id="streams"> <title>PHPæ¡å¼µã¢ã¸ã¥ã¼ã«ã®ä½è ç¨ã®ã¹ããªã¼ã API</title> <sect1 id="streams.overview"> <title>æ¦è¦</title> <para> PHPã¹ããªã¼ã APIã¯ãPHPæ¡å¼µã¢ã¸ã¥ã¼ã«ã«ãã¡ã¤ã«ããã³ã½ã±ããå¦ç ç¨ã®çµ±ä¸åãããææ®µãå°å ¥ãããã®ã§ãã å ±éã®æä½ãè¡ãªãããã®æ¨æºé¢æ°ãæããåä¸ã®APIã使ç¨ãããã¨ã« ãããã¹ããªã¼ã APIã¯æ¡å¼µã¢ã¸ã¥ã¼ã«ããã¡ã¤ã«ãã½ã±ãããURLãã¡ã¢ãª ã¹ã¯ãªãããå®ç¾©ãããªãã¸ã§ã¯ãã«ã¢ã¯ã»ã¹ãããã¨ãå¯è½ã«ãã¾ãã ã¹ããªã¼ã ã¯ãæ°è¦ã¹ããªã¼ã ãç»é²ããããã«åçã«ãã¼ãããã ã¢ã¸ã¥ã¼ã«(ããã³ã¹ã¯ãªãã!)ã¨ãããã¨ãã§ããå®è¡æã«æ¡å¼µå¯è½ãª APIã§ãã </para> <para> ã¹ããªã¼ã APIã®ç®çã¯ããã¡ã¤ã«ãURLããã®ä»ã®ã¹ããªã¼ã ã«ã§ãããã¼ã¿ ã½ã¼ã¹ãå¹³æãªçµ±ä¸ãããAPIã«ãããéçºè ã容æã«ãªã¼ãã³ã§ããããã« ãããã¨ã§ããAPIã¯ãã»ã¼ANSI C stdio颿°ã¨(å¤ãã®ä¸»ãªé¢æ°ã«ã¤ãã¦åç ã®æå³ãæãã¦ããã)é¡ä¼¼ãã¦ãã¾ãããã®ãããCããã°ã©ãã¯ã ã¹ããªã¼ã ã«æ £ãã¦ããå°è±¡ãåããã¯ãã§ãã </para> <para> ã¹ããªã¼ã APIã¯ãããã¤ãã®ç°ãªãã¬ãã«ãå¦çãã¾ãã åºæ¬ã¬ãã«ã§ã¯ãAPIã¯ã¹ããªã¼ããã«ãªãã¼ã¿ã½ã¼ã¹ã表ã php_streamãªãã¸ã§ã¯ããå®ç¾©ãã¾ãã ããé«ãã¬ãã«ã§ã¯ãAPIã¯ãURLããã®ãã¼ã¿ããã³ã¡ã¿ãã¼ã¿ã®åå¾ã ãµãã¼ãããããã«ä½ã¬ãã«APIãã©ããããphp_stream_wrapper ãªãã¸ã§ã¯ããå®ç¾©ãã¾ãã An additional <literal>context</literal> parameter, accepted by most stream creation functions, is passed to the wrapper's <literal>stream_opener</literal> method to fine-tune the behavior of the wrapper. </para> <para> Any stream, once opened, can also have any number of <literal>filters</literal> applied to it, which process data as it is read from/written to the stream. </para> <para> ã¹ããªã¼ã ã¯ããã¡ã¤ã«å¦çã®ä»ã®å½¢å¼ã«ãã£ã¹ã(夿)ã§ãã 大ããªåé¡ããªããµã¼ããã¼ãã£è£½ã®ã©ã¤ãã©ãªã¨çµã¿åããã¦ä½¿ç¨ãã ãã¨ãã§ãã¾ããããã«ããããããã®ã©ã¤ãã©ãªãURLã½ã¼ã¹ãããã¼ã¿ã« ç´æ¥ã¢ã¯ã»ã¹ã§ããããã«ãªãã¾ãã 使ç¨ããã·ã¹ãã ã«<function>fopencookie</function>ã¾ã㯠<function>funopen</function>颿°ãããå ´åã ä»»æã®PHPã¹ããªã¼ã ãANSI stdioã使ãä»»æã®ã©ã¤ãã©ãªã«æ¸¡ããã¨ãã ã§ãã¾ã! </para> <para> <note> <para> The functions in this chapter are for use in the PHP source code and are not PHP functions. Userland stream functions can be found in the <link linkend="ref.stream">Stream Reference</link>. </para> </note> </para> </sect1> <sect1 id="streams.basics"> <title>ã¹ããªã¼ã ã®åºæ¬</title> <para> ã¹ããªã¼ã ã®ä½¿ç¨æ¹æ³ã¯ãANSI stdio颿°ã®ä½¿ç¨ã¨é常ã«ä¼¼ã¦ãã¾ãã 主ãªéãã¯ã使ç¨ãéå§ããã¹ããªã¼ã ãå¾ãæ¹æ³ã§ãã å¤ãã®å ´åãã¹ããªã¼ã ã®ãã³ãã«ãå¾ãããã« <function>php_stream_open_wrapper</function>ã使ç¨ãã¾ãã ãã®é¢æ°ã®åä½ã¯ã以ä¸ã®ä¾ã§ç¤ºãããã«fopenã¨é常ã«ããã«ã¦ãã¾ãã </para> <para> <example> <title>PHPãã¼ã ãã¼ã¸ã表示ããããã®ç°¡åãªã¹ããªã¼ã ã®ä¾</title> <programlisting role="c"> <![CDATA[ php_stream * stream = php_stream_open_wrapper("http://www.php.net", "rb", REPORT_ERRORS, NULL); if (stream) { while(!php_stream_eof(stream)) { char buf[1024]; if (php_stream_gets(stream, buf, sizeof(buf))) { printf(buf); } else { break; } } php_stream_close(stream); } ]]> </programlisting> </example> </para> <para> 以ä¸ã®è¡¨ã«ãã®ä»ã®ä¸è¬çãªANSI stdio颿°ã¨ç価ãªã¹ããªã¼ã 颿°ã 示ãã¾ããæ³¨è¨ã§é¤å¤ããã¦ããªãéãã颿°ã®æå³ã¯åãã§ãã <table> <title>ANSI stdioã¨ç価ãªã¹ããªã¼ã API颿°</title> <tgroup cols="3"> <thead> <row> <entry>ANSI stdio颿°</entry> <entry>PHP ã¹ããªã¼ã 颿°</entry> <entry>注æ</entry> </row> </thead> <tbody> <row> <entry>fopen</entry> <entry>php_stream_open_wrapper</entry> <entry>ã¹ããªã¼ã ã§ã¯ãã©ã¡ã¼ã¿ãå¢ãã¦ãã¾ã</entry> </row> <row> <entry>fclose</entry> <entry>php_stream_close</entry> <entry></entry> </row> <row> <entry>fgets</entry> <entry>php_stream_gets</entry> <entry></entry> </row> <row> <entry>fread</entry> <entry>php_stream_read</entry> <entry>ãã©ã¡ã¼ã¿nmembã®å¤ã1ã¨ä»®å®ããã¨ããããã¿ã¤ãã¯read(2)ã«ããä¼¼ããã¨ã«ãªãã¾ã</entry> </row> <row> <entry>fwrite</entry> <entry>php_stream_write</entry> <entry>ãã©ã¡ã¼ã¿nmembã®å¤ã1ã¨ä»®å®ããã¨ããããã¿ã¤ãã¯write(2)ã«ããä¼¼ããã¨ã«ãªãã¾ã</entry> </row> <row> <entry>fseek</entry> <entry>php_stream_seek</entry> <entry></entry> </row> <row> <entry>ftell</entry> <entry>php_stream_tell</entry> <entry></entry> </row> <row> <entry>rewind</entry> <entry>php_stream_rewind</entry> <entry></entry> </row> <row> <entry>feof</entry> <entry>php_stream_eof</entry> <entry></entry> </row> <row> <entry>fgetc</entry> <entry>php_stream_getc</entry> <entry></entry> </row> <row> <entry>fputc</entry> <entry>php_stream_putc</entry> <entry></entry> </row> <row> <entry>fflush</entry> <entry>php_stream_flush</entry> <entry></entry> </row> <row> <entry>puts</entry> <entry>php_stream_puts</entry> <entry>fputsã§ã¯ãªããputsã¨åãæå³</entry> </row> <row> <entry>fstat</entry> <entry>php_stream_stat</entry> <entry>ã¹ããªã¼ã ã¯ããæ å ±ã®å¤ãstatæ§é ä½ãæãã¦ãã¾ã</entry> </row> </tbody> </tgroup> </table> </para> </sect1> <sect1 id="streams.resources"> <title>ãªã½ã¼ã¹ã¨ãã¦ã®ã¹ããªã¼ã </title> <para> All streams are registered as resources when they are created. This ensures that they will be properly cleaned up even if there is some fatal error. All of the filesystem functions in PHP operate on streams resources - that means that your extensions can accept regular PHP file pointers as parameters to, and return streams from their functions. The streams API makes this process as painless as possible: </para> <para> <example> <title>How to accept a stream as a parameter</title> <programlisting role="c"> <![CDATA[ PHP_FUNCTION(example_write_hello) { zval *zstream; php_stream *stream; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r", &zstream)) return; php_stream_from_zval(stream, &zstream); /* you can now use the stream. However, you do not "own" the stream, the script does. That means you MUST NOT close the stream, because it will cause PHP to crash! */ php_stream_write(stream, "hello\n"); RETURN_TRUE(); } ]]> </programlisting> </example> </para> <para> <example> <title>How to return a stream from a function</title> <programlisting role="c"> <![CDATA[ PHP_FUNCTION(example_open_php_home_page) { php_stream *stream; stream = php_stream_open_wrapper("http://www.php.net", "rb", REPORT_ERRORS, NULL); php_stream_to_zval(stream, return_value); /* after this point, the stream is "owned" by the script. If you close it now, you will crash PHP! */ } ]]> </programlisting> </example> </para> <para> Since streams are automatically cleaned up, it's tempting to think that we can get away with being sloppy programmers and not bother to close the streams when we are done with them. Although such an approach might work, it is not a good idea for a number of reasons: streams hold locks on system resources while they are open, so leaving a file open after you have finished with it could prevent other processes from accessing it. If a script deals with a large number of files, the accumulation of the resources used, both in terms of memory and the sheer number of open files, can cause web server requests to fail. Sounds bad, doesn't it? The streams API includes some magic that helps you to keep your code clean - if a stream is not closed by your code when it should be, you will find some helpful debugging information in you web server error log. </para> <note> <simpara> Always use a debug build of PHP when developing an extension (<option>--enable-debug</option> when running configure), as a lot of effort has been made to warn you about memory and stream leaks. </simpara> </note> <para> In some cases, it is useful to keep a stream open for the duration of a request, to act as a log or trace file for example. Writing the code to safely clean up such a stream is not difficult, but it's several lines of code that are not strictly needed. To save yourself the trouble of writing the code, you can mark a stream as being OK for auto cleanup. What this means is that the streams API will not emit a warning when it is time to auto-cleanup a stream. To do this, you can use <function>php_stream_auto_cleanup</function>. </para> </sect1> &internals.streams.common; &internals.streams.dir; &internals.streams.file; &internals.streams.socket; &internals.streams.structs; &internals.streams.constants; </chapter> <!-- 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-ja/internals/streams/file.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/file.xml +++ phpdoc-ja/internals/streams/file.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.file-api"> <title>ã¹ããªã¼ã ãã¡ã¤ã« API ãªãã¡ã¬ã³ã¹</title> <refentry id="streams.php-stream-fopen-from-file"> <refnamediv> <refname>php_stream_fopen_from_file</refname> <refpurpose>ANSI FILE* ãã¹ããªã¼ã ã«å¤æãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_fopen_from_file</methodname> <methodparam><type>FILE *</type><parameter>file</parameter></methodparam> <methodparam><type>char *</type><parameter>mode</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_fopen_from_file</function> ã¯ã <parameter>file</parameter>ã«åºã¥ãã¹ããªã¼ã ãè¿ãã¾ãã <parameter>mode</parameter> ã¯ã<parameter>file</parameter>ããªã¼ãã³ãã éã«ä½¿ç¨ãããã¢ã¼ãã¨åãã§ããå¿ è¦ãããããããªãã¨ã ã¹ããªã¼ã ããã¡ã¤ã«ã®ã¢ã¼ãã¨ç°ãªã£ãå ´åã«ãæ¸ãè¾¼ã¿ãè¡ãã¨ã ããããªçµæãçããå¯è½æ§ãããã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-fopen-tmpfile"> <refnamediv> <refname>php_stream_fopen_tmpfile</refname> <refpurpose>tmpfile()ã§FILE*ããªã¼ãã³ããã¹ããªã¼ã ã«å¤æãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_fopen_tmpfile</methodname> <methodparam><type>void</type><parameter></parameter></methodparam> </methodsynopsis> <para> <function>php_stream_fopen_tmpfile</function> ã¯ãã¢ã¼ã "w+b" ã§éããã ãã³ãã©ãªãã¡ã¤ã«ãå ã«ããã¹ããªã¼ã ãè¿ãã¾ãã ãã³ãã©ãªãã¡ã¤ã«ã¯ãã¹ããªã¼ã ãéããããããããã»ã¹ã®çµäºæã« åé¤ããã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-fopen-temporary-file"> <refnamediv> <refname>php_stream_fopen_temporary_file</refname> <refpurpose> ãã¡ã¤ã«åãçæãããã®ãã¡ã¤ã«ã¸ã®ã¹ããªã¼ã ããªã¼ãã³ãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_fopen_temporary_file</methodname> <methodparam><type>const char *</type><parameter>dir</parameter></methodparam> <methodparam><type>const char *</type><parameter>pfx</parameter></methodparam> <methodparam><type>char **</type><parameter>opened</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_fopen_temporary_file</function> ã¯ã<parameter>dir</parameter> ã§æå®ããããã£ã¬ã¯ããªã«ã<parameter>pfx</parameter> ã§æå®ããã ãã¬ãã£ãã¯ã¹ãæã¤ãã³ãã©ãªãã¡ã¤ã«ãçæãã¾ãã çæããããã¡ã¤ã«å㯠<parameter>opened</parameter> ãã©ã¡ã¼ã¿ã«è¿ããã¾ããã ãã®å¤ã¯ãå¾ã§ <function>efree</function> ã使ã£ã¦éæ¾ããå¿ è¦ãããã¾ãã ã¹ããªã¼ã ã¯çæããããã¡ã¤ã«åã§ã"w+b" ã¢ã¼ãã§éããã¾ãã ãªãããã¡ã¤ã«ã¯èªåçã«ã¯åé¤ããã¾ããã®ã§ãå©ç¨ãçµãã£ããèªåã§åé¤ ãããé©åãªå ´æã«ç§»åãããããªãã¦ã¯ãªãã¾ããã </para> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/dir.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/dir.xml +++ phpdoc-ja/internals/streams/dir.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.4 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.dir-api"> <title>ã¹ããªã¼ã ãã£ã¬ã¯ããªAPIãªãã¡ã¬ã³ã¹</title> <para> æ¬ã»ã¯ã·ã§ã³ã«ç¤ºãä¸é£ã®é¢æ°ã¯ããã¼ã«ã«ãã¡ã¤ã«ããã³ãªã¢ã¼ããã¡ã¤ã« (ãã®æ©è½ãã©ããã¼ããµãã¼ãããå ´å!)ã§åä½ãã¾ãã </para> <refentry id="streams.php-stream-opendir"> <refnamediv> <refname>php_stream_opendir</refname> <refpurpose> ãã¡ã¤ã«ã®ãªã¹ããå¾ãããã«ãã£ã¬ã¯ããªããªã¼ãã³ãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream *</type><methodname>php_stream_opendir</methodname> <methodparam><type>char *</type><parameter>path</parameter></methodparam> <methodparam><type>php_stream_context *</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_opendir</function> ã¯ã<parameter>path</parameter> ã§ æå®ããããã£ã¬ã¯ããªå ã®ãã¡ã¤ã«ã®ä¸è¦§ãåå¾ããã®ã«ç¨ããã¹ããªã¼ã ãè¿ãã¾ãã ãã®é¢æ°ã®åä½ã¯ãPOSIX ã® <function>opendir</function> 颿°ã¨ã»ã¼åä¸ã§ãã ãã®é¢æ°ã¯ php_stream ãªãã¸ã§ã¯ããè¿ãã¾ããããã®ã¹ããªã¼ã ãªãã¸ã§ã¯ãã«å¯¾ãã¦å ±é API ã®é¢æ°ã使ããã¨ã¯ãå§ãã§ãã¾ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-readdir"> <refnamediv> <refname>php_stream_readdir</refname> <refpurpose> ãªã¼ãã³ãããã£ã¬ã¯ããªããæ¬¡ã®ãã£ã¬ã¯ããªã¨ã³ããªãå¾ã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>php_stream_dirent *</type><methodname>php_stream_readdir</methodname> <methodparam><type>php_stream *</type><parameter>dirstream</parameter></methodparam> <methodparam><type>php_stream_dirent *</type><parameter>ent</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_readdir</function> ã¯ã<parameter>dirstream</parameter> ããæ¬¡ã®ãã£ã¬ã¯ããªã¨ã³ããªãèªã¿åºãã<parameter>ent</parameter> ã«æ ¼ç´ãã¾ãã æåããå ´åã®è¿ãå¤ã¯ <parameter>ent</parameter> ã§ã失æããå ´åã® è¿ãå¤ã¯ <type>NULL</type> ã§ãã åãã£ã¬ã¯ããªã¨ã³ããªã«è¿ãããæ å ±ã«é¢ãããã詳細ã«ã¤ãã¦ã¯ã<link linkend="streams.struct-php-stream-dirent">php_stream_dirent</link> ãåç §ãã¦ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-rewinddir"> <refnamediv> <refname>php_stream_rewinddir</refname> <refpurpose>æåã®ã¨ã³ããªã«ãã£ã¬ã¯ããªã¹ããªã¼ã ãæ»ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>int</type><methodname>php_stream_rewinddir</methodname> <methodparam><type>php_stream *</type><parameter>dirstream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_rewinddir</function> ã¯ã æå®ããããã£ã¬ã¯ããªã¹ããªã¼ã ãæåã®ã¨ã³ããªãæãããå·»ãæ»ãã¾ãã æåæã« 0 ãã失ææã« -1 ãè¿ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-closedir"> <refnamediv> <refname>php_stream_closedir</refname> <refpurpose>ãã£ã¬ã¯ããªã¹ããªã¼ã ãéãããªã½ã¼ã¹ãè§£æ¾ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis> <type>int</type><methodname>php_stream_closedir</methodname> <methodparam><type>php_stream *</type><parameter>dirstream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_closedir</function> ã¯ããã£ã¬ã¯ããªã¹ããªã¼ã ãéãã ããã«é¢é£ä»ãããããªã½ã¼ã¹ãéæ¾ãã¾ãã æåæã« 0 ãã失ææã« -1 ãè¿ãã¾ãã </para> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/constants.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/constants.xml +++ phpdoc-ja/internals/streams/constants.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.constants"> <title>ã¹ããªã¼ã 宿°</title> <refentry id="streams.options"> <refnamediv> <refname>ã¹ããªã¼ã ããªã¼ãã³ããéã®ãªãã·ã§ã³</refname> <refpurpose>ã¹ããªã¼ã çæé¢æ°ã®å¦çãè¨å®ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <para> ãããã®å¤ã¯ OR æ¼ç®åã使ã£ã¦ä¸ã¤ä»¥ä¸çµã¿åãããã¨ãã§ãã¾ãã <variablelist> <varlistentry> <term> <constant>IGNORE_PATH</constant> </term> <listitem> <simpara> ããã¯ã¹ããªã¼ã ã®ããã©ã«ãã®ãªãã·ã§ã³ã§ããè¦æ±ããããã¡ã¤ã«ã« ã¤ãã¦ãinclude_path ã«åæããããã¹ãæ¤ç´¢ããªãããã«ãã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>USE_PATH</constant> </term> <listitem> <simpara> è¦æ±ããããã¡ã¤ã«ã«ã¤ãã¦ãinclude_path ã§åæããããã¹ãæ¤ç´¢ãã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>IGNORE_URL</constant> </term> <listitem> <simpara> ã¹ããªã¼ã ãéãéã«ãç»é²ããã URL ã©ããã¼ã®åå¨ãç¡è¦ãã¾ãã é URL ã©ããã¼ã«ã¤ãã¦ã¯èæ ®ããããããããã¹ããã³ã¼ããã¾ãã ãã®ãã©ã°ã®éã¯ããã¾ãã; ã¹ããªã¼ã APIã¯ç»é²ããããã¹ã¦ã® ã©ããã¼ãããã©ã«ãã§ä½¿ç¨ãããã¨ãã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>IGNORE_URL_WIN</constant> </term> <listitem> <simpara> Windows ã«ããã¦ã¯ãIGNORE_URL ã¨ç価ã§ãã ä»ã®ã·ã¹ãã ã§ã¯å¹æã¯ããã¾ããã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>ENFORCE_SAFE_MODE</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãéãåã«ãã¹ããªã¼ã ã®èå¾ã®å®è£ ã safe_mode ãã§ãã¯ã ãã¡ã¤ã«ã«å¯¾ãã¦è¡ãããæç¤ºãã¾ãã ãã®ãã©ã°ãçãã¨ãsafe_mode ãã§ãã¯ãè¡ããããPHP ããã»ã¹ã ã¢ã¯ã»ã¹æ¨©ããã¤ãã¹ã¦ã®ãã¡ã¤ã«ã«å¯¾ãã¦ãªã¼ãã³ãå¯è½ã«ãªãã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>REPORT_ERRORS</constant> </term> <listitem> <simpara> ãã®ãã©ã°ãã»ããããã¦ãã¦ããã¡ã¤ã«ã¾ã㯠URL ãéãéã«ä½ããã®ã¨ã©ã¼ã çºçããå ´åã«ãã¹ããªã¼ã API 㯠php_error 颿°ãããªãã®ä»£ããã« å®è¡ãã¾ããããã¯ããã¹ã URL ãã¦ã¼ã¶åããã¹ã¯ã¼ããªã© ã¨ã©ã¼æã«ãã©ã¦ã¶ã«è¡¨ç¤ºãããã¹ãã§ãªãæ å ±ãå«ãã¨ãã« (ãããã»ãã¥ãªãã£ã¼ä¸ã®ãªã¹ã¯ã«ãªããã) æç¨ã§ãã ã¹ããªã¼ã API ãã¨ã©ã¼ãåºãã¨ãã¯ãã¾ãã¦ã¼ã¶åããã¹ã¯ã¼ãã¨ãã£ã æ å ±ããã¹ããåãé¤ããå¾ã§ãã¨ã©ã¼ã¡ãã»ã¼ã¸ãå®å ¨ãªå½¢ã«ãã¦ãã ã¨ã©ã¼ãåºåãã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>STREAM_MUST_SEEK</constant> </term> <listitem> <simpara> ãã®ãã©ã°ã¯ãæ¡å¼µã¢ã¸ã¥ã¼ã«å ã§ãæ¬å½ã«ã¹ããªã¼ã ãã©ã³ãã ã«ã·ã¼ã¯ ããå¿ è¦ãããã¨ãã«æç¨ã§ãã ããã¤ãã®ç¨®é¡ã®ã¹ããªã¼ã ã¯ãã®ã¾ã¾ã®å½¢ã§ã¯ã·ã¼ã¯ãã§ããªããã¨ã ããã®ã§ããã®ãã©ã°ãã»ãããã¦ããã¨ãã¹ããªã¼ã API ã¯ã ã¾ãéãããã¹ããªã¼ã ãã·ã¼ã¯å¯è½ãã©ããã調ã¹ãã·ã¼ã¯ã§ããªãå ´åã¯ã ã¹ããªã¼ã ã®ãã¼ã¿ãã·ã¼ã¯å¯è½ãªä¸æçãªã¹ãã¬ã¼ã¸ (ãã³ãã©ãªãã¡ã¤ã« ãããã¯ã¡ã¢ãªã¼ã¹ããªã¼ã ) ã«ã³ãã¼ãã¾ãã ãã®ãã©ã°ã¯ãã¹ããªã¼ã ã«å¯¾ãã¦ã·ã¼ã¯åä½ãè¡ã£ã¦ããæ¸ãè¾¼ã¿ãè¡ããããª å ´åã«ã¯é©ãã¦ãã¾ãããã¢ã¯ã»ã¹å¯¾è±¡ã®ã¹ããªã¼ã ã¯å½åã¢ã¯ã»ã¹ãè¦æ±ãã ãªã½ã¼ã¹ã«å¿ ãããé¢é£ä»ãããã¦ããã¨ã¯éããªãããã§ãã </simpara> <note> <simpara> ãããè¦æ±ããããªã½ã¼ã¹ããããã¯ã¼ã¯ãã¼ã¹ã§ãã£ãå ´åã ãã®é¢æ°ã¯ããã¹ã¦ã®ãã¼ã¿ãèªã¿è¾¼ã¾ããã¾ã§ãããã¯ãã¾ãã </simpara> </note> </listitem> </varlistentry> <varlistentry> <term> <constant>STREAM_WILL_CAST</constant> </term> <listitem> <simpara> ããããªãã®æ¡å¼µã¢ã¸ã¥ã¼ã«ããµã¼ããã¼ãã£ã®ã©ã¤ãã©ãªãå©ç¨ãã¦ãã¦ã ãã®ã©ã¤ãã©ãªã«ã¯ FILE* ããã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ã渡ããªãã¦ã¯ ãªããªãã¨ãããã®ãã©ã°ã使ãã¨ãã¹ããªã¼ã API ã«ãªã½ã¼ã¹ã ãªã¼ãã³ãã¦ãããããã¡ãªã³ã°ã¯è¡ããªãããæç¤ºãããã¨ãã§ãã¾ãã ãã®å¾ã<function>php_stream_cast</function> ã使ãããã®ã©ã¤ãã©ãªã® å¿ è¦ã¨ãã FILE* ã ãã¡ã¤ã«ãã£ã¹ã¯ãªãã¿ãåå¾ã§ãã¾ãã </simpara> <simpara> ãã®ãã©ã°ã¯ HTTP URL ã«ã¢ã¯ã»ã¹ããã¨ãã å®éã®ã¹ããªã¼ã ã®ãã¼ã¿ãä¸å®ãªãªãã»ããã®å ããå§ã¾ããããª å ´åã«ããã¦ãç¹ã«æç¨ã§ãã </simpara> <simpara> ãã®ãªãã·ã§ã³ã¯ã¹ããªã¼ã API ã®ã¬ãã«ã§ã®ãããã¡ãªã³ã°ã ç¡å¹ã«ãããããã¹ããªã¼ã 颿°ã®ããã©ã¼ãã³ã¹ãæªããªããã ããã¾ãããããã®ãªãã·ã§ã³ãå©ç¨ããã¨ãããã¨ã¯ãããªãã ã¹ããªã¼ã ã®èå¾ã«ããå®è£ ã«åããããã ã¹ããªã¼ã API 颿°ã使ããã¨ãã¹ããªã¼ã ã«å®£è¨ããã¨ããã㨠ã§ããããããã¯è¨±å®¹ç¯å²å ã¨èãããã¾ãã ãã®ãªãã·ã§ã³ã¯æ¬å½ã«å¿ è¦ã ã¨ç¢ºä¿¡ãããã¨ãã«ã®ã¿ç¨ãã¦ãã ããã </simpara> </listitem> </varlistentry> </variablelist> </para> </refsect1> </refentry> </sect1> <!-- 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-ja/internals/streams/common.xml?r=1.1&p=1 Index: phpdoc-ja/internals/streams/common.xml +++ phpdoc-ja/internals/streams/common.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.1 Maintainer: hirokawa Status: ready --> <!-- CREDITS: shimooka,takagi --> <!-- Author: Wez Furlong <wez@thebrainroom.com> Please contact me before making any major amendments to the content of this section. Splitting/Merging are fine if they are required for php-doc restructuring purposes - just drop me a line if you make a change (so I can update my local copy). --> <sect1 id="streams.common-api"> <title>ã¹ããªã¼ã å ±éAPIãªãã¡ã¬ã³ã¹</title> <refentry id="streams.php-stream-stat-path"> <refnamediv> <refname>php_stream_stat_path</refname> <refpurpose>ãã¡ã¤ã«ã¾ãã¯URLã®ã¹ãã¼ã¿ã¹ãå¾ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_stat_path</methodname> <methodparam><type>char *</type><parameter>path</parameter></methodparam> <methodparam><type>php_stream_statbuf *</type><parameter>ssb</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_stat_path</function> ã¯ã <parameter>path</parameter>ã§æå®ãããã¡ã¤ã«ã¾ãã¯URLã調ã¹ã ãã¡ã¤ã«ãµã¤ãºãã¢ã¯ã»ã¹æ¨©ãä½ææ¥æã¨ãã£ãæ å ±ãè¿ãã¾ãã è¿ãå¤ã¯æåæã«0ãã¨ã©ã¼æã«-1ã¨ãªãã¾ããè¿ãããæ å ±ã®è©³ç´°ã« ã¤ãã¦ã¯ã <link linkend="streams.struct-php-stream-statbuf">php_stream_statbuf</link> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-stat"> <refnamediv> <refname>php_stream_stat</refname> <refpurpose>ã¹ããªã¼ã ãä¿æããã¹ãã¬ã¼ã¸ã«é¢ããæ å ±ãå¾ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_stat</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>php_stream_statbuf *</type><parameter>ssb</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_stat</function> ã¯ã<parameter>stream</parameter> ã«ãã¤ã³ãããã¦ããã¹ãã¬ã¼ã¸ã«é¢ããæ å ±ã調ã¹ããã¡ã¤ã«ãµã¤ãºã ã¢ã¯ã»ã¹æ¨©ãä½ææ¥æã¨ãã£ãæ å ±ãè¿ãã¾ãã è¿ãå¤ã¯æåæã«0ãã¨ã©ã¼æã«-1ã¨ãªãã¾ããè¿ãããæ å ±ã®è©³ç´°ã« ã¤ãã¦ã¯ã <link linkend="streams.struct-php-stream-statbuf">php_stream_statbuf</link> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-open-wrapper"> <refnamediv> <refname>php_stream_open_wrapper</refname> <refpurpose>ãã¡ã¤ã«ã¾ãã¯URLããªã¼ãã³ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>php_stream *</type><methodname>php_stream_open_wrapper</methodname> <methodparam><type>char *</type><parameter>path</parameter></methodparam> <methodparam><type>char *</type><parameter>mode</parameter></methodparam> <methodparam><type>int</type><parameter>options</parameter></methodparam> <methodparam><type>char **</type><parameter>opened</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_open_wrapper</function> 㯠<parameter>path</parameter> ã§æå®ããããã¡ã¤ã«ãURLãªã©ã®ã©ããããããªã½ã¼ã¹ã®ã¹ããªã¼ã ãéãã¾ãã <parameter>mode</parameter> ã«ãã£ã¦ãã¹ããªã¼ã ãèªã¿åºãç¨ãæ¸ãåºãç¨ã 追è¨ç¨ããããã¯ãã®çµã¿åããã§éããã¨ãã§ãã¾ããæå®ã§ãã種ã ã®ã¢ã¼ã ã«ã¤ãã¦ã¯ä¸è¨ã®è¡¨ãã覧ãã ããããããã®æååã«å ããæå 'b' ã ã¢ã¼ãæååã®2æåç®ãã¾ãã¯æ«å°¾ã«å«ãããã¨ãã§ãã¾ãã ãã®æå 'b' ã¯ã該å½ããã¹ããªã¼ã ã®å®è£ ã«å¯¾ãããã¤ããªã»ã¼ããªã¢ã¼ãã§ ã¹ããªã¼ã ãéãããæç¤ºãã¾ãã </para> <para> æå 'b' ã¯ããã¹ã¦ã® POSIX ã«æºæ ããã·ã¹ãã ä¸ã§ã¯ããã¤ããªãã¡ã¤ã«ã¨ ããã¹ããã¡ã¤ã«ãååã«æ±ããããããç¡è¦ããã¾ããã¢ã¯ã»ã¹ãããã¼ã¿ ã«ããã¦ã8 ããããã¹ã¦ãéè¦ãªéã«ã¯ããã® 'b' æåãæå®ãã¦ããã®ã¯ã 'b' ãã©ã°ãæå³ãæã¤ã·ã¹ãã ã§ãåãã¹ã¯ãªãããåãããã®ã§ã ããã¢ã¤ãã£ã¢ã¨ããã¾ãã </para> <para> ã¹ããªã¼ã API ã«ãã£ã¦ä½æããããã¹ã¦ã®ãã¼ã«ã«ã«ãããã¡ã¤ã«ã® ãã¼ããã·ã§ã³ã¯ããªãã¬ã¼ãã£ã³ã°ã·ã¹ãã ã®ããã©ã«ãã«å¾ã£ã¦ è¨å®ããã¾ã - Unix ãã¼ã¹ã®ã·ã¹ãã ã§ã¯ããã¡ã¤ã«ã使ããããã»ã¹ã® umask ãåæ ããã¾ããã¾ããWindows ã§ã¯ããã¡ã¤ã«ã使ããããã»ã¹ã ãã¡ã¤ã«ãææãã¾ãã ãªã¢ã¼ãã«ãããã¡ã¤ã«ã«ã¤ãã¦ã¯ããã¡ã¤ã«ãéãã®ã«ç¨ãã URL ã©ããã¼ ã®è¨å®ãããªã¢ã¼ãã®ãµã¼ãã«ä¸ããããä¿¡é ¼æ å ±ã«å¿ãã¦ä½æããã¾ãã </para> <para> <variablelist> <varlistentry> <term> <constant>r</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãèªã¿åºãç¨ã«éãã¾ãããã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ã ãã¡ã¤ã«ã®å é ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>r+</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãèªã¿æ¸ãç¨ã«éãã¾ãããã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ã ãã¡ã¤ã«ã®å é ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>w</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ã®å 容ãé·ã 0 ã«åãè©°ããããæ°è¦ã«ãã¡ã¤ã«ã使ãã æ¸ãåºãã¢ã¼ãã§éãã¾ãããã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ã ãã¡ã¤ã«ã®å é ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>w+</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãèªã¿æ¸ãç¨ã«éãã¾ããããæå®ããããã¡ã¤ã«ãåå¨ ããªãå ´åã¯ãæ°è¦ã«ä½æããåå¨ããå ´åã¯ãé·ããåãè©°ãã¾ãã ãã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ããã¡ã¤ã«ã®å é ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>a</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãæ¸ãåºãç¨ã«éãã¾ãããããã¡ã¤ã«ãåå¨ããªãå ´åã¯ã æ°è¦ã«ä½æãã¾ãããã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ããã¡ã¤ã«ã® æ«å°¾ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> <varlistentry> <term> <constant>a+</constant> </term> <listitem> <simpara> ãã¡ã¤ã«ãèªã¿æ¸ãç¨ã«éãã¾ããããæå®ããããã¡ã¤ã«ãåå¨ ããªãå ´åã¯ãæ°è¦ã«ä½æãã¾ãããã®ã¨ããã¹ããªã¼ã ã®ä½ç½®ã¯ã ãã¡ã¤ã«ã®æ«å°¾ã«ç§»åããã¾ãã </simpara> </listitem> </varlistentry> </variablelist> </para> <para> <parameter>options</parameter> ã¯ãã¹ããªã¼ã ã¸ã®ãã¹ã URL ãã©ã®ããã« è§£éãããããã»ã¼ãã¢ã¼ããã§ãã¯ãã¹ããªã¼ã ãéãã¨ãã«ã¨ã©ã¼ã çºçããå ´åã®ã¢ã¯ã·ã§ã³ã«å½±é¿ãã¾ãããã®ãªãã·ã§ã³ã«é¢ãã¦ã¯ã <link linkend="streams.options">Stream open options</link> ãåç §ãã ããã </para> <para> ãã <parameter>opened</parameter> ã NULL ã§ãªããã°ãå®éã« éããããã¡ã¤ã«ããªã½ã¼ã¹ã®ååãã»ããããã¾ããããã¯ã ãªãã·ã§ã³ã« include_path ã«åæããããã¹ãããã¡ã¤ã«ãæ¢ãããæç¤ºãã <constant>USE_PATH</constant> ãå«ã¾ãã¦ããæã«éè¦ã«ãªãã¾ãã å¼ã³åºãå ã¯ãæå¾ã«ãã®ãã©ã¡ã¼ã¿ã«ãã£ã¦è¿ããããã¡ã¤ã«åã <function>efree</function> ã®å¼ã³åºãã«ãã£ã¦éæ¾ããå¿ è¦ãããã¾ãã </para> <note> <simpara> ããã<constant>STREAM_MUST_SEEK</constant> ã <parameter>options</parameter> ã«æå®ããå ´åã<parameter>opened</parameter> ã«è¿ããããã¡ã¤ã«ã¸ã®ãã¹ ã¯ãå®éã«è¿ãããã¹ããªã¼ã ã®ãã®ã¨éãå ´åãããã¾ãããããããã㯠ã·ã¼ã¯å¯è½ãªã¹ããªã¼ã ãä½ãã®ã«ç¨ããããå ã®ã¹ããªã¼ã ã®ååã«ãªãã¾ãã </simpara> </note> </refsect1> </refentry> <refentry id="streams.php-stream-read"> <refnamediv> <refname>php_stream_read</refname> <refpurpose>ã¹ããªã¼ã ãããããã¡ã«æå®ãã¤ãæ°èªã¿è¾¼ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>size_t</type><methodname>php_stream_read</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>char *</type><parameter>buf</parameter></methodparam> <methodparam><type>size_t</type><parameter>count</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_read</function> 㯠<parameter>count</parameter> ãã¤ãã§æå®ããããã¤ãæ°ã¾ã§ <parameter>stream</parameter> ãã ãã¼ã¿ãèªã¿åãããããã¡ <parameter>buf</parameter> ã«ã³ãã¼ãã¾ãã </para> <para> <function>php_stream_read</function> ã¯ãæ£å¸¸ã«èªã¿è¾¼ããã¨ã®ã§ãã ãã¤ãæ°ãè¿ãã¾ããèªã¿è¾¼ã¿ã失æããã®ãããã¡ã¤ã«ã®çµç«¯ã«éããã®ã ããããç¥ããã¨ã¯ã§ãã¾ããã®ã§ã<function>php_stream_eof</function> ãã<constant>EOF</constant> æ¡ä»¶ã®ãã¹ãã«ä½¿ãã¾ãã </para> <para> ã¹ããªã¼ã ã®å é¨ä½ç½®ã¯ã次å以éç¶ãããèªããããã èªã¿è¾¼ã¾ããåã ãé²ãããã¾ãã </para> <para> ããã<parameter>count</parameter> ãã¤ããããå°ãªããã¼ã¿ããæã£ã¦ ããªãå ´åããã®é¢æ°ã¯ãã¹ããªã¼ã ã®ãããã¯ã¢ã¼ãã®è¨å®ã«å¿ãã¦ã ãã¹ã¦ã®ãã¼ã¿ãæãã¾ã§ãããã¯ãã¾ã(å¾ ã¡ã¾ã)ãããã©ã«ãã§ã¯ã ã¹ããªã¼ã ã¯ãããã¯ã¢ã¼ãã§éããã¾ãã ããé常ã®ãã¡ã¤ã«ããèªã¿è¾¼ãå ´åã¯ããããã¯ã¢ã¼ãã¯ãã¾ãæå³ã æã¡ã¾ãããã¹ããªã¼ã ãã<constant>EOF</constant> ã«éããå ´åã¯ã <function>php_stream_read</function> ã¯ã<parameter>count</parameter> ãããå°ãªãå¤ãè¿ããæ¬¡å以éã¯ã0 ãè¿ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-write"> <refnamediv> <refname>php_stream_write</refname> <refpurpose>ãããã¡ããã¹ããªã¼ã ã«æå®ãã¤ãæ°æ¸ãè¾¼ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>size_t</type><methodname>php_stream_write</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>const char *</type><parameter>buf</parameter></methodparam> <methodparam><type>size_t</type><parameter>count</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_write</function> ã¯ã<parameter>count</parameter> ãã¤ãã®ãã¼ã¿ã <parameter>buf</parameter> ãã <parameter>stream</parameter> ã«æ¸ãåºãã¾ãã </para> <para> <function>php_stream_write</function> ã¯æ£å¸¸ã«æ¸ãè¾¼ããã¨ã®ã§ãã ãã¤ãæ°ãè¿ãã¾ãããããä½ããã®ã¨ã©ã¼ããã£ãå ´åã¯ã æ¸ãè¾¼ããã¨ã®ã§ãããã¤ãæ°ã¯ <parameter>count</parameter> ããã å°ãããªãã¾ãã </para> <para> ã¹ããªã¼ã ã®å é¨ä½ç½®ã¯ã次å以éç¶ãããæ¸ãè¾¼ããããã èªã¿è¾¼ã¾ããåã ãé²ãããã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-eof"> <refnamediv> <refname>php_stream_eof</refname> <refpurpose>ã¹ããªã¼ã ããã¡ã¤ã«çµç«¯ã«éãããã©ãã調ã¹ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_eof</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_eof</function> ã¯ã<parameter>stream</parameter> ãã ãã¡ã¤ã«ã®çµç«¯ã«éãããã©ããã調ã¹ã¾ãã </para> <para> <function>php_stream_eof</function> ã 1 ãè¿ãã¨ãããã¨ã¯ã <constant>EOF</constant> ã«éãããã¨ãæå³ãã¾ãã0 ãªãã°ã ã¾ã <constant>EOF</constant> ã§ãªãã-1 ã¯ã¨ã©ã¼ãæå³ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-getc"> <refnamediv> <refname>php_stream_getc</refname> <refpurpose>ã¹ããªã¼ã ãã1ãã¤ãèªã¿è¾¼ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_getc</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_getc</function> 㯠<parameter>stream</parameter> ãã 1 æåèªã¿è¾¼ã¿ãunsigned char ã int ã¨ãã¦ãã£ã¹ããã形㧠è¿ãã¾ãã ãã¡ã¤ã«ã®çµç«¯ã«éããããã¨ã©ã¼ãçºçããå ´åã¯ã <constant>EOF</constant> ãè¿ãã¾ãã </para> <para> <function>php_stream_getc</function> ã®ãããã¯ã«é¢ããæåã¯ã <function>php_stream_read</function> ã®ãã®ã¨ä¸ç·ã§ãã </para> <para> æ£å¸¸ã«å®è¡ã§ããå ´åãã¹ããªã¼ã ã®å é¨ä½ç½®ã¯ 1 ã ãé²ãããã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-gets"> <refnamediv> <refname>php_stream_gets</refname> <refpurpose>ã¹ããªã¼ã ãããããã¡ã«1è¡åã®ãã¼ã¿ãèªã¿è¾¼ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>char *</type><methodname>php_stream_gets</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>char *</type><parameter>buf</parameter></methodparam> <methodparam><type>size_t</type><parameter>maxlen</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_gets</function> ã¯ãæå¤§ã§ <parameter>count</parameter>-1 ãã¤ãã¾ã§ã®ãã¼ã¿ã <parameter>stream</parameter> ããèªã¿è¾¼ã¿ã ãããã¡ <parameter>buf</parameter> ã«ã³ãã¼ãã¾ããèªã¿è¾¼ã¿ã¯ã <constant>EOF</constant> ãããã¯è¡æ«è¨å·ã«å°éããæç¹ã§ã¹ããããã¾ãã ãããè¡æ«ã¾ã§èªã¿è¾¼ã¾ããå ´åãè¡æ«è¨å·ã¯ã<parameter>buf</parameter> ã®ä¸é¨ã¨ãã¦å«ã¾ãã¾ããNUL çµç«¯æåãããããã¡ã®æ«å°¾ã«ä»å ããã¾ãã </para> <para> <function>php_stream_read</function> ã¯æ£å¸¸ã«çµäºããã¨ã<parameter>buf</parameter> ãããã®ä»ã®å ´å㯠NULL ãè¿ãã¾ãã </para> <para> ã¹ããªã¼ã ã®å é¨ä½ç½®ã¯ã次å以éç¶ãããèªããããã èªã¿è¾¼ã¾ããåã ãé²ãããã¾ãã </para> <para> ãã®é¢æ°ã®ãããã¯ã«é¢ããæåã¯ã<function>php_stream_read</function> ã®ãã®ã¨ä¸ç·ã§ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-close"> <refnamediv> <refname>php_stream_close</refname> <refpurpose>ã¹ããªã¼ã ãéãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_close</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_close</function> ã¯ã<parameter>stream</parameter> ã å®å ¨ã«ã¯ãã¼ãºããããã«é¢é£ä»ãããããªã½ã¼ã¹ãåæã«éæ¾ãã¾ãã 䏿¦ <parameter>stream</parameter> ãéããã¨ããã®å¤ã¯ä¸å®ã«ãªãã¾ãã åã³å©ç¨ãã¦ã¯ããã¾ããã </para> <para> <function>php_stream_close</function> ã¯æ£å¸¸ã«ã¹ããªã¼ã ãéãããã å ´åã0 ããã¨ã©ã¼ãçºçããå ´åã«ã¯ã<constant>EOF</constant> ãè¿ãã¾ãã颿°ã®å®è¡ã®æå¦ã«ãããããã<parameter>stream</parameter> ã¯ä¸å®ã«ãªãã¾ãã®ã§ããã®é¢æ°ã®å®è¡å¾ã«å©ç¨ãã¦ã¯ããã¾ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-flush"> <refnamediv> <refname>php_stream_flush</refname> <refpurpose>ã¹ããªã¼ã ãããã¡ãã¹ãã¬ã¼ã¸ã«ãã©ãã·ã¥ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_flush</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_flush</function> ã¯ã<parameter>stream</parameter> ã®æ¸ãè¾¼ã¿ãããã¡ã«ä¿æããããã¼ã¿ãä¸å±¤ã«ããã¹ãã¬ã¼ã¸ã« ã³ããããã¾ãã </para> <para> <function>php_stream_flush</function> ã¯ããããã¡ããã©ãã·ã¥ã§ããå ´åã« ãããã¯ããããã¡ããã©ãã·ã¥ããå¿ è¦ããªãã£ãå ´åã«ã0 ãè¿ãã¾ãã ã¨ã©ã¼ãçºçããå ´åã¯ã<constant>EOF</constant> ãè¿ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-seek"> <refnamediv> <refname>php_stream_seek</refname> <refpurpose>ã¹ããªã¼ã å ã§ç§»åãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_seek</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>off_t</type><parameter>offset</parameter></methodparam> <methodparam><type>int</type><parameter>whence</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_seek</function> 㯠<parameter>stream</parameter> ã®å é¨ä½ç½®ãç§»åãã¾ãã æ°ããä½ç½®ã¯ã<parameter>offset</parameter> ã®å¤ãã <parameter>whence</parameter> ã§ç¤ºãããä½ç½®ã«å ç®ãããã¨ã§æ±ºå®ããã¾ãã <parameter>whence</parameter> ã <constant>SEEK_SET</constant> ã«ã»ãã ããã¦ããå ´åã¯ãã¹ããªã¼ã ã®éå§ä½ç½®ãã<constant>SEEK_CUR</constant> ã®å ´åã¯ãã¹ããªã¼ã ã®ç¾å¨ä½ç½®ãã<constant>SEEK_END</constant> ã®å ´åã¯ã ã¹ããªã¼ã ã®çµç«¯ä½ç½®ããããããè¨ç®ã®åºæºã¨ãã¾ãã </para> <para> <function>php_stream_seek</function> ã¯æåæã« 0 ãã失ææã« -1 ã è¿ãã¾ãã </para> <note> <para> ãã¹ã¦ã®ç¨®é¡ã®ã¹ããªã¼ã ãã·ã¼ã¯åä½ããµãã¼ããã¦ããããã§ã¯ ããã¾ããããã¹ããªã¼ã API ã¯ã<parameter>whence</parameter> <constant>SEEK_CUR</constant> ã«è¨å®ããã¦ãã¦ãã㤠<parameter>offset</parameter> ãæ£ã®å¤ã®å ´åã <function>php_stream_read</function> ã§ <parameter>offset</parameter> ãã¤ãåã ãèªã¿è¾¼ãã§ãèªã¿è¾¼ã¾ããå 容ãç ´æ£ãããã¨ã§ãã·ã¼ã¯ã ã¨ãã¥ã¬ã¼ããããã¨ãã¾ãã </para> <para> ã¨ãã¥ã¬ã¼ã·ã§ã³ã¯ãä¸å±¤ã«ããã¹ããªã¼ã ã®å®è£ ããã·ã¼ã¯ããµãã¼ã ãã¦ããªãã¨ãã®ã¿ã«è¡ããã¾ããã¤ã¾ããä»®ã«éããã¦ããã¹ããªã¼ã ã ãã¡ã¤ã«ãã¼ã¹ã®ã¹ããªã¼ã ã§ããããã·ã¼ã¯ã§ããªããã¤ãã ã©ãããã¦ããã¨ãã¦ããã¹ããªã¼ã API ã¯ã¨ãã¥ã¬ã¼ã·ã§ã³ãè¡ãã¾ããã ãã¡ã¤ã«ãã¼ã¹ã®ã¹ããªã¼ã ã¯ã·ã¼ã¯åä½ãå®è£ ãã¦ããããã§ãã ãã®ã¨ããã·ã¼ã¯ã¯å¤±æããã¨ã©ã¼ãå¼ã³åºãå ã«è¿ããã¾ãã </para> </note> </refsect1> </refentry> <refentry id="streams.php-stream-tell"> <refnamediv> <refname>php_stream_tell</refname> <refpurpose>ã¹ããªã¼ã å ã®ä½ç½®ã調ã¹ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>off_t</type><methodname>php_stream_tell</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_tell</function> ã¯ã<parameter>stream</parameter> ã® å é¨ä½ç½®ãã¹ããªã¼ã ã®éå§ä½ç½®ããã®ç¸å¯¾å¤ã§è¿ãã¾ãã ã¨ã©ã¼ãçºçããå ´å㯠-1 ãè¿ããã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-copy-to-stream"> <refnamediv> <refname>php_stream_copy_to_stream</refname> <refpurpose> ããã¹ããªã¼ã ããå¥ã®ã¹ããªã¼ã ã¸ãã¼ã¿ãã³ãã¼ãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>size_t</type><methodname>php_stream_copy_to_stream</methodname> <methodparam><type>php_stream *</type><parameter>src</parameter></methodparam> <methodparam><type>php_stream *</type><parameter>dest</parameter></methodparam> <methodparam><type>size_t</type><parameter>maxlen</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_copy_to_stream</function> ã¯ãæå¤§ <parameter>maxlen</parameter> ãã¤ãã®ãã¼ã¿ã <parameter>src</parameter> ããèªã¿è¾¼ã¿ã <parameter>dest</parameter> ã«æ¸ãåºããã®ã¡ãæ£å¸¸ã«ã³ãã¼ã§ãã ãã¤ãæ°ãè¿ãã¾ãã </para> <para> <parameter>src</parameter> ã¹ããªã¼ã ã«ããæ®ãã®(å é¨ä½ç½®ç§»è¡ã«ãã) ãã¼ã¿ãã¹ã¦ãã³ãã¼ãããå ´åã¯ã 宿° <constant>PHP_STREAM_COPY_ALL</constant> ãã <parameter>maxlen</parameter> ã«æå®ãã¦ãã ããã </para> <note> <simpara> ãã®é¢æ°ã¯ããã¼ã¿ããã¡ã¢ãªããããã§ããã°ããã使ãã æå¤§éå¹ççãªæ¹æ³ã§ã³ãã¼ãè¡ããã¨ãã¾ãã </simpara> </note> </refsect1> </refentry> <refentry id="streams.php-stream-copy-to-mem"> <refnamediv> <refname>php_stream_copy_to_mem</refname> <refpurpose> ã¹ããªã¼ã ãã確ä¿ããããããã¡ã«ãã¼ã¿ãã³ãã¼ãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>size_t</type><methodname>php_stream_copy_to_mem</methodname> <methodparam><type>php_stream *</type><parameter>src</parameter></methodparam> <methodparam><type>char **</type><parameter>buf</parameter></methodparam> <methodparam><type>size_t</type><parameter>maxlen</parameter></methodparam> <methodparam><type>int</type><parameter>persistent</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_copy_to_mem</function> 㯠<parameter>maxlen</parameter>+1 ãã¤ãã®ãããã¡ã <function>pemalloc</function> (ãã©ã¡ã¼ã¿ <parameter>persistent</parameter> ã¯ãã®ã¾ã¾æ¸¡ããã¾ã) ã使ã£ã¦ãããã¡ã確ä¿ããã®ã¡ãæå¤§ <parameter>maxlen</parameter> ãã¤ãã <parameter>src</parameter> ããèªã¿è¾¼ãã§ããã®å 容ã確ä¿ããããããã¡ã« æ ¼ç´ãã¾ãã </para> <para> 確ä¿ããããããã¡ã <parameter>buf</parameter> ã§ç¤ºããããã¤ã³ã¿ã« è¿ããã®ã¡ãæ£å¸¸ã«èªã¿è¾¼ãããã¤ãæ°ãè¿ãã¾ãã å¼ã³åºãä¸ã¯ãè¿ããããããã¡ããåã <parameter>persistent</parameter> ãã©ã¡ã¼ã¿ã¨ã¨ãã« <function>pefree</function> ã§éæ¾ããå¿ è¦ãããã¾ãã </para> <para> <parameter>src</parameter> ã¹ããªã¼ã ã«ããæ®ãã®(å é¨ä½ç½®ç§»è¡ã«ãã) ãã¼ã¿ãã¹ã¦ãã³ãã¼ãããå ´åã¯ã 宿° <constant>PHP_STREAM_COPY_ALL</constant> ãã <parameter>maxlen</parameter> ã«æå®ãã¦ãã ããã </para> <note> <simpara> ãã®é¢æ°ã¯ããã¼ã¿ããã¡ã¢ãªããããã§ããã°ããã使ãã æå¤§éå¹ççãªæ¹æ³ã§ã³ãã¼ãè¡ããã¨ãã¾ãã </simpara> </note> </refsect1> </refentry> <refentry id="streams.php-stream-make-seekable"> <refnamediv> <refname>php_stream_make_seekable</refname> <refpurpose>ã¹ããªã¼ã ãã·ã¼ã¯å¯è½ãªã¹ããªã¼ã ã¸å¤æãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_make_seekable</methodname> <methodparam><type>php_stream *</type><parameter>origstream</parameter></methodparam> <methodparam><type>php_stream **</type><parameter>newstream</parameter></methodparam> <methodparam><type>int</type><parameter>flags</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_make_seekable</function> ã¯ãã¾ã <parameter>origstream</parameter> ã ã·ã¼ã¯å¯è½ãã©ãã調ã¹ã¾ããããã·ã¼ã¯ã§ããªãå ´åã¯ãæ°ãã«ä¸æçã¹ããªã¼ã ãä½ããå ã®ã¹ããªã¼ã ã®ãã¼ã¿ããã¹ã¦ããã«ã³ãã¼ãã¾ãã æåã®å ´åã¯ã<parameter>newstream</parameter> ã«ã¯ãå ã®ã¹ããªã¼ã ã ã·ã¼ã¯å¯è½ã ã£ãã¨ãã¦ãã常ã«å©ç¨å¯è½ãªã¹ããªã¼ã ãè¿ããã¾ãã </para> <para> <parameter>flags</parameter> ã§ãã©ã®ãããªå½¢ã®ã·ã¼ã¯å¯è½ãªã¹ããªã¼ã ã è¿ãããããæå®ãããã¨ãã§ãã¾ããããã©ã«ãã®ã·ã¼ã¯å¯è½ãªã¹ããªã¼ã ã å©ç¨ãããå ´åã¯ã<constant>PHP_STREAM_NO_PREFERENCE</constant> ã (é常ã§ã¯åçã«å¢å¤§ããã¡ã¢ãªä¸ã®ãããã¡ãå©ç¨ãããã ããã¹ããªã¼ã å ã®ãã¼ã¿ã巨大ãªå ´åã¯ããã³ãã©ãªãã¡ã¤ã«ã«è£æã¡ããã ã¹ããªã¼ã ã«åãæ¿ãã)ãã¾ãã¯é常ã®ãã³ãã©ãªãã¡ã¤ã«ã«è£æã¡ããã ã¹ããªã¼ã ãå©ç¨ãããå ´åã¯ã<constant>PHP_STREAM_PREFER_STDIO</constant> ãæå®ãã¦ãã ããã </para> <para> <table> <title><function>php_stream_make_seekable</function> ã®è¿ãå¤</title> <tgroup cols="2"> <thead> <row> <entry>Value</entry> <entry>Meaning</entry> </row> </thead> <tbody> <row> <entry>PHP_STREAM_UNCHANGED</entry> <entry>å ã®ã¹ããªã¼ã ãã·ã¼ã¯å¯è½ã ã£ãã<parameter>newstream</parameter> ã«ã¯ <parameter>origstream</parameter> ãã»ããããã¾ãã </entry> </row> <row> <entry>PHP_STREAM_RELEASED</entry> <entry>å ã®ã¹ããªã¼ã ã¯ã·ã¼ã¯å¯è½ã§ã¯ãªãã®ã§ãéæ¾ãããã <parameter>newstream</parameter> ã«ã¯ãæ°ãã«ä½æãããã·ã¼ã¯å¯è½ãªã¹ããªã¼ã ãã»ããããã¾ãã 以å¾ã<parameter>origstream</parameter> ã«ã¢ã¯ã»ã¹ãã¦ã¯ããã¾ããã </entry> </row> <row> <entry>PHP_STREAM_FAILED</entry> <entry>ã¹ããªã¼ã ã®å¤æä¸ã«ã¨ã©ã¼ãçºçããã <parameter>newstream</parameter> ã«ã¯ NULL ãã»ããããã¾ãã ãã®ã¨ã <parameter>origstream</parameter> ã¯ã¾ã æå¹ãªã¹ããªã¼ã ã§ãã </entry> </row> <row> <entry>PHP_STREAM_CRITICAL</entry> <entry>ã¹ããªã¼ã ã®å¤æä¸ã«ã¨ã©ã¼ãçºçããå ã®ã¹ããªã¼ã 㯠<parameter>origstream</parameter> ä¸å®ãªç¶æ ã«ãªã£ã¦ããã<parameter>newstream</parameter> ã«ã¯ NULL ãã»ããããã¾ãããã®ã¨ãã¯ã<parameter>origstream</parameter> ãéãããã¨ãå¼·ãæ¨å¥¨ãã¾ãã </entry> </row> </tbody> </tgroup> </table> </para> <note> <simpara> æ°ããã¹ããªã¼ã ã«å¯¾ãã¦ã·ã¼ã¯ãè¡ãæ¸ãè¾¼ã¿ãè¡ããããªå ´åã ãã®ã¹ããªã¼ã ã¯ãå¿ ãããå ã®ã¹ããªã¼ã ã¨åããªã½ã¼ã¹ã« é¢é£ä»ãããã¦ããã¨ä¿è¨¼ããã¦ããããã§ã¯ãªãã®ã§ã ãã®é¢æ°ãå¼ã³åºãæå³ã¯ãã¾ãããã¾ããã </simpara> </note> <note> <simpara> ãããåæ¹ã¸ã®ã·ã¼ã¯ã®ã¿ãå¿ è¦ãªã¨ãã¯ããã®é¢æ°ãå©ç¨ãã¦ã¹ããªã¼ã ã ã·ã¼ã¯å¯è½ã«ããå¿ è¦ã¯ããã¾ãããã¹ããªã¼ã API ã¯ã whence ãã©ã¡ã¼ã¿ã <constant>SEEK_CUR</constant> ã®æãåæ¹ã·ã¼ã¯ã ã¨ãã¥ã¬ã¼ãããããã§ãã </simpara> </note> <note> <simpara> ããã<parameter>origstream</parameter> ããããã¯ã¼ã¯ãã¼ã¹ã®ã¹ããªã¼ã ã®å ´åã¯ããã®é¢æ°ã¯ããã¹ã¦ã®ãã¼ã¿ãèªã¿è¾¼ã¾ããã¾ã§ãããã¯ãã¾ãã </simpara> </note> <note> <simpara> 絶対ã«ãPHP ã¹ã¯ãªããå ã§ä½¿ç¨ããã¦ãããã¡ã¤ã«ãã¤ã³ã¿ãåç §ãã ã¹ããªã¼ã ãã<parameter>origstream</parameter> ã«æå®ããªãã§ãã ããã ãã®é¢æ°ã¯ããã®ã¹ããªã¼ã ãéããå ´åãããã®ã§ãã¹ã¯ãªããå ã§æ¬¡ã« ãã®ãã¡ã¤ã«ãã¤ã³ã¿ã«å¯¾ãã¦ã¢ã¯ã»ã¹ãè¡ãããå ´åã«ãã¯ã©ãã·ã¥ã èµ·ããå¯è½æ§ãããã¾ãã </simpara> </note> <note> <simpara> ã»ã¨ãã©ã®å ´åã«ããã¦ããã®é¢æ°ã¯ã<parameter>origstream</parameter> ãæ°ãã«éãããã¹ããªã¼ã ã§ããããã¹ããªã¼ã 層ã«ããã¦ãã¼ã¿ã ãããã¡ãªã³ã°ããã¦ããªãæã«ã®ã¿æåãã¾ããããã«ããã ã¾ãããã®é¢æ°ã¯æ£ãã使ãã«ã¯å¤å°è¤éãªã®ã§ãã§ããã°ã ãã®é¢æ°ãç´æ¥å¼ã³åºãã®ã§ã¯ãªãã <function>php_stream_open_wrapper</function> ã使ãã <constant>PHP_STREAM_MUST_SEEK</constant> ããªãã·ã§ã³ã¨ãã¦æ¸¡ãæ¹æ³ ãæ¤è¨ãã¦ã¿ã¦ãã ããã </simpara> </note> </refsect1> </refentry> <refentry id="streams.php-stream-cast"> <refnamediv> <refname>php_stream_cast</refname> <refpurpose> ã¹ããªã¼ã ãFILE*ã¾ãã¯ã½ã±ããã®ãããªä»ã®å½¢å¼ã«å¤æãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_cast</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>int</type><parameter>castas</parameter></methodparam> <methodparam><type>void **</type><parameter>ret</parameter></methodparam> <methodparam><type>int</type><parameter>flags</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_cast</function> 㯠<parameter>stream</parameter> ã§ æå®ãããã¹ããªã¼ã ã <parameter>castas</parameter> ã§æç¤ºããããªã½ã¼ã¹ã« 夿ãããã¨è©¦ã¿ã¾ãã ããã<parameter>ret</parameter> ã NULL ã§ãã£ãå ´åã¯ãå®éã« å¤æã¯è¡ããããåã«ã¹ããªã¼ã ã«å¯¾ãã¦ãã®ãããªå¤æãå¯è½ã§ãããã©ãã ã ãã調ã¹ã¾ãã(ãããããã®å ´åä½ããã®ã¹ããªã¼ã ã®ç¶æ ãå¤åãããã¨ã ããã¾ãã) ããã<parameter>flags</parameter> ã« <constant>REPORT_ERRORS</constant> ã ã»ããããã¦ããå ´åã¯ã夿ä¸ã«ã¨ã©ã¼ãããã¨ãã¨ã©ã¼ã¡ãã»ã¼ã¸ã 表示ããã¾ãã </para> <note> <para> ãã®é¢æ°ã¯ãæåæã« <constant>SUCCESS</constant> ãã失ææã« <constant>FAILURE</constant> ãè¿ãã¾ãã è¿ãå¤ã®å¤å®ã®éã¯åç´ã«å¤ã®çå½ãè¦ãã®ã§ã¯ãªãã 宿° <constant>SUCCESS</constant> ã <constant>FAILURE</constant> 㨠æç¤ºçã«æ¯è¼ããªããã°ãªããªããã¨ã«æ³¨æãã¦ãã ããã ãããã®å®æ°å¤ã¯åç´ãªãã¼ã«å¤ã§ã¯ãªãããã§ãã </para> </note> <para> <table> <title><parameter>castas</parameter> ã«æå®ã§ãããªã½ã¼ã¹ã®ç¨®é¡</title> <tgroup cols="2"> <thead> <row> <entry>å¤</entry> <entry>æå³</entry> </row> </thead> <tbody> <row> <entry>PHP_STREAM_AS_STDIO</entry> <entry>ã¹ããªã¼ã ã表ã ANSI FILE* ãã¡ã¤ã«ãã¤ã³ã¿ãè¦æ±ãã</entry> </row> <row> <entry>PHP_STREAM_AS_FD</entry> <entry>ã¹ããªã¼ã ã表ã POSIX ãã¡ã¤ã«ãã¹ã¯ãªãã¿ãè¦æ±ãã</entry> </row> <row> <entry>PHP_STREAM_AS_SOCKETD</entry> <entry>ã¹ããªã¼ã ã表ãã½ã±ããã®ãã¹ã¯ãªãã¿ãè¦æ±ãã</entry> </row> </tbody> </tgroup> </table> </para> <para> ä¸ã«ç¤ºãããããªåºæ¬çãªãªã½ã¼ã¹ã®ç¨®é¡ãæå®ããã®ã«å ãã 夿åä½ãããªã½ã¼ã¹ã®ç¨®é¡ã表ãå¤ã¨æ¬¡ã«ç¤ºããå¤ã¨ã OR æ¼ç®åã§ çµã¿åããããã¨ã§ãã¦ããããã¨ãã§ãã¾ã: <table> <title>Resource types for <parameter>castas</parameter></title> <tgroup cols="2"> <thead> <row> <entry>å¤</entry> <entry>æå³</entry> </row> </thead> <tbody> <row> <entry>PHP_STREAM_CAST_TRY_HARD</entry> <entry>å¥ã®ãªã½ã¼ã¹ãããã¦å©ç¨ãããªã©ãã§ããã ã夿ãæåãããããªè©¦è¡ãè¡ã</entry> </row> <row> <entry>PHP_STREAM_CAST_RELEASE</entry> <entry>ã¹ããªã¼ã API ã«ããã®é¢æ°ãå¼ã³åºãã ã¹ããªã¼ã API 以å¤ã®ã³ã¼ã (ããããã¯ãµã¼ããã¼ãã£ã®ã©ã¤ãã©ãª) ã®å é¨ã§ãã¹ããªã¼ã ãã©ãããã¦ãããªã½ã¼ã¹ããã³ãã«ãéãããã¨ã éç¥ãã¾ããããã«ããã<parameter>stream</parameter> ãã ã¹ããªã¼ã ã®èå¾ã«ãããã³ãã«ãã®ãã®ãéããã« <parameter>ret</parameter> ã«è¿ããã¨ããã§éãããã¾ãã ãã®ã¨ãããã®é¢æ°ãæåãããã <parameter>stream</parameter> ã¯ãã®æç¹ã§éããããã¨å¤æãããã¹ãã§ã 以éãã®ã¹ããªã¼ã ã使ã£ã¦ã¯ããã¾ããã </entry> </row> </tbody> </tgroup> </table> </para> <note> <simpara> ãã使ã£ã¦ããã·ã¹ãã (glibc 2 ã¾ãã¯ä»¥éã使ã£ã¦ããã·ã¹ãã )ã <function>fopencookie</function> ããµãã¼ããã¦ããå ´åã ã¹ããªã¼ã API ã¯å¸¸ã«ã©ã®ã¹ããªã¼ã ããã ANSI FILE * ãã¤ã³ã¿ã åæã§ãã¾ãããã®ç¹é·ã¯ãããã PHP ã¹ããªã¼ã ããµã¼ããã¼ãã£ã® ã©ã¤ãã©ãªã«æ¸¡ããã®ã§é常ã«ä¾¿å©ã§ããã䏿¹ã§ãç§»æ¤å¯è½æ§ã¯é«ã ããã¾ããããã®å ´åã¯ãããªãã®ä½æããæ¡å¼µã¢ã¸ã¥ã¼ã«ãé å¸ããéã«ã ç§»æ¤å¯è½æ§ã«ã¤ãã¦ã®è¡¨ç¤ºãè¡ã£ã¦ãããã»ããããã§ãããã ãã fopencookie ã«ããåæãæã¾ãããªãå ´åã¯ãåé¡ã¨ããã¹ããªã¼ã ã ãã¤ãã£ãã« FILE* ããµãã¼ããã¦ãããã©ãã <function>php_stream_is</function> ã§èª¿ã¹ã¾ãããã </simpara> </note> <note> <simpara> ã½ã±ãããã¼ã¹ã®ã¹ããªã¼ã ã FILE* ã«å¤æããéãã¹ããªã¼ã API 㯠<function>fdopen</function> ã使ã£ã¦ãããçæãã¾ãã ãããããã¨ã¯ãã¹ããªã¼ã API ã®ã³ã¼ã«ã¨ ANSI æ¨æºå ¥åºå API ã®ã³ã¼ã«ã 交äºã«è¡ã£ãéã«ãã¹ããªã¼ã 層ã«ããã¦ãããã¡ããããã¼ã¿ã失ããã å±éºæ§ãçãããã¨ã«æ³¨æãã¦ãã ããã </simpara> </note> <para> <function>php_stream_is</function> 㨠<function>php_stream_can_cast</function> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-can-cast"> <refnamediv> <refname>php_stream_can_cast</refname> <refpurpose> ã¹ããªã¼ã ãFILE*ã¾ãã¯ã½ã±ããã®ãããªä»ã®å½¢å¼ã«å¤æã§ãããã©ããã 調ã¹ã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_can_cast</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>int</type><parameter>castas</parameter></methodparam> </methodsynopsis> <para> ãã®é¢æ°ã®æåã¯ã<function>php_stream_cast</function> ã® <parameter>ret</parameter> 弿°ã NULL ã«ãã<parameter>flags</parameter> ã 0 ã«ããæã®å¼ã³åºãã¨ç価ã§ãã è¦æ±ãããå½¢ã«ã¹ããªã¼ã ã夿ã§ããã¨ãã¯ã<constant>SUCCESS</constant> ãã夿ãã§ããªãã¨ãã¯ã<constant>FAILURE</constant> ãè¿ãã¾ãã </para> <note> <simpara> ãã®é¢æ°ã¯å®éã«å¤æãè¡ãããã§ã¯ããã¾ããããä½ããã®ã¹ããªã¼ã ã®ç¶æ ã å¤åããå¯è½æ§ãããã¾ãã </simpara> </note> <note> <simpara> ãã®é¢æ°ã®è¿ãå¤ã¯ã<function>php_stream_cast</function> ã§èª¬æãããããã«ã æç¤ºçã«å®æ°ã¨æ¯è¼ãããå¿ è¦ãããã¾ãã </simpara> </note> <para> <function>php_stream_cast</function> 㨠<function>php_stream_is</function> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-is-persistent"> <refnamediv> <refname>php_stream_is_persistent</refname> <refpurpose> ã¹ããªã¼ã ãæç¶çãªã¹ããªã¼ã ã§ãããã©ããã調ã¹ã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_is_persistent</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_is_persistent</function> ã¯ãã¹ããªã¼ã ãæä¹ çã§ããã¨ã1 ããããã§ãªãå ´å㯠0 ãè¿ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-is"> <refnamediv> <refname>php_stream_is</refname> <refpurpose>ã¹ããªã¼ã ãç¹å®ã®åã§ãããã©ããã調ã¹ã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_stream_is</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> <methodparam><type>int</type><parameter>istype</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_is</function> 㯠<parameter>stream</parameter> ã <parameter>istype</parameter> ã§æå®ãããåã§ããæã« 1 ããããã§ãªãå ´åã« 0 ãè¿ãã¾ãã <table> <title><parameter>istype</parameter>ã«æå®ã§ããå¤</title> <tgroup cols="2"> <thead> <row> <entry>å¤</entry> <entry>æå³</entry> </row> </thead> <tbody> <row> <entry>PHP_STREAM_IS_STDIO</entry> <entry>ã¹ããªã¼ã ã¯æ¨æºå ¥åºåã®å®è£ ãç¨ãã¦å®è£ ããã¦ãã</entry> </row> <row> <entry>PHP_STREAM_IS_SOCKET</entry> <entry>ã¹ããªã¼ã ã¯ã½ã±ãããç¨ãã¦å®è£ ããã¦ãã</entry> </row> <row> <entry>PHP_STREAM_IS_USERSPACE</entry> <entry>ã¹ããªã¼ã ã¯ã¦ã¼ã¶ç©ºéã«ãããªãã¸ã§ã¯ããç¨ãã¦å®è£ ããã¦ãã</entry> </row> <row> <entry>PHP_STREAM_IS_MEMORY</entry> <entry>ã¹ããªã¼ã ã¯åçã«ãµã¤ãºãå¢ããã¡ã¢ãªã¼ã¹ããªã¼ã ã®å®è£ ãç¨ãã¦å®è£ ããã¦ãã</entry> </row> </tbody> </tgroup> </table> </para> <note> <simpara> PHP_STREAM_IS_XXX "宿°ã¯" å®éã«ã¯ãã¹ããªã¼ã æä½ãå®ç¾©ããæ§é ä½ã¸ã® ãã¤ã³ã¿ã§ããããããªãã®æ¡å¼µã¢ã¸ã¥ã¼ã«ããå¥ã®æ¡å¼µã¢ã¸ã¥ã¼ã«å ã§ã æ°ããªã¹ããªã¼ã ã®å®è£ ãå®ç¾©ããã¦ããå ´åãåæã«ãã®é¢æ°ã«ããæ¯è¼ã« 使ãããã㪠PHP_STREAM_IS_XXX 宿°ããã®ãããã¼ãã¡ã¤ã«å ã§ å®ç¾©ãã¦ããã¹ãã§ãã </simpara> </note> <note> <simpara> ãã®é¢æ°ã¯ãåç´ãª(ãã¤é«éãª) ãã¤ã³ã¿ã¼ã®æ¯è¼ã ããè¡ããã å®è£ ããã¦ãããã¹ããªã¼ã ã®ç¶æ ã夿´ãããã¨ã¯ããã¾ããã </simpara> </note> <para> <function>php_stream_cast</function> ã <function>php_stream_can_cast</function> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-passthru"> <refnamediv> <refname>php_stream_passthru</refname> <refpurpose>ã¹ããªã¼ã ããæ®ãã®ãã¼ã¿ãå ¨ã¦åºåãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>size_t</type><methodname>php_stream_passthru</methodname> <methodparam><type>php_stream *</type><parameter>stream</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_passthru</function> ã¯ã<parameter>stream</parameter> ã«æ®ããããã¹ã¦ã®ãã¼ã¿ããç¾å¨æå¹ãªåºåãããã¡ã«å¯¾ãã¦åºåãã ä½ãã¤ãåºåãããããè¿ãã¾ãã ããåºåãããã¡ãªã³ã°ãç¡å¹ã«ãªã£ã¦ããå ´åã¯ããã¼ã¿ã¯ ç´æ¥åºåå ã«æ¸ãè¾¼ã¾ãã¾ãããã®åºåå ã¯ãPHP ãã¦ã§ããµã¼ãã®ä¸ã§ åãã¦ããéã«ã¯ãã©ã¦ã¶ã«ãªããCLI ãã¼ã¹ã® PHP ã®å ´åã¯æ¨æºåºå ã¨ãªãã¾ãã ãã®é¢æ°ã¯ããã©ã¼ãã³ã¹åä¸ã®ãããå¯è½ã§ããã°ã¡ã¢ãªãããã³ã° ãå©ç¨ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-register-url-stream-wrapper"> <refnamediv> <refname>php_register_url_stream_wrapper</refname> <refpurpose>ã¹ããªã¼ã APIç¨ã®ã©ãããç»é²ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_register_url_stream_wrapper</methodname> <methodparam><type>char *</type><parameter>protocol</parameter></methodparam> <methodparam><type>php_stream_wrapper *</type><parameter>wrapper</parameter></methodparam> <methodparam><type>TSRMLS_DC</type><parameter></parameter></methodparam> </methodsynopsis> <para> <function>php_register_url_stream_wrapper</function> 㯠<parameter>wrapper</parameter> ã <parameter>protocol</parameter> ã§æå®ããããã³ãã©ã¨ã㦠ç»é²ãã¾ãã </para> <note> <simpara> ãããã®é¢æ°ããã¼ãå¯è½ãªã¢ã¸ã¥ã¼ã«ããå¼ã³åºãå ´åã å¿ ã <function>php_unregister_url_stream_wrapper</function> ã ãã®ã¢ã¸ã¥ã¼ã«ã®ã·ã£ãããã¦ã³ã«ã¼ãã³ããå¼ã³åºãã¦ãã ããã ããããªãã¨ãPHP ã¯ã¯ã©ãã·ã¥ãã¦ãã¾ãã¾ãã </simpara> </note> </refsect1> </refentry> <refentry id="streams.php-unregister-url-stream-wrapper"> <refnamediv> <refname>php_unregister_url_stream_wrapper</refname> <refpurpose>ã¹ããªã¼ã APIç¨ã®ã©ããã®ç»é²ãè§£é¤ãã</refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>int</type><methodname>php_unregister_url_stream_wrapper</methodname> <methodparam><type>char *</type><parameter>protocol</parameter></methodparam> <methodparam><type>TSRMLS_DC</type><parameter></parameter></methodparam> </methodsynopsis> <para> <function>php_unregister_url_stream_wrapper</function> 㯠<parameter>protocol</parameter> ã«é¢é£ä»ããããã©ããã¼ã®ç»é²ãè§£é¤ãã¾ãã </para> </refsect1> </refentry> <refentry id="streams.php-stream-open-wrapper-ex"> <refnamediv> <refname>php_stream_open_wrapper_ex</refname> <refpurpose> ã³ã³ããã¹ããæå®ãã¦ããã¡ã¤ã«ã¾ãã¯URLã«ã¹ããªã¼ã ããªã¼ãã³ãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>php_stream *</type><methodname>php_stream_open_wrapper_ex</methodname> <methodparam><type>char *</type><parameter>path</parameter></methodparam> <methodparam><type>char *</type><parameter>mode</parameter></methodparam> <methodparam><type>int</type><parameter>options</parameter></methodparam> <methodparam><type>char **</type><parameter>opened</parameter></methodparam> <methodparam><type>php_stream_context *</type><parameter>context</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_open_wrapper_ex</function> 㯠<function>php_stream_open_wrapper</function> ã¨é常ã«ä¼¼ã¦ãã¾ããã php_stream_context ãªãã¸ã§ã¯ãã <parameter>context</parameter> ã§ æå®ãããã¨ãã§ããç¹ã§ç°ãªãã¾ãã ã¹ããªã¼ã ã³ã³ããã¹ãã«é¢ãã詳細㯠<link linkend="stream.contexts">ã¹ããªã¼ã ã³ã³ããã¹ã</link> ãåç §ãã ããã </para> </refsect1> </refentry> <refentry id="streams.php-stream-open-wrapper-as-file"> <refnamediv> <refname>php_stream_open_wrapper_as_file</refname> <refpurpose> ãã¡ã¤ã«ã¾ãã¯URLããªã¼ãã³ããFILE*ã«å¤æãã </refpurpose> </refnamediv> <refsect1> <title>説æ</title> <methodsynopsis role="c"> <type>FILE *</type><methodname>php_stream_open_wrapper_as_file</methodname> <methodparam><type>char *</type><parameter>path</parameter></methodparam> <methodparam><type>char *</type><parameter>mode</parameter></methodparam> <methodparam><type>int</type><parameter>options</parameter></methodparam> <methodparam><type>char **</type><parameter>opened</parameter></methodparam> </methodsynopsis> <para> <function>php_stream_open_wrapper_as_file</function> 㯠<function>php_stream_open_wrapper</function> ã¨é常ã«ä¼¼ã¦ãã¾ããã ã¹ããªã¼ã ã ANSI æ¨æºå ¥åºåã® FILE* ãã¤ã³ã¿ã«å¤æãã¦ã¹ããªã¼ã ã®ä»£ããã« ãããè¿ãç¹ãç°ãªãã¾ãã ãã®é¢æ°ã¯ããµã¼ããã¼ãã£ã®ã©ã¤ãã©ãªã« FILE* ãç´æ¥æ¸¡ãããã® è¿éã¨ãã¦ç¨æããã¦ãã¾ãã </para> </refsect1> </refentry> </sect1> <!-- 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 -->