private function Database::read in Smart IP 7.2
Same name and namespace in other branches
- 6.2 includes/vendor/ip2location/ip2location-php/IP2Location.php \IP2Location\Database::read()
Low level read function to abstract away the caching mode being used
@access private
Parameters
int $pos Position from where to start reading:
int $len Read this many bytes:
Return value
string
2 calls to Database::read()
- Database::readQuad in includes/
vendor/ ip2location/ ip2location-php/ IP2Location.php - Low level function to fetch a quadword (128 bits) from the caching backend
- Database::readString in includes/
vendor/ ip2location/ ip2location-php/ IP2Location.php - Low level function to fetch a string from the caching backend
File
- includes/
vendor/ ip2location/ ip2location-php/ IP2Location.php, line 1039
Class
- Database
- IP2Location database class
Namespace
IP2LocationCode
private function read($pos, $len) {
switch ($this->mode) {
case self::SHARED_MEMORY:
return shmop_read($this->resource, $pos, $len);
case self::MEMORY_CACHE:
return $data = substr(self::$buffer[$this->resource], $pos, $len);
default:
fseek($this->resource, $pos, SEEK_SET);
return fread($this->resource, $len);
}
}