Remove file.inc dependency and always create backups
sun - January 22, 2008 - 23:04
| Project: | Coder |
| Version: | 6.x-1.x-dev |
| Component: | Coder Format |
| Category: | task |
| Priority: | normal |
| Assigned: | sun |
| Status: | closed |
Description
While developing/debugging http://drupal.org/node/208767, I noticed that it would be very helpful if coder_format
- would always create backup files (not only when recursively processing a directory)
- 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.

#1
First shot, something broke in the forked file_* functions.
#2
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.
#3
Automatically closed -- issue fixed for two weeks with no activity.