PHP 3.0.13以降、php://output 、そして、 PHP 4.3以降、php://input
php://stdin
php://stdout
php://stderr
php://output
php://input
php://stdin、 php://stdout とphp://stderr により、対応するPHPプロセスの 入力または出力ストリームにアクセスできるようになります。
php://output により、 print() およびecho()と同様の 手法により、出力バッファに書き込むことができるようになります。
php://input により、raw POSTデータを読み込む ことができるようになります。これは、 $HTTP_RAW_POST_DATAよりメモリ消費量が少なく、 代わりとなるものです。また、特別なphp.iniディレクティブを全く必 要としません。
php://stdin および php://input は読み込みのみ可です。一方、 php://stdout, php://stderr および php://output は、書き込みのみ可です。
php://filter is a kind of meta-wrapper designed to permit the application of filters to a stream at the time of opening. This is useful with all-in-one file functions such as readfile(), file(), and file_get_contents() where there is otherwise no opporotunity to apply a filter to the stream prior the contents being read.
The php://filter target takes the following 'parameters' as parts of its 'path'.
/resource=<stream to be filtered> (required) This parameter must be located at the end of your php://filter specification and should point to the stream which you want filtered.
/read=<filter list to apply to read chain> (optional) This parameter takes one or more filternames separated by the pipe character |.
<?php |
/write=<filter list to apply to write chain> (optional) This parameter takes one or more filternames separated by the pipe character |.
/<filter list to apply to both chains> (optional) Any filter lists which are not prefixed specifically by read= or write= will be applied to both the read and write chains (as appropriate).
表 L-5. Wrapper Summary (For php://filter, refer to summary of wrapper being filtered.)
Attribute | Supported |
---|---|
Restricted by allow_url_fopen. | No |
Allows Reading | php://stdin and php://input only. |
Allows Writing | php://stdout, php://stderr, and php://output only. |
Allows Appending | php://stdout, php://stderr, and php://output only. (Equivalent to writing) |
Allows Simultaneous Reading and Writing | No. These wrappers are unidirectional. |
Supports stat() | No |
Supports unlink() | No |