Download the PHP package germania-kg/client-location without Composer

On this page you can find all versions of the php package germania-kg/client-location. 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 client-location


Germania KG · ClientLocation

Packagist PHP version Build Status Scrutinizer Code Quality Code Coverage Build Status

Installation

PSR-15 Middleware

The middleware checks the incoming ServerRequest for a client-ip attribute. The client IP is passed to the factory callable which returns some location information. This client location is then stored in the ServerRequest as client-location attribute.

If the client-ip attribute is not set or empty, the middleware does nothing and passes on to the RequestHandler.

The ClientIpLocationMiddleware implements PSR-15 MiddlewareInterface. The constructor requires

Configuration

Both attribute names can be renamed. Here the defaults:

HttpClientLocationCreator

the HttpClientLocationCreator is a callable class which accepts the client IP and returns the client location. Its constructor requires an API endpoint, a PSR-18 HTTP client and a PSR-17 Request factory.

The API endpoint should contain a {{ip}} template variable where the client IP is placed in.

Configuration

Set custom API response decoder

Per default, the response will be json_decoded as associative array. You can specify a custom response decoder:

Set default location to return when HTTP client throws exception:

Set PSR-3 Logger:

Issues

See full issues list.

Development

Grab and go using one of these:

Unit tests

Either copy phpunit.xml.dist to phpunit.xml and adapt to your needs, or leave as is. Run PhpUnit test or composer scripts like this:


All versions of client-location with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3|^8.0
psr/log Version ^1.1
psr/http-message Version ^1.0
psr/http-server-handler Version ^1.0
psr/http-server-middleware Version ^1.0
psr/http-factory Version ^1.0
psr/http-client Version ^1.0
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 germania-kg/client-location contains the following files

Loading the files please wait ....