From 195ea36a31a4415cb878b0d9b9e8b27d01bfebd6 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Thu, 26 Sep 2002 13:56:54 +0000 Subject: [PATCH] Document/tidy up/clarify some more streams related information. Add notes about URL support for GD functions. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@97008 c90b9560-bf6c-de11-be94-00142212c4b1 --- language-snippets.ent | 20 +++++++++---- language/control-structures.xml | 7 +++-- reference/filesystem/functions/copy.xml | 4 ++- reference/filesystem/functions/file.xml | 3 +- reference/filesystem/functions/fpassthru.xml | 12 ++++++-- reference/filesystem/functions/readfile.xml | 30 ++++--------------- .../image/functions/imagecreatefromgd.xml | 4 ++- .../image/functions/imagecreatefromgd2.xml | 4 ++- .../functions/imagecreatefromgd2part.xml | 4 ++- .../image/functions/imagecreatefromgif.xml | 4 ++- .../image/functions/imagecreatefromjpeg.xml | 4 ++- .../image/functions/imagecreatefrompng.xml | 4 ++- .../image/functions/imagecreatefromwbmp.xml | 4 ++- .../image/functions/imagecreatefromxbm.xml | 4 ++- .../image/functions/imagecreatefromxpm.xml | 4 ++- reference/image/reference.xml | 4 +-- 16 files changed, 67 insertions(+), 49 deletions(-) diff --git a/language-snippets.ent b/language-snippets.ent index cc44254c6f..2fca1f5eb1 100644 --- a/language-snippets.ent +++ b/language-snippets.ent @@ -16,9 +16,9 @@ Use this function at your own risk.'> currently not documented; only the argument list is available.'> -The Windows -version of PHP currently does not support accessing -remote files via this function, even if +Windows +versions of PHP prior to PHP 4.3 do not +support accessing remote files via this function, even if allow_url_fopen is enabled. '> @@ -29,8 +29,11 @@ the output of this function, and save it in a string (for example).'> You can use a URL as a -filename with this function if the "fopen wrappers" have been enabled. -See fopen for more details.'> +filename with this function if the fopen wrappers have been enabled. +See fopen for more details on how to specify +the filename and for a list of supported +URL protocols.'> @@ -50,6 +53,13 @@ is not (yet) binary safe!'> This function is binary-safe.'> +If you are having problems +with PHP not recognizing the line endings when +reading files either on or created by a Macintosh computer, you +might want to enable the auto_detect_line_endings run-time configuration option. +'> + This function is not implemented on Windows platforms.'> diff --git a/language/control-structures.xml b/language/control-structures.xml index 49b18f900e..0708e3f1d2 100644 --- a/language/control-structures.xml +++ b/language/control-structures.xml @@ -1,5 +1,5 @@ - + Control Structures @@ -1185,8 +1185,9 @@ echo "A $color $fruit"; // A green If "URL fopen wrappers" are enabled in PHP (which they are in the default configuration), - you can specify the file to be included using an URL (via HTTP) - instead of a local pathname. If the target server interprets + you can specify the file to be included using an URL (via HTTP or + other supported wrapper - see for a list + of protocols) instead of a local pathname. If the target server interprets the target file as PHP code, variables may be passed to the included file using an URL request string as used with HTTP GET. This is not strictly speaking the same thing as including the file and having diff --git a/reference/filesystem/functions/copy.xml b/reference/filesystem/functions/copy.xml index 77d7c33466..ad3d0b762e 100644 --- a/reference/filesystem/functions/copy.xml +++ b/reference/filesystem/functions/copy.xml @@ -1,5 +1,5 @@ - + @@ -32,6 +32,8 @@ if (!copy($file, $file.'.bak')) { As of PHP 4.3.0, both source and dest may be URLs if the "fopen wrappers" have been enabled. See fopen for more details. + If dest is an URL, the copy operation may + fail if the wrapper does not support overwriting of existing files. diff --git a/reference/filesystem/functions/file.xml b/reference/filesystem/functions/file.xml index 72d65d4d6c..fe11d574b1 100644 --- a/reference/filesystem/functions/file.xml +++ b/reference/filesystem/functions/file.xml @@ -1,5 +1,5 @@ - + @@ -26,6 +26,7 @@ ending present. + ¬e.line-endings; You can use the optional second parameter and set it to "1", if you want to search for the file in the - + @@ -14,7 +14,7 @@ Reads to EOF on the given file pointer from the current position and - writes the results to standard output. + writes the results to the output buffer. If an error occurs, fpassthru returns @@ -30,7 +30,8 @@ fp useless). - If you just want to dump the contents of a file to stdout you may + If you just want to dump the contents of a file to the output buffer, + without first modifying it or seeking to a particular offset, you may want to use the readfile, which saves you the fopen call. @@ -41,6 +42,11 @@ appending a b to the mode used in the call to fopen. + + You are encouraged to use the b flag when dealing + with binary files, even if your system does not require it, so that + your scripts will be more portable. + See also readfile, diff --git a/reference/filesystem/functions/readfile.xml b/reference/filesystem/functions/readfile.xml index ca78e5d575..95b7951f69 100644 --- a/reference/filesystem/functions/readfile.xml +++ b/reference/filesystem/functions/readfile.xml @@ -1,5 +1,5 @@ - + @@ -14,34 +14,14 @@ intuse_include_path - Reads a file and writes it to standard output. + Reads a file and writes it to the output buffer. Returns the number of bytes read from the file. If an error occurs, &false; is returned and unless the function was called as @readfile, an error message is printed. - - If filename begins with "http://" - (not case sensitive), an HTTP 1.0 connection is opened to the - specified server and the text of the response is written to - standard output. - - - Versions prior to PHP 4.0.5 do not handle HTTP redirects. Because - of this, directories must include trailing slashes. - - - If filename begins with "ftp://" - (not case sensitive), an ftp connection to the specified server is - opened and the requested file is written to standard output. If the server - does not support passive mode ftp, this will fail. - - - If filename begins with neither - of these strings, the file will be opened from the filesystem and - its contents written to standard output. - + &tip.fopen-wrapper; You can use the optional second parameter and set it to "1", if you want to search for the file in the See also fpassthru, file, fopen, - include, require, and - virtual. + include, require, + virtual and . diff --git a/reference/image/functions/imagecreatefromgd.xml b/reference/image/functions/imagecreatefromgd.xml index 01e10ebbf8..b8a75e6de0 100644 --- a/reference/image/functions/imagecreatefromgd.xml +++ b/reference/image/functions/imagecreatefromgd.xml @@ -1,5 +1,5 @@ - + @@ -15,6 +15,8 @@ &warn.undocumented.func; + &tip.fopen-wrapper; + &warn.no-win32-fopen-wrapper; diff --git a/reference/image/functions/imagecreatefromgd2.xml b/reference/image/functions/imagecreatefromgd2.xml index eb1a57465b..47977b9155 100644 --- a/reference/image/functions/imagecreatefromgd2.xml +++ b/reference/image/functions/imagecreatefromgd2.xml @@ -1,5 +1,5 @@ - + @@ -15,6 +15,8 @@ &warn.undocumented.func; + &tip.fopen-wrapper; + &warn.no-win32-fopen-wrapper; diff --git a/reference/image/functions/imagecreatefromgd2part.xml b/reference/image/functions/imagecreatefromgd2part.xml index 3e975ae399..e69f57914d 100644 --- a/reference/image/functions/imagecreatefromgd2part.xml +++ b/reference/image/functions/imagecreatefromgd2part.xml @@ -1,5 +1,5 @@ - + @@ -19,6 +19,8 @@ &warn.undocumented.func; + &tip.fopen-wrapper; + &warn.no-win32-fopen-wrapper; diff --git a/reference/image/functions/imagecreatefromgif.xml b/reference/image/functions/imagecreatefromgif.xml index eba73d61c1..7fb22c4a2e 100644 --- a/reference/image/functions/imagecreatefromgif.xml +++ b/reference/image/functions/imagecreatefromgif.xml @@ -1,5 +1,5 @@ - + @@ -51,6 +51,8 @@ function LoadGif ($imgname) { + &tip.fopen-wrapper; + &warn.no-win32-fopen-wrapper; diff --git a/reference/image/functions/imagecreatefromjpeg.xml b/reference/image/functions/imagecreatefromjpeg.xml index 2586488cf5..cb2722282a 100644 --- a/reference/image/functions/imagecreatefromjpeg.xml +++ b/reference/image/functions/imagecreatefromjpeg.xml @@ -1,5 +1,5 @@ - + @@ -44,6 +44,8 @@ function LoadJpeg ($imgname) { + &tip.fopen-wrapper; + &warn.no-win32-fopen-wrapper; diff --git a/reference/image/functions/imagecreatefrompng.xml b/reference/image/functions/imagecreatefrompng.xml index bc401d525c..97788f8667 100644 --- a/reference/image/functions/imagecreatefrompng.xml +++ b/reference/image/functions/imagecreatefrompng.xml @@ -1,5 +1,5 @@ - + @@ -44,6 +44,8 @@ function LoadPNG ($imgname) { + &tip.fopen-wrapper; + &warn.no-win32-fopen-wrapper; diff --git a/reference/image/functions/imagecreatefromwbmp.xml b/reference/image/functions/imagecreatefromwbmp.xml index 3273a64ac8..8441c35f40 100644 --- a/reference/image/functions/imagecreatefromwbmp.xml +++ b/reference/image/functions/imagecreatefromwbmp.xml @@ -1,5 +1,5 @@ - + @@ -50,6 +50,8 @@ function LoadWBMP ($imgname) { against GD-1.8 or later. + &tip.fopen-wrapper; + &warn.no-win32-fopen-wrapper; diff --git a/reference/image/functions/imagecreatefromxbm.xml b/reference/image/functions/imagecreatefromxbm.xml index 4852e22d2f..bff8f37627 100644 --- a/reference/image/functions/imagecreatefromxbm.xml +++ b/reference/image/functions/imagecreatefromxbm.xml @@ -1,5 +1,5 @@ - + @@ -16,6 +16,8 @@ imagecreatefromxbm returns an image identifier representing the image obtained from the given filename. + &tip.fopen-wrapper; + &warn.no-win32-fopen-wrapper; diff --git a/reference/image/functions/imagecreatefromxpm.xml b/reference/image/functions/imagecreatefromxpm.xml index 5bf7f7bdcd..3c62da9440 100644 --- a/reference/image/functions/imagecreatefromxpm.xml +++ b/reference/image/functions/imagecreatefromxpm.xml @@ -1,5 +1,5 @@ - + @@ -16,6 +16,8 @@ imagecreatefromxpm returns an image identifier representing the image obtained from the given filename. + &tip.fopen-wrapper; + &warn.no-win32-fopen-wrapper; diff --git a/reference/image/reference.xml b/reference/image/reference.xml index f1e89f50b8..3225b5a6ae 100644 --- a/reference/image/reference.xml +++ b/reference/image/reference.xml @@ -1,5 +1,5 @@ - + Image functions Image @@ -40,7 +40,7 @@ greater than gd-1.6 support png, not gif. - Since PHP 4.3 there is a bundeled version of the GD lib. This bundeled + Since PHP 4.3 there is a bundled version of the GD lib. This bundled version has some additional features like alpha blending and should be used in preference to the external library since it's codebase is better maintained and more stable.