You are here

public function Metadata::__construct in Smart IP 7.2

Same name and namespace in other branches
  1. 6.2 includes/vendor/maxmind-db/reader/src/MaxMind/Db/Reader/Metadata.php \MaxMind\Db\Reader\Metadata::__construct()

File

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

Class

Metadata
This class provides the metadata for the MaxMind DB file.

Namespace

MaxMind\Db\Reader

Code

public function __construct($metadata) {
  $this->binaryFormatMajorVersion = $metadata['binary_format_major_version'];
  $this->binaryFormatMinorVersion = $metadata['binary_format_minor_version'];
  $this->buildEpoch = $metadata['build_epoch'];
  $this->databaseType = $metadata['database_type'];
  $this->languages = $metadata['languages'];
  $this->description = $metadata['description'];
  $this->ipVersion = $metadata['ip_version'];
  $this->nodeCount = $metadata['node_count'];
  $this->recordSize = $metadata['record_size'];
  $this->nodeByteSize = $this->recordSize / 4;
  $this->searchTreeSize = $this->nodeCount * $this->nodeByteSize;
}