You are here

public function Reader::metadata in Smart IP 6.2

Same name in this branch
  1. 6.2 includes/vendor/geoip2/geoip2/src/Database/Reader.php \GeoIp2\Database\Reader::metadata()
  2. 6.2 includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php \MaxMind\Db\Reader::metadata()
Same name and namespace in other branches
  1. 7.2 includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php \MaxMind\Db\Reader::metadata()

Return value

Metadata object for the database.

Throws

\InvalidArgumentException if arguments are passed to the method.

\BadMethodCallException if the database has been closed.

File

includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader.php, line 262

Class

Reader
Instances of this class provide a reader for the MaxMind DB format. IP addresses can be looked up using the <code>get</code> method.

Namespace

MaxMind\Db

Code

public function metadata() {
  if (func_num_args()) {
    throw new \InvalidArgumentException('Method takes no arguments.');
  }

  // Not technically required, but this makes it consistent with
  // C extension and it allows us to change our implementation later.
  if (!is_resource($this->fileHandle)) {
    throw new \BadMethodCallException('Attempt to read from a closed MaxMind DB.');
  }
  return $this->metadata;
}