</span></span><spanid="18"class="l"><aclass="l"href="#18"> 18: </a><spanclass="php-comment"> * This class provides a client API for all the GeoIP2 web service's
</span></span><spanid="19"class="l"><aclass="l"href="#19"> 19: </a><spanclass="php-comment"> * end points. The end points are Country, City, City/ISP/Org, and Omni. Each
</span></span><spanid="20"class="l"><aclass="l"href="#20"> 20: </a><spanclass="php-comment"> * end point returns a different set of data about an IP address, with Country
</span></span><spanid="21"class="l"><aclass="l"href="#21"> 21: </a><spanclass="php-comment"> * returning the least data and Omni the most.
</span></span><spanid="23"class="l"><aclass="l"href="#23"> 23: </a><spanclass="php-comment"> * Each web service end point is represented by a different model class, and
</span></span><spanid="24"class="l"><aclass="l"href="#24"> 24: </a><spanclass="php-comment"> * these model classes in turn contain multiple Record classes. The record
</span></span><spanid="25"class="l"><aclass="l"href="#25"> 25: </a><spanclass="php-comment"> * classes have attributes which contain data about the IP address.
</span></span><spanid="27"class="l"><aclass="l"href="#27"> 27: </a><spanclass="php-comment"> * If the web service does not return a particular piece of data for an IP
</span></span><spanid="28"class="l"><aclass="l"href="#28"> 28: </a><spanclass="php-comment"> * address, the associated attribute is not populated.
</span></span><spanid="30"class="l"><aclass="l"href="#30"> 30: </a><spanclass="php-comment"> * The web service may not return any information for an entire record, in
</span></span><spanid="31"class="l"><aclass="l"href="#31"> 31: </a><spanclass="php-comment"> * which case all of the attributes for that record class will be empty.
</span></span><spanid="35"class="l"><aclass="l"href="#35"> 35: </a><spanclass="php-comment"> * The basic API for this class is the same for all of the web service end
</span></span><spanid="36"class="l"><aclass="l"href="#36"> 36: </a><spanclass="php-comment"> * points. First you create a web service object with your MaxMind
</span></span><spanid="37"class="l"><aclass="l"href="#37"> 37: </a><spanclass="php-comment"> * <code>$userId</code> and <code>$licenseKey</code>, then you call the method
</span></span><spanid="38"class="l"><aclass="l"href="#38"> 38: </a><spanclass="php-comment"> * corresponding to a specific end point, passing it the IP address you want
</span></span><spanid="39"class="l"><aclass="l"href="#39"> 39: </a><spanclass="php-comment"> * to look up.
</span></span><spanid="41"class="l"><aclass="l"href="#41"> 41: </a><spanclass="php-comment"> * If the request succeeds, the method call will return a model class for
</span></span><spanid="42"class="l"><aclass="l"href="#42"> 42: </a><spanclass="php-comment"> * the end point you called. This model in turn contains multiple record
</span></span><spanid="43"class="l"><aclass="l"href="#43"> 43: </a><spanclass="php-comment"> * classes, each of which represents part of the data returned by the web
</span></span><spanid="46"class="l"><aclass="l"href="#46"> 46: </a><spanclass="php-comment"> * If the request fails, the client class throws an exception.
</span></span><spanid="50"class="l"><aclass="l"href="#50"> 50: </a><spanclass="php-comment"> * For details on the possible errors returned by the web service itself, see
</span></span><spanid="51"class="l"><aclass="l"href="#51"> 51: </a><spanclass="php-comment"> * {@link http://dev.maxmind.com/geoip2/geoip/web-services the GeoIP2 web
</span></span><spanid="52"class="l"><aclass="l"href="#52"> 52: </a><spanclass="php-comment"> * service docs}.
</span></span><spanid="54"class="l"><aclass="l"href="#54"> 54: </a><spanclass="php-comment"> * If the web service returns an explicit error document, this is thrown as a
</span></span><spanid="55"class="l"><aclass="l"href="#55"> 55: </a><spanclass="php-comment"> * {@link \GeoIP2\Exception\WebServiceException}. If some other sort of
</span></span><spanid="56"class="l"><aclass="l"href="#56"> 56: </a><spanclass="php-comment"> * transport error occurs, this is thrown as a {@link
</span></span><spanid="57"class="l"><aclass="l"href="#57"> 57: </a><spanclass="php-comment"> * \GeoIP2\Exception\HttpException}. The difference is that the web service
</span></span><spanid="58"class="l"><aclass="l"href="#58"> 58: </a><spanclass="php-comment"> * error includes an error message and error code delivered by the web
</span></span><spanid="59"class="l"><aclass="l"href="#59"> 59: </a><spanclass="php-comment"> * service. The latter is thrown when some sort of unanticipated error occurs,
</span></span><spanid="60"class="l"><aclass="l"href="#60"> 60: </a><spanclass="php-comment"> * such as the web service returning a 500 or an invalid error document.
</span></span><spanid="62"class="l"><aclass="l"href="#62"> 62: </a><spanclass="php-comment"> * If the web service returns any status code besides 200, 4xx, or 5xx, this
</span></span><spanid="63"class="l"><aclass="l"href="#63"> 63: </a><spanclass="php-comment"> * also becomes a {@link \GeoIP2\Exception\HttpException}.
</span></span><spanid="65"class="l"><aclass="l"href="#65"> 65: </a><spanclass="php-comment"> * Finally, if the web service returns a 200 but the body is invalid, the
</span></span><spanid="66"class="l"><aclass="l"href="#66"> 66: </a><spanclass="php-comment"> * client throws a {@link \GeoIP2\Exception\GeoIP2Exception}.
</span></span><spanid="81"class="l"><aclass="l"href="#81"> 81: </a><spanclass="php-comment"> * @param array $languages List of language codes to use in name property
</span></span><spanid="82"class="l"><aclass="l"href="#82"> 82: </a><spanclass="php-comment"> * from most preferred to least preferred.
</span></span><spanid="105"class="l"><aclass="l"href="#105">105: </a><spanclass="php-comment"> * @param string $ipAddress IPv4 or IPv6 address as a string. If no
</span></span><spanid="106"class="l"><aclass="l"href="#106">106: </a><spanclass="php-comment"> * address is provided, the address that the web service is called
</span></span><spanid="107"class="l"><aclass="l"href="#107">107: </a><spanclass="php-comment"> * from will be used.
</span></span><spanid="111"class="l"><aclass="l"href="#111">111: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\GeoIP2Exception if there was a generic
</span></span><spanid="112"class="l"><aclass="l"href="#112">112: </a><spanclass="php-comment"> * error processing your request.
</span></span><spanid="113"class="l"><aclass="l"href="#113">113: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\HttpException if there was an HTTP transport
</span></span><spanid="115"class="l"><aclass="l"href="#115">115: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\WebServiceException if an error was returned
</span></span><spanid="116"class="l"><aclass="l"href="#116">116: </a><spanclass="php-comment"> * by MaxMind's GeoIP2 web service.
</span></span><spanid="126"class="l"><aclass="l"href="#126">126: </a><spanclass="php-comment"> * @param string $ipAddress IPv4 or IPv6 address as a string. If no
</span></span><spanid="127"class="l"><aclass="l"href="#127">127: </a><spanclass="php-comment"> * address is provided, the address that the web service is called
</span></span><spanid="128"class="l"><aclass="l"href="#128">128: </a><spanclass="php-comment"> * from will be used.
</span></span><spanid="132"class="l"><aclass="l"href="#132">132: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\GeoIP2Exception if there was a generic
</span></span><spanid="133"class="l"><aclass="l"href="#133">133: </a><spanclass="php-comment"> * error processing your request.
</span></span><spanid="134"class="l"><aclass="l"href="#134">134: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\HttpException if there was an HTTP transport
</span></span><spanid="136"class="l"><aclass="l"href="#136">136: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\WebServiceException if an error was returned
</span></span><spanid="137"class="l"><aclass="l"href="#137">137: </a><spanclass="php-comment"> * by MaxMind's GeoIP2 web service.
</span></span><spanid="147"class="l"><aclass="l"href="#147">147: </a><spanclass="php-comment"> * @param string $ipAddress IPv4 or IPv6 address as a string. If no
</span></span><spanid="148"class="l"><aclass="l"href="#148">148: </a><spanclass="php-comment"> * address is provided, the address that the web service is called
</span></span><spanid="149"class="l"><aclass="l"href="#149">149: </a><spanclass="php-comment"> * from will be used.
</span></span><spanid="153"class="l"><aclass="l"href="#153">153: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\GeoIP2Exception if there was a generic
</span></span><spanid="154"class="l"><aclass="l"href="#154">154: </a><spanclass="php-comment"> * error processing your request.
</span></span><spanid="155"class="l"><aclass="l"href="#155">155: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\HttpException if there was an HTTP transport
</span></span><spanid="157"class="l"><aclass="l"href="#157">157: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\WebServiceException if an error was returned
</span></span><spanid="158"class="l"><aclass="l"href="#158">158: </a><spanclass="php-comment"> * by MaxMind's GeoIP2 web service.
</span></span><spanid="168"class="l"><aclass="l"href="#168">168: </a><spanclass="php-comment"> * @param string $ipAddress IPv4 or IPv6 address as a string. If no
</span></span><spanid="169"class="l"><aclass="l"href="#169">169: </a><spanclass="php-comment"> * address is provided, the address that the web service is called
</span></span><spanid="170"class="l"><aclass="l"href="#170">170: </a><spanclass="php-comment"> * from will be used.
</span></span><spanid="174"class="l"><aclass="l"href="#174">174: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\GeoIP2Exception if there was a generic
</span></span><spanid="175"class="l"><aclass="l"href="#175">175: </a><spanclass="php-comment"> * error processing your request.
</span></span><spanid="176"class="l"><aclass="l"href="#176">176: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\HttpException if there was an HTTP transport
</span></span><spanid="178"class="l"><aclass="l"href="#178">178: </a><spanclass="php-comment"> * @throws \GeoIP2\Exception\WebServiceException if an error was returned
</span></span><spanid="179"class="l"><aclass="l"href="#179">179: </a><spanclass="php-comment"> * by MaxMind's GeoIP2 web service.
</span><spanid="220"class="l"><aclass="l"href="#220">220: </a><spanclass="php-quote">"Received a 200 response for </span><spanclass="php-var">$uri</span><spanclass="php-quote"> but did not "</span> .
</span><spanid="221"class="l"><aclass="l"href="#221">221: </a><spanclass="php-quote">"receive a HTTP body."</span>
</span><spanid="229"class="l"><aclass="l"href="#229">229: </a><spanclass="php-quote">"Received a 200 response for </span><spanclass="php-var">$uri</span><spanclass="php-quote"> but could not decode "</span> .
</span><spanid="230"class="l"><aclass="l"href="#230">230: </a><spanclass="php-quote">"the response as JSON: "</span> . <spanclass="php-var">$e</span>->getMessage()
</span><spanid="254"class="l"><aclass="l"href="#254">254: </a><spanclass="php-quote">"Received a </span><spanclass="php-var">$status</span><spanclass="php-quote"> error for </span><spanclass="php-var">$uri</span><spanclass="php-quote"> but it did not "</span> .
</span><spanid="255"class="l"><aclass="l"href="#255">255: </a><spanclass="php-quote">"include the expected JSON body: "</span> .
</span><spanid="263"class="l"><aclass="l"href="#263">263: </a><spanclass="php-quote">"Received a </span><spanclass="php-var">$status</span><spanclass="php-quote"> error for </span><spanclass="php-var">$uri</span><spanclass="php-quote"> with the "</span> .
</span><spanid="271"class="l"><aclass="l"href="#271">271: </a><spanclass="php-quote">"Received a </span><spanclass="php-var">$status</span><spanclass="php-quote"> error for </span><spanclass="php-var">$uri</span><spanclass="php-quote"> with no body"</span>,
</span><spanid="290"class="l"><aclass="l"href="#290">290: </a><spanclass="php-quote">"Received a server error (</span><spanclass="php-var">$status</span><spanclass="php-quote">) for </span><spanclass="php-var">$uri</span><spanclass="php-quote">"</span>,
</span><spanid="301"class="l"><aclass="l"href="#301">301: </a><spanclass="php-quote">"Received a very surprising HTTP status "</span> .
</span><spanid="302"class="l"><aclass="l"href="#302">302: </a><spanclass="php-quote">"(</span><spanclass="php-var">$status</span><spanclass="php-quote">) for </span><spanclass="php-var">$uri</span><spanclass="php-quote">"</span>,