designcise / bitframe-geolocation
GeoLocation middleware for BitFrame microframework
Installs: 25
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/designcise/bitframe-geolocation
Requires
- php: >=7.1.0
- designcise/bitframe: ^1.0.0
- geocoder-php/chain-provider: ^4.0
- geocoder-php/free-geoip-provider: ^4.0
- geocoder-php/geo-plugin-provider: ^4.0
- php-http/guzzle6-adapter: ^1.1
- php-http/message: ^1.6
- psr/http-server-middleware: ~1.0
- willdurand/geocoder: ^4.0
Requires (Dev)
- phpunit/phpunit: ^6.4
This package is auto-updated.
Last update: 2025-10-29 02:15:46 UTC
README
Geo Location wrapper class to fetch user geo data as a middleware.
Installation
See installation docs for instructions on installing and using this middleware.
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.
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:
License
Please see License File for licensing information.