The $source is described as "A string specifying the file location of the original file" but it can also be an object with a 'filepath' property, such as the result of file_save_upload().

Comments

jhodgdon’s picture

Title: Documentation problem with file_move » file_move() and file_copy() doc incomplete on $source param
Issue tags: +Novice

Good catch! This is also true of the file_copy() function, as you can see by looking a few lines into file_copy():

 $source = is_object($source) ? $source->filepath : $source;

So, this should be added to the doc for $source for both functions.
http://api.drupal.org/api/function/file_copy/6
http://api.drupal.org/api/function/file_move/6

It's not relevant to Drupal 7, since the signature of these functions has changed and $source is always an object in D7.

sender’s picture

Assigned: Unassigned » sender
sender’s picture

StatusFileSize
new4.39 KB

Changed wording, applied doxygen formatting standards and removed trailing spaces.

sender’s picture

Status: Active » Needs review
jhodgdon’s picture

Status: Needs review » Needs work

Looks pretty good...

We try to wrap lines as close to 80 characters as possible, so this needs a reformat:

+ * @param $source
+ *   Either a string specifying the file location of the original file or an
+ *   object containing a 'filepath' property.
+ *   This parameter is passed by reference and will contain the resulting
+ *   destination filename in case of success.

Also, list formatting:

+ *   - FILE_EXISTS_REPLACE - Replace the existing file.
+ *   - FILE_EXISTS_RENAME - Append _{incrementing number} until the filename is

See standards at http://drupal.org/node/1354#general under "Lists" - should have a colon : after items and not a hyphen -

I realize that you didn't originate either of these problems, but it would be great if you could fix them. :)

Thanks!

sender’s picture

Status: Needs work » Needs review
StatusFileSize
new4.61 KB

Here's a follow up.

crotown’s picture

Status: Needs review » Reviewed & tested by the community

Wrapped lines correctly -- no needless short lines. And colons instead of hyphens in the list. Both of these changes for both of the two functions that needed this documentation change.

gábor hojtsy’s picture

Status: Reviewed & tested by the community » Fixed

Committed, thanks.

Status: Fixed » Closed (fixed)
Issue tags: -Novice

Automatically closed -- issue fixed for 2 weeks with no activity.