bmcclure/CakePHP-Media-Plugin — pull request #59 by gBokiau (2014-02-18 10:16:37+00:00)
Title: Add 'forceDelete' setting to CouplerBehavior

Current behavior :
When deleting the record for a media, if the original file is not found in the transfer directory, record deletion is interrupted without any warning

Proposed fix:
A $forceDelete setting is added to CouplerBeharvior. If set to true, record deletion will proceed even if original media file was not found in baseDirectory. Defaults to false (but does this make sense, see bullet point)

Further thinking:
Should a warning be issued when the file is not found instead or in addition to this behavior ? Would the best approach to this be to use php's unlink() method instead of File::delete() (as it issues an E_WARNING when the file is not found) ?
* Is there any scenario where it makes sense _not_ to delete the record when the file is not found ? Deleting the record is the prime function of delete(), and should thus proceed whenever possible, while file deletion could be considered an added benefit