WC_Geo_IP::geoip_open
Open geoip file.
Method of the class: WC_Geo_IP{}
No Hooks.
Returns
null
. Nothing (null).
Usage
$WC_Geo_IP = new WC_Geo_IP(); $WC_Geo_IP->geoip_open( $filename, $flags );
- $filename(string) (required)
- .
- $flags(int) (required)
- .
WC_Geo_IP::geoip_open() WC Geo IP::geoip open code WC 9.9.5
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 { self::log( 'GeoIP API: Can not open ' . $filename, 'error' ); } } $this->_setup_segments(); }