[Plugin: Sightings] File error/PHP version and __DIR__
-
Doing a bit of diggging for an issue I had earlier today, it seems that PHP versions less than 5.3.0 will break the plugin. The __DIR__ constant is only available in version 5.3.0 or higher.
I fixed this by replacing __DIR__ with dirname(__FILE__) in the /sightings/theme-files/filters.php file. One could use a conditional based on PHP version to handle it, in case dirname(__FILE__) is deprecated.
Here is the error message I got before modifying the plugin:
Warning: include(__DIR__/shortcode-sightings-map.php) [function.include]: failed to open stream: No such file or directory in /usr/www/users/xxxxxxxxxx/wp-content/plugins/sightings/theme-files/filters.php on line 14 Warning: include() [function.include]: Failed opening '__DIR__/shortcode-sightings-map.php' for inclusion (include_path='.:/usr/local/lib/php') in /usr/www/users/xxxxxxxxxx/wp-content/plugins/sightings/theme-files/filters.php on line 14
Hope this helps! I will just have to remember to edit the plugin whenever it receives an update.
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘[Plugin: Sightings] File error/PHP version and __DIR__’ is closed to new replies.