Net_GeoIP::getInstance()

Net_GeoIP::getInstance() --  method to get an instance and avoid re-parsing the database

Synopsis

require_once "Net/GeoIP.php";

object getInstance() (string $filename [, int $flags])

Description

This method is an implementation of the so-called singleton pattern and is the preferred way to create instances of Net_GeoIP.

Multiple Instances

If you want to use multiple databases in one application, you will need to create an instance of Net_GeoIP for each database. Using the singleton getInstance() method will make sure that at any given point exactly one object for each database exists, which saves on overhead of setting up database segments.

Parameter