Commit 31227acf authored by jhodgdon's avatar jhodgdon

Issue #2084535 by mErilainen, tankerjoe, DanielFbrg: Fix file_copy...

Issue #2084535 by mErilainen, tankerjoe, DanielFbrg: Fix file_copy documentation around the case when source and destination are the same
parent c0f747d0
......@@ -602,6 +602,9 @@ function file_valid_uri($uri) {
* is reported.
* - If file already exists in $destination either the call will error out,
* replace the file or rename the file based on the $replace parameter.
* - If the $source and $destination are equal, the behavior depends on the
* $replace parameter. FILE_EXIST_REPLACE will error out. FILE_EXIST_RENAME
* will rename the file until the $destination is unique.
* - Provides a fallback using realpaths if the move fails using stream
* wrappers. This can occur because PHP's copy() function does not properly
* support streams if safe_mode or open_basedir are enabled. See
......
......@@ -134,10 +134,11 @@ function file_usage() {
* stored in the database. This is a powerful function that in many ways
* performs like an advanced version of copy().
* - Checks if $source and $destination are valid and readable/writable.
* - Checks that $source is not equal to $destination; if they are an error
* is reported.
* - If file already exists in $destination either the call will error out,
* replace the file or rename the file based on the $replace parameter.
* - If the $source and $destination are equal, the behavior depends on the
* $replace parameter. FILE_EXIST_REPLACE will error out. FILE_EXIST_RENAME
* will rename the file until the $destination is unique.
* - Adds the new file to the files database. If the source file is a
* temporary file, the resulting file will also be a temporary file. See
* file_save_upload() for details on temporary files.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment