Net_Gopher
簡介
The gopher protocol, as defined by » RFC 1436, is generally considered the ancestor of the modern HTTP protocol. However, gopher was also intended to provide references to non-gopher resources including telnet, wais, nntp, and even http. This extension adds gopher support to PHP's URL Wrappers, and provides a helper function gopher_parsedir() to make sense of gopher formatted directory listings.
需求
安裝
Prerequisite: PHP 4.3.0 or higher.
安裝此 PECL 擴充功能的訊息可在手冊中標題為 PECL 擴充功能安裝的一章中找到。 更多訊息如新版本,下載,原始文件,維護者訊息以及更新日誌等可以在這裡找到: » https://pecl.php.net/package/net_gopher
執行時期設定
本擴充功能在 php.ini 中未定義任何設定選項。
資源類型
本擴充功能未定義任何資源類型。
預設常數
以下常數由擴充功能定義,因此只有在擴充功能被編譯到 PHP 中,或者在執行時被動態載入後才有效。
Constant | Value | Description |
---|---|---|
GOPHER_DOCUMENT | 0 | Standard text/plain document. |
GOPHER_DIRECTORY | 1 | A resource containing a gopher formatted directory listing. |
GOPHER_BINHEX | 4 | A BinHex encoded binary file. |
GOPHER_DOSBINARY | 5 | A DOS formatted binary archive. |
GOPHER_UUENCODED | 6 | A UUEncoded file. |
GOPHER_BINARY | 9 | A generic binary file. |
GOPHER_INFO | 255 | An Informational entry |
GOPHER_HTTP | 254 | A reference to an HTTP resource. |
GOPHER_UNKNOWN | -1 | An unrecognized entry. |
範例
<?php
readfile("gopher://gopher.example.com/somedocument");
?>