2017 © Pedro Peláez
 

library php-server-interface-middleware

Middleware to filter based on server type interface e.g. PHP SAPI

image

pavlakis/php-server-interface-middleware

Middleware to filter based on server type interface e.g. PHP SAPI

  • Wednesday, July 6, 2016
  • by pavlakis
  • Repository
  • 2 Watchers
  • 1 Stars
  • 559 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 3 Versions
  • 93 % Grown

The README.md

Build Status Total Downloads Latest Stable Version codecov PHPStan, (*1)

Server Interface (SAPI) Middleware

Middleware to filter based on server type interface e.g. PHP SAPI, (*2)

Add it with composer

composer require pavlakis/php-server-interface-middleware

Pass it to a route

Use by adding it to a route. e.g. in Slim 3:, (*3)

$app->get('/status', 'PHPMinds\Action\EventStatusAction:dispatch')
    ->add(new Pavlakis\Middleware\Server\Sapi(["cli"]))

We can pass an array of accepted interfaces. If those are not matched, a default response with a 403 status code will be returned., (*4)

Pass a custom response

For a custom response pass a Response object. e.g., (*5)

        $whiteList = ["cli"];
        $sapiRes = new Response();
        $sapiRes = $sapiRes->withStatus(500);

        $sapi = new Sapi($whiteList, $sapiRes);

The Versions

06/07 2016

dev-master

9999999-dev http://github.com/pavlakis/php-server-interface-middleware

Middleware to filter based on server type interface e.g. PHP SAPI

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.5.0

 

The Development Requires

middleware server cli slim interface php-sapi sapi

06/07 2016

0.1

0.1.0.0 http://github.com/pavlakis/php-server-interface-middleware

Middleware to filter based on server type interface e.g. PHP SAPI

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.5.0

 

The Development Requires

middleware server cli slim interface php-sapi sapi

06/07 2016

dev-develop

dev-develop http://github.com/pavlakis/php-server-interface-middleware

Middleware to filter based on server type interface e.g. PHP SAPI

  Sources   Download

BSD-3-Clause

The Requires

  • php >=5.5.0

 

The Development Requires

middleware server cli slim interface php-sapi sapi