geoip_open

The Google Font Fix geoip open function.

Description

geoip_open( (string) $filename, $flags ); 

Parameters (2)

0. $filename (string)
The filename.
1. $flags
The flags.

Usage

  1. if ( !function_exists( 'geoip_open' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'google-font-fix/geo/geoip.inc.php'; 
  3.  
  4. // The filename. 
  5. $filename = ''; 
  6.  
  7. // The flags. 
  8. $flags = null; 
  9.  
  10. // NOTICE! Understand what this does before running. 
  11. $result = geoip_open($filename, $flags); 
  12.  

Defined (1)

The function is defined in the following location(s).

/geo/geoip.inc.php  
  1. function geoip_open($filename, $flags) 
  2. $gi = new GeoIP; 
  3. $gi->flags = $flags; 
  4. if ($gi->flags & GEOIP_SHARED_MEMORY) { 
  5. $gi->shmid = shmop_open(GEOIP_SHM_KEY, "a", 0, 0); 
  6. } else { 
  7. $gi->filehandle = fopen($filename, "rb") or trigger_error("GeoIP API: Can not open $filename\n", E_USER_ERROR); 
  8. if ($gi->flags & GEOIP_MEMORY_CACHE) { 
  9. $s_array = fstat($gi->filehandle); 
  10. $gi->memory_buffer = fread($gi->filehandle, $s_array['size']); 
  11.  
  12. $gi = _setup_segments($gi); 
  13. return $gi;