PHP Classes

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

Recommend this page to a friend!
  Info   View files Documentation   View files View files (3)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2024-03-09 (6 days ago) RSS 2.0 feedNot enough user ratingsTotal: 17 This week: 17All time: 11,193 This week: 5Up
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: 3 packages by
Country: United States United States

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  
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

 Version Control Unique User Downloads Download Rankings  
 100%
Total:17
This week:17
All time:11,193
This week:5Up