Download the PHP package rafalmasiarek/dashboard-kit-addon-geoip without Composer
On this page you can find all versions of the php package rafalmasiarek/dashboard-kit-addon-geoip. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download rafalmasiarek/dashboard-kit-addon-geoip
More information about rafalmasiarek/dashboard-kit-addon-geoip
Files in rafalmasiarek/dashboard-kit-addon-geoip
Package dashboard-kit-addon-geoip
Short Description GeoIP middleware and log processor addon for dashboard-kit
License BUSL-1.1
Informations about the package dashboard-kit-addon-geoip
dashboard-kit-addon-geoip
GeoIP middleware and log enrichment addon for dashboard-kit.
Resolves the client IP to country, city, and region on every request. Stores results in $_SERVER (compatible with nginx ngx_http_geoip_module) and enriches all Monolog log channels with geo context fields.
Installation
For the built-in MaxMind driver, also install:
Download a free GeoLite2-City.mmdb database from MaxMind.
Usage
Custom driver
Bind a custom driver before calling register(). The built-in MaxMind driver is skipped automatically.
HTTP driver tips
For HTTP-based drivers (ip-api.com, ipinfo.io, custom API):
- Use cURL — supports HTTPS and configurable timeout
- Accept a configurable URL template with
%sfor the IP - Point the URL at a Cloudflare Worker to get automatic retries, HTTPS, and rate-limit handling
$_SERVER keys
After the middleware runs, the following keys are available globally:
| Key | Example value |
|---|---|
GEOIP_COUNTRY |
Poland |
GEOIP_COUNTRY_CODE |
PL |
GEOIP_CITY |
Warsaw |
GEOIP_REGION |
Masovian Voivodeship |
Keys already set by nginx or Cloudflare are never overwritten.
Log enrichment
All Monolog channels (app, audit, error) automatically receive geo context on every log record:
geoip.log
Each driver call produces one audit line in {logs_dir}/geoip.log:
req.id appears automatically when dashboard-kit-request-id is registered before this addon.
Custom log formatter
Default format is KvLineFormatter (key=value lines). Override before register():
Configuration reference
When db_path is not set and no custom driver is bound in the container, GeoIpAddon::register() does nothing — no middleware is added and no log processor is registered. This allows the addon call to remain in index.php without crashing when the database file is not yet available.
Requirements
- PHP 8.2+
- dashboard-kit
- monolog/monolog ^3
- geoip2/geoip2 ^4.0 (only for MaxMindDriver)
License
Business Source License 1.1 — see LICENSE. For alternative licensing, contact us.
All versions of dashboard-kit-addon-geoip with dependencies
rafalmasiarek/dashboard-kit Version ^2.1
slim/slim Version ^4
slim/psr7 Version ^1
psr/http-server-middleware Version ^1
monolog/monolog Version ^3