Download the PHP package taylornetwork/geo-ip without Composer

On this page you can find all versions of the php package taylornetwork/geo-ip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package geo-ip

GeoIP for Laravel

An easy way to get the location of an IP address in Laravel 5

Install

Via Composer

Setup

Register the service provider in the providers array in config/app.php


Add the GeoIP facade to the aliases array in config/app.php


Publish Config

Adds geoip.php to your config folder

Basic Usage

Helper Function

This package comes with a global helper function geoip which will return call the GeoIP class for you.

Get the location of a specific IP address by passing it to geoip

Calling geoip() with no parameters will return the location of your IP address.

Class

Available Methods

findIP (string | null $ip)

Usage is identical to helper function (see Helper Function)

makeRequest (string | null $ip)

Returns the raw response from the HTTP request.

If called with no parameters, your IP address location is returned.

decode (mixed $response)

Decodes the response given by $response.

By default a JSON string is returned (see makeRequest), decode will decode the response with json_decode to return an object.

getGuzzleClient ()

Returns an instance of GuzzleHttp\Client

getDriver ()

Returns an instance of the driver, by default FreeGeoIP

See Drivers

Facade

All methods in the class are available with the facade. (see Class)

Drivers

This package comes with a FreeGeoIP driver by default. However you can use any custom driver you want with this package.

To create a new driver run

This will generate a driver class in App\GeoIP\Drivers

To use a driver, it MUST be registered in config/geoip.php

A driver class will look something like this.

All properties in the define() function must be set to a non empty value

Override Methods

If you want to use your own function to find an IP address, or need to format the response after an HTTP request you can override these methods in your driver.

responseCallback (mixed $response)

Called after an HTTP request, but before passing to the GeoIP decode function (see Decode)

findIP (string | null $ip)

Called when findIP is called from class. If false is returned, GeoIP will do the work. If not the response is then passed to responseCallback and then decode

Available Methods

property (string $key)

Returns a driver property.

properties ()

Returns all driver properties in an associative array.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of geo-ip with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
laravel/framework Version ^5.3
guzzlehttp/guzzle Version ^6.2
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package taylornetwork/geo-ip contains the following files

Loading the files please wait ....