Property | Type | Description | |
---|---|---|---|
$providers | array | An array of all provider instances. Access it through static methods. |
Method | Description | |
---|---|---|
completeLocationResult ( array &$location ) | Tries to fill in any missing information in a location result. | |
getAllProviderInfo ( string $newline = " ", boolean $includeExtra = false ) : array | Returns an array mapping provider IDs w/ information about the provider, for each location provider. | |
getAllProviders ( ) : |
Returns every available provider instance. | |
getAvailableProviders ( ) : array | Returns all provider instances that are 'available'. An 'available' provider is one that is available for use. They may not necessarily be working. | |
getCurrentProvider ( ) : |
Returns the provider instance of the current location provider. | |
getCurrentProviderId ( ) : string | Returns the ID of the currently used location provider. | |
getId ( ) | ||
getLocation ( array $info ) : array | false | Returns location information based on visitor information. | |
getProviderById ( string $providerId ) : |
Returns a provider instance by ID or false if the ID is invalid or unavailable. | |
getSupportedLocationInfo ( ) : array | Returns an array mapping location result keys w/ bool values indicating whether that information is supported by this provider. If it is not supported, that means this provider either cannot get this information, or is not configured to get it. | |
isAvailable ( ) : boolean | Returns true if this provider is available for use, false if otherwise. | |
isWorking ( ) : boolean | Returns true if this provider is working, false if otherwise. | |
prettyFormatLocation ( array | false $locationInfo, string $newline = " ", boolean $includeExtra = false ) : string | Returns a prettified location result. | |
setCurrentProvider ( string $providerId ) : |
Sets the provider to use when tracking. |
Method | Description | |
---|---|---|
getIpFromInfo ( array $info ) : string | null | Returns an IP address from an array that was passed into getLocation. This will return an IPv4 address or IPv6 address. | |
getLocationProviders ( |
Get all lo that are defined by the given plugin. |
public completeLocationResult ( array &$location ) | ||
$location | array | The location information to modify. |
public static getAllProviders ( ) : |
||
return |
public static getAvailableProviders ( ) : array | ||
return | array |
public static getCurrentProvider ( ) : |
||
return |
public static getCurrentProviderId ( ) : string | ||
return | string |
abstract public getLocation ( array $info ) : array | false | ||
$info | array | What this must contain depends on the specific provider implementation. All providers require an 'ip' key mapped to the visitor's IP address. |
return | array | false |
protected static getLocationProviders ( |
||
$plugin | ||
return |
public static getProviderById ( string $providerId ) : |
||
$providerId | string | |
return |
abstract public getSupportedLocationInfo ( ) : array | ||
return | array | eg. array(self::CONTINENT_CODE_KEY => true, self::CONTINENT_NAME_KEY => true, self::ORG_KEY => false) The result is not guaranteed to have keys for every type of location info. |
abstract public isAvailable ( ) : boolean | ||
return | boolean |
public static setCurrentProvider ( string $providerId ) : |
||
$providerId | string | The ID of the provider to use. |
return | The new current provider. |
public static array $providers | ||
return | array |