I checked out the AntiSpoof extension and afterwards, while running the upgrade script, I got an error similar to the following:
Warning: require(/home/path/w/__DIR__/AntiSpoofHooks.php): failed to open stream: No such file or directory in /home/path/w/includes/AutoLoader.php on line 1007
Fatal error: require(): Failed opening required '/home/path/w/__DIR__/AntiSpoofHooks.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/path/w/includes/AutoLoader.php on line 1007
I had to change the value from DIR to dirname( FILE ) . '/' to get the script to execute.
Afterwards, running batchAntiSpoof.php, I got similar errors, clearly showing DIR in the paths displayed.
In addition, with the SimpleAntiSpam, for an example, with $wgShowExceptionDetails set to true, I saw
Warning: include(__DIR__/SimpleAntiSpam.i18n.php) [function.include]: failed to open stream: No such file or directory in /home/path/w/includes/LocalisationCache.php on line 455
Warning: include(__DIR__/SimpleAntiSpam.i18n.php) [function.include]: failed to open stream: No such file or directory in /home/path/w/includes/LocalisationCache.php on line 455
Warning: include() [function.include]: Failed opening '__DIR__/SimpleAntiSpam.i18n.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/path/w/includes/LocalisationCache.php on line 455
These errors were resolved with the use of "dirname( FILE ) . '/'" instead of "DIR". Would it be better to use "dirname( FILE ) . '/'" in place of DIR in all cases then?
(Note: The wiki is on Linux OS and using an Apache server.)
Version: master
Severity: major