PHP Classes

Yii2 IPStack: Find the location of a computer with an IP address

Recommend this page to a friend!
  Info   Documentation   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-03-09 (7 months ago) RSS 2.0 feedNot enough user ratingsTotal: 25 This week: 1All time: 11,214 This week: 34Up
Version License PHP version Categories
yii2-ipstack 1.0BSD License5Networking, PHP 5, Libraries, Web ser..., G...
Description 

Author

This package can find the location of a computer with an IP address.

It provides a component class that extends the Yii2 framework. It sends HTTP requirements to the IPStack Web service API server to get the geographic location of a computer with a given IP address.

The class returns an object with the values of response from the API server like:

- The type of IP address

- Continent code and name

- Country code, name

- Region code and country code

- City name and zip code

- Location latitude, longitude, the state capital, local languages."

- Country flag URL, emoji, phone calling prefix, whether it is in Europe

- Time zone name, code, current time, GMT offset, is daylight saving

- Currency code, name, name in plural, international symbol, local symbol

- Network connection ASN and Internet service provider company name

Picture of Gabriel Alejandro López López
  Performance   Level  
Name: Gabriel Alejandro López ... <contact>
Classes: 10 packages by
Country: United States United States
Age: 35
All time rank: 4332551 in United States United States
Week rank: 18 Up4 in United States United States Up
Innovation award
Innovation award
Nominee: 3x

Documentation

Yii2 IPStack Client

Locate and identify website visitors by IP address using IPStack API

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist daxslab/yii2-ipstack "*"

or add

"daxslab/yii2-ipstack": "*"

to the require section of your composer.json file.

Configuration

Add the component to the application:

'components' => [
    'ipStack' => [
        'class' => \daxslab\ipstack\Client::class,
        'api_key' => '{YOUR_API_KEY}',
    ],
]

Usage

Request info about current user IP

Yii::$app->ipStack->getData();

Request info about a custom IP

Yii::$app->ipStack->getData($ip);

  Files folder image Files (3)  
File Role Description
Plain text file Client.php Class Class source
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 100%
Total:25
This week:1
All time:11,214
This week:34Up