WordPress at Your Fingertips
function is not described

WC_Geo_IP::geoip_open() public WC 1.0

Open geoip file.

{} It's a method of the class: WC_Geo_IP{}

No Hooks.

Return

null. Nothing.

Usage

$WC_Geo_IP = new WC_Geo_IP();
$WC_Geo_IP->geoip_open( $filename, $flags );
$filename(string) (required)
-
$flags(int) (required)
-

Code of WC_Geo_IP::geoip_open() WC 5.8.0

public function geoip_open( $filename, $flags ) {
	$this->flags = $flags;
	if ( $this->flags & self::GEOIP_SHARED_MEMORY ) {
		$this->shmid = @shmop_open( self::GEOIP_SHM_KEY, 'a', 0, 0 );
	} else {
		if ( $this->filehandle = fopen( $filename, 'rb' ) ) {
			if ( $this->flags & self::GEOIP_MEMORY_CACHE ) {
				$s_array = fstat( $this->filehandle );
				$this->memory_buffer = fread( $this->filehandle, $s_array['size'] );
			}
		} else {
			$this->log( 'GeoIP API: Can not open ' . $filename, 'error' );
		}
	}

	$this->_setup_segments();
}