You are here

function geoip_get_path in GeoIP API 7

Same name and namespace in other branches
  1. 6 geoip.module \geoip_get_path()

Get the file path of the geoip module. This is a wrapper around drupal_get_path() that falls back to simply using the directory of the module file if too early in the bootstrap.

Return value

string

1 call to geoip_get_path()
_geoip_load_lib in ./geoip.module
Include the external geoip libraries.

File

./geoip.module, line 108
API for using the MaxMind GeoLite Country database.

Code

function geoip_get_path() {
  if (function_exists('drupal_get_path')) {

    // Let drupal set the path
    $path = drupal_get_path('module', 'geoip');
  }
  else {

    // Fallback to trying to find the path based on PHP's knowledge of our
    // current path.
    $path = dirname(__FILE__);
  }
  return $path;
}