PHP Class Stevebauman\Location\Location

Author: Steve Bauman ([email protected])
Afficher le fichier Open project: stevebauman/location Class Usage Examples

Protected Properties

Свойство Type Description
$driver Stevebauman\Location\Drivers\Driver The current driver.
$key string The session key.

Méthodes publiques

Méthode Description
__construct ( ) Constructor.
get ( string $ip = '' ) : Position | boolean Retrieve the users location.
setDefaultDriver ( ) Sets the default driver from the configuration.
setDriver ( Driver $driver ) Creates the selected driver instance and sets the driver property.
setSessionKey ( string $key ) : Location Sets the location session key.

Méthodes protégées

Méthode Description
getClientIP ( ) : string Returns the client IP address. Will return the set config IP if localhost testing is set to true.
getDefaultDriver ( ) : Illuminate\Support\Facades\Config Returns the selected driver
getDriver ( string $driver ) : Driver Returns the specified driver.
getDriverFallbacks ( ) : array Retrieves the config option for select driver fallbacks.
getLocalHostTestingIp ( ) : string Retrieves the config option for the localhost testing IP.
localHostTesting ( ) : boolean Retrieves the config option for localhost testing.

Method Details

__construct() public méthode

Constructor.
public __construct ( )

get() public méthode

Retrieve the users location.
public get ( string $ip = '' ) : Position | boolean
$ip string
Résultat Position | boolean

getClientIP() protected méthode

Returns the client IP address. Will return the set config IP if localhost testing is set to true.
protected getClientIP ( ) : string
Résultat string

getDefaultDriver() protected méthode

Returns the selected driver
protected getDefaultDriver ( ) : Illuminate\Support\Facades\Config
Résultat Illuminate\Support\Facades\Config

getDriver() protected méthode

Returns the specified driver.
protected getDriver ( string $driver ) : Driver
$driver string
Résultat Stevebauman\Location\Drivers\Driver

getDriverFallbacks() protected méthode

Retrieves the config option for select driver fallbacks.
protected getDriverFallbacks ( ) : array
Résultat array

getLocalHostTestingIp() protected méthode

Retrieves the config option for the localhost testing IP.
protected getLocalHostTestingIp ( ) : string
Résultat string

localHostTesting() protected méthode

Retrieves the config option for localhost testing.
protected localHostTesting ( ) : boolean
Résultat boolean

setDefaultDriver() public méthode

Sets the default driver from the configuration.
public setDefaultDriver ( )

setDriver() public méthode

Creates the selected driver instance and sets the driver property.
public setDriver ( Driver $driver )
$driver Stevebauman\Location\Drivers\Driver

setSessionKey() public méthode

Sets the location session key.
public setSessionKey ( string $key ) : Location
$key string
Résultat Location

Property Details

$driver protected_oe property

The current driver.
protected Driver,Stevebauman\Location\Drivers $driver
Résultat Stevebauman\Location\Drivers\Driver

$key protected_oe property

The session key.
protected string $key
Résultat string