beporter/betablockermiddleware

A single-file PSR-15 Middleware class that implements http cookie-based gatekeeping on a PHP app.

Maintainers

Package info

github.com/beporter/betablockermiddleware

Type:cakephp-plugin

pkg:composer/beporter/betablockermiddleware

Transparency log

Statistics

Installs: 14

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

1.0.2 2026-08-04 00:16 UTC

This package is auto-updated.

Last update: 2026-08-04 00:27:06 UTC


README

A single-file PSR-15 Middleware class that implements cookie-based gatekeeping on a PHP app in a single file.

Also provides a completely optional CakePHP plugin wrapper.

Usage

  1. From your PHP project, run composer require beporter/betablockermiddleware.

From here, the process diverges a bit depending on the host application.

General

  1. Wherever your app defines the Middlware stack,
  2. use Beporter\BetaBlockerMiddleware\Middleware\BetaBlockerMiddleware;
  3. $yourMiddlewareQueue->add(new BetaBlockerMiddleware(['cookie_value' => 'some pass']));

CakePHP

  1. Run bin/cake plugin load beporter/betablockermiddleware.

  2. Review the settings that were added to config/plugins.php. In particular, make sure the ['middleware' => true] key is set.

  3. Add at least the following key to your config/app.php:

    'BetaBlockerMiddleware' => [
        'cookie_value' => 'some password you want to give people',
    ],

Optional config keys

'BetaBlockerMiddleware' => [
    'expiration' => '+1 month',
    'redirect_url' => 'https://your.app.com/some/specific/destination',
    'beta_form' => '<form ...>override the password entry page here</form>',
],

Requirements

  • PHP v7.4+
  • A PSR-7 / PSR-15 compatible http request handling stack.

Contributing

Code of Conduct

Participation with this project requires compliance with our code of conduct.

Reporting Issues

Please use GitHub Isuses for listing any known defects or issues.

Development

Please fork this repository, create a new topic branch, and submit a pull request for your work.

Setup

TODO

License

MIT

Copyright

Copyright © 2026 Brian Porter