2017 © Pedro Peláez
 

library bitframe-geolocation

GeoLocation middleware for BitFrame microframework

image

designcise/bitframe-geolocation

GeoLocation middleware for BitFrame microframework

  • Friday, May 18, 2018
  • by designcise
  • Repository
  • 1 Watchers
  • 0 Stars
  • 16 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 33 % Grown

The README.md

BitFrame\Locale\GeoLocation

Geo Location wrapper class to fetch user geo data as a middleware., (*1)

Installation

See installation docs for instructions on installing and using this middleware., (*2)

Usage Example

use \BitFrame\Locale\GeoLocation;
use \BitFrame\Locale\GeoLocationData;

require 'vendor/autoload.php';

$app = new \BitFrame\Application;

$app->run([
    /* In order to output the http response from the middlewares, 
     * make sure you include a response emitter middleware, for example:
     * \BitFrame\Message\DiactorosResponseEmitter::class, */
    GeoLocation::class,
    function($request, $response, $next) {
        $loc = $request->getAttribute(GeoLocationData::class);

        $response->getBody()->write('<pre>' . print_r($loc, true) . '</pre>');

        return $response;
    }
]);

Tests

To execute the test suite, you will need PHPUnit., (*3)

Contributing

  • File issues at https://github.com/designcise/bitframe-geolocation/issues
  • Issue patches to https://github.com/designcise/bitframe-geolocation/pulls

Documentation

Documentation is available at:, (*4)

  • https://www.bitframephp.com/middleware/locale/geolocation/

License

Please see License File for licensing information., (*5)

The Versions