Fatal PHP error on activation due to duplicate function names
-
Hi,
This looks a useful plugin for programmers to build upon. Thank you! I was beginning to use it to build a country selector within another plugin.
However, on the site I want to deploy upon, another plugin already has the same GeoIP library included. This causes a fatal error, as your library does not apply checks for whether the library is already loaded (the other plugin does – but unfortunately the other plugin can get loaded first).
i.e. To make your plugin play nice with other plugins, you need to add various wrappers like:
if(!class_exists(‘geoiprecord’)) {
class geoiprecord {
// (Previous contents of geoiprecord class)
}
}Alternatively, if you are happy to be PHP 5.3 only, then use name-spacing.
Even better: update from the legacy PHP API to the current one: https://github.com/maxmind/GeoIP2-php
Best wishes,
David
- The topic ‘Fatal PHP error on activation due to duplicate function names’ is closed to new replies.