While developing/debugging http://drupal.org/node/208767, I noticed that it would be very helpful if coder_format

  1. would always create backup files (not only when recursively processing a directory)
  2. would not have a dependency on file.inc

1. also removes the need to specify a target filename. While being there, we could also automatically determine, if the source is a file or a directory (if so, process it recursively).

Regarding 2. I'd suggest to add the needed functions from file.inc to coder_format.php, and also move all stub functions form coder_format.inc into coder_format.php. Thus, when coder_format.inc is invoked by coder_format.php, all required functions are defined. If it's invoked by Drupal (maybe in the future?), all of these functions already exist.

CommentFileSizeAuthor
#2 coder-DRUPAL-6--1.patch28.11 KBsun
#1 coder-DRUPAL-6--1.patch17.21 KBsun

Comments

sun’s picture

Status: Active » Needs work
StatusFileSize
new17.21 KB

First shot, something broke in the forked file_* functions.

sun’s picture

Title: Remove file.inc dependency and automatically create backups » Remove file.inc dependency and always create backups
Status: Needs work » Fixed
StatusFileSize
new28.11 KB

Committed attached patch, which

- removes file.inc dependency
- removes the target filename parameter (automatically creates backup files for single files now)
- automatically detects if a given argument is a file or directory (automatically processing directories recursively)
- adds a new Windows Explorer context menu entry to restore processed files from backup files.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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