You are here

private static function Database::getShmKey in Smart IP 6.2

Same name and namespace in other branches
  1. 7.2 includes/vendor/ip2location/ip2location-php/IP2Location.php \IP2Location\Database::getShmKey()

Generate a unique and repeatable shared memory key for each instance to use

@access private @static

Parameters

string $filename Filename of the BIN file:

Return value

int

2 calls to Database::getShmKey()
Database::shmTeardown in includes/vendor/ip2location/ip2location-php/IP2Location.php
Tear down a shared memory segment created for the given file
Database::__construct in includes/vendor/ip2location/ip2location-php/IP2Location.php
Constructor

File

includes/vendor/ip2location/ip2location-php/IP2Location.php, line 925

Class

Database
IP2Location database class

Namespace

IP2Location

Code

private static function getShmKey($filename) {

  // This will create a shared memory key that deterministically depends only on
  // the current file's path and the BIN file's path
  return (int) sprintf('%u', self::wrap32(crc32(__FILE__ . ':' . $filename)));
}