Download the PHP package ip2location/ip2location-cakephp without Composer
On this page you can find all versions of the php package ip2location/ip2location-cakephp. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ip2location/ip2location-cakephp
More information about ip2location/ip2location-cakephp
Files in ip2location/ip2location-cakephp
Package ip2location-cakephp
Short Description Lookup for visitor's IP information, such as country, region, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type.
License MIT
Homepage https://github.com/ip2location/ip2location-cakephp
Informations about the package ip2location-cakephp
IP2Location CakePHP Plugin
IP2Location CakePHP plugin enables the user to find the country, region, district, city, coordinates, zip code, time zone, ISP, domain name, connection type, area code, weather, MCC, MNC, mobile brand name, elevation and usage type, IP address type, IAB advertising category and ASN from IP address using IP2Location database. It has been optimized for speed and memory utilization. Developers can use the API to query all IP2Location BIN databases or web service for applications written using CakePHP.
Note: This plugin works in CakePHP 4 and CakePHP 5.
INSTALLATION
- Run the command:
composer require ip2location/ip2location-cakephp
to download the plugin into the CakePHP platform. - Download latest IP2Location BIN database
- IP2Location free LITE database at https://lite.ip2location.com
- IP2Location commercial database at https://www.ip2location.com
- Unzip and copy the BIN file into /vendor/ip2location/ip2location-cakephp/src/Data folder.
- Rename the BIN file to IP2LOCATION.BIN.
Note: The plugin has included an old BIN database for your testing and development purpose. You may want to download a latest copy of BIN database as the URL stated above. The BIN database refers to the binary file ended with .BIN extension, but not the CSV format. Please select the right package for download.
USAGE
In this tutorial, we will show you on how to create a TestsController to display the IP information.
-
Create a TestsController in CakePHP using the below command line
- Create a Tests folder in /cakephp/templates if not exists.
- Create an empty index.php file in /cakephp/templates/Tests folder.
- Open the cakephp/src/Controller/TestsController.php in any text editor.
- Remove the contents in TestsController.php and add the below lines into the controller file.
Note: You just need to load the IP2Location library with use IP2LocationCakePHP\Controller\IP2LocationCoresController to use the functions.
- Enter the URL
/Tests and run. You should see the information of 8.8.8.8 IP address.
DEPENDENCIES
This library requires IP2Location BIN data file or IP2Location API key to function. You may download the BIN data file at
- IP2Location LITE BIN Data (Free): https://lite.ip2location.com
- IP2Location Commercial BIN Data (Comprehensive): https://www.ip2location.com
You can also sign up for IP2Location.io IP Geolocation API to get one free API key.
IPv4 BIN vs IPv6 BIN
Use the IPv4 BIN file if you just need to query IPv4 addresses.
Use the IPv6 BIN file if you need to query BOTH IPv4 and IPv6 addresses.
SUPPORT
Email: [email protected]
Website: https://www.ip2location.com
All versions of ip2location-cakephp with dependencies
cakephp/cakephp Version >=3.0
ip2location/ip2location-php Version >=9.0