Pathauto currently has a clever inclusion of inc files based upon the following code:
$path = drupal_get_path('module', 'pathauto');
$files = file_scan_directory($path, '^pathauto_.*\.inc$');
foreach ($files as $filename => $file) {
include_once($filename);
}
This looks in the module directory and then dynamically includes any files in that directory. My feeling is that this system is dynamic and fancy at the cost of performance whenever it is run.
If we are going to include an inc file then we are probably going to be 1) writing the code in the inc file 2) editing pathauto.module to take advantage of new functions in that new inc file. So, I propose hardcoding the include files to be more explicit and reduce any overhead associated with the call to file_scan_directory.
The question is if anyone has used this functionality. If so we may decide to leave it as is.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | pa_hardcode.patch | 1.53 KB | greggles |
Comments
Comment #1
gregglesHere is a patch to do this. I plan to implement this in 4.7 and include it in my list of "stuff in 5.x that has changed" so that people won't be surprised when they see it. If someone comes forward at that time saying that they use it, then we can revert this.
Comment #2
gregglesapparently I forgot to actually include the file - here it is...
Comment #3
gregglesApplied to HEAD.
Comment #4
(not verified) commented