monolyth/plumber

Utilities for the Monolyth unframework

1.1.0 2018-02-14 06:16 UTC

This package is auto-updated.

Last update: 2024-04-14 22:13:50 UTC


README

Utilities for the Monolyth unframework

Installation

Composer (recommended)

$ composer require monolyth/plumber

Manual

  1. Download or clone the repository;
  2. Add /path/to/plumber/src for namespace Monolyth\Plumber to your PSR-4 autoloader.

Usage

Currently only 2 utilities are included: Utf8 and Proxy. Statically call the handle method on the classes to utilise them.

Utf8

The Utf8::handle method normalises PHP's UTF-8 handling.

Proxy

The Proxy::handle method attempts to normalise the X_HTTP_FORWARDED_FOR header so you can just use REMOTE_ADDR everywhere. Note that not all proxies handle this the same, so you might need to roll your own.