2017 © Pedro Peláez
 

library jugoya

A simple HTTP application builder using PSR-15 HTTP Server Request Handler and Middleware.

image

n1215/jugoya

A simple HTTP application builder using PSR-15 HTTP Server Request Handler and Middleware.

  • Wednesday, February 21, 2018
  • by n1215
  • Repository
  • 1 Watchers
  • 2 Stars
  • 183 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 14 Versions
  • 0 % Grown

The README.md

Jugoya(十五夜)🌕

Latest Stable Version License Build Status Code Coverage Scrutinizer Code Quality, (*1)

A simple HTTP application builder using PSR-15 HTTP Server Request Handler and Middleware., (*2)

Jugoya is the Japanese full moon festival on the 15th day of the eighth month of the traditional Japanese calendar., (*3)

PSR-15 HTTP Server Handler and Middleware

psr15_middleware, (*4)

See php-fig/fig-standards, (*5)

What Jugoya does

Jugoya create a new instance of RequestHandlerInterface from a instance of RequestHandlerInterface and instances of MiddlewareInterface. composition, (*6)

Code Example

// 1. register handler and middleware dependencies to the PSR-11 Container
/** @var \Psr\Container\ContainerInterface $container */
$container = new YourContainer();
//
// do stuff
//


// 2. create a builder
$builder = \N1215\Jugoya\RequestHandlerBuilder::fromContainer($container);

// LazyRequestHandlerBuilder resolves handler and middleware lazily.
// $builder = \N1215\Jugoya\LazyRequestHandlerBuilder::fromContainer($container);

// 3. build a request handler
/**
 * You can use one of
 *   * an instance of PSR-15 RequestHandlerInterface
 *   * a callable having the same signature with PSR-15 RequestHandlerInterface
 *   * a string identifier of a PSR-15 RequestHandlerInterface instance in the PSR-11 Container
 *
 * @var RequestHandlerInterface|callable|string $coreHandler
 *
 */
$coreHandler = new YourApplication();

/** @var RequestHandlerInterface $handler */
$handler = $builder->build($coreHandler, [

        // You can use instances of PSR-15 MiddlewareInterface
        new YourMiddleware(),

        // or callables having the same signature with PSR-15 MiddlewareInterface
        function(ServerRequestInterface $request, RequestHandlerInterface $handler) {
            // do stuff
            $response = $handler->handle($request);
            // do stuff
            return $response;
        },

        // or string identifiers of PSR-15 MiddlewareInterface instances in the PSR-11 Container
        YourMiddleware::class,
    ]);


// 4. handle a PSR-7 Sever Request
/** @var Psr\Http\Message\ServerRequestInterface $request */
$request = \Zend\Diactoros\ServerRequestBuilder::fromGlobals();
/** @var \Psr\Http\Message\ResponseInterface $response */
$response = $handler->handle($request);

Class diagrams

Jugoya

jugoya, (*7)

Resolver

resolver, (*8)

Wrapper

wrapper, (*9)

License

The MIT License (MIT). Please see LICENSE for more information., (*10)

The Versions

21/02 2018

dev-master

9999999-dev https://github.com/n1215/jugoya

A simple HTTP application builder using PSR-15 HTTP Server Request Handler and Middleware.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher request handler

21/02 2018

v1.0.0

1.0.0.0 https://github.com/n1215/jugoya

A simple HTTP application builder using PSR-15 HTTP Server Request Handler and Middleware.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher request handler

06/01 2018

v0.7.2

0.7.2.0 https://github.com/n1215/jugoya

A simple HTTP application builder using PSR-15 HTTP Server Request Handler and Middleware.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher request handler

06/01 2018

v0.7.3

0.7.3.0 https://github.com/n1215/jugoya

A simple HTTP application builder using PSR-15 HTTP Server Request Handler and Middleware.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher request handler

08/12 2017

v0.7.1

0.7.1.0 https://github.com/n1215/jugoya

A simple HTTP application builder using PSR-15 HTTP Server Request Handler and Middleware.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher request handler

07/12 2017

v0.7.0

0.7.0.0 https://github.com/n1215/jugoya

A simple PSR-15 HTTP application factory.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher

06/12 2017

v0.6.0

0.6.0.0 https://github.com/n1215/jugoya

A simple PSR-15 HTTP application factory.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher

02/12 2017

v0.5.0

0.5.0.0 https://github.com/n1215/jugoya

A simple PSR-15 HTTP application factory.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher

01/08 2017

dev-dev

dev-dev https://github.com/n1215/jugoya

A simple PSR-15 HTTP application factory.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher

03/06 2017

v0.4.1

0.4.1.0 https://github.com/n1215/jugoya

A simple PSR-15 HTTP application factory.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher

02/06 2017

v0.4.0

0.4.0.0 https://github.com/n1215/jugoya

A simple PSR-15 HTTP application factory.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher

01/06 2017

v0.3.0

0.3.0.0 https://github.com/n1215/jugoya

A simple PSR-15 HTTP application factory.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15 middleware dispatcher

31/05 2017

v0.2.0

0.2.0.0 https://github.com/n1215/jugoya

A PSR-15 HTTP application builder.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15

30/05 2017

v0.1.0

0.1.0.0 https://github.com/n1215/jugoya

A PSR-15 HTTP application builder.

  Sources   Download

MIT

The Requires

 

The Development Requires

by Avatar n1215

middleware psr-15