Northwoods Lazy Middleware

Overview

Northwoods Lazy Middleware

Build Status Code Quality Code Coverage Latest Stable Version Total Downloads License

Lazy loading for PSR-15 middleware and request handlers that supports "just in time" instantiation using a PSR-11 container.

Installation

The best way to install and use this package is with composer:

composer require northwoods/lazy-middleware

Usage

This package contains two factories: one for request handlers and one for middleware.

LazyHandlerFactory::defer($handler)

Create a new lazy handler.

The $handler identifier is not required to be a class name. Any string that refers to a container identifier can be used.

use Northwoods\Middleware\LazyHandlerFactory;

/** @var ContainerInterface */
$container = /* any container */;

$lazyHandler = new LazyHandlerFactory($container);

/** @var \Psr\Http\Server\RequestHandlerInterface */
$handler = $lazyHandler->defer(Acme\FooHandler::class);

LazyMiddlewareFactory::defer($middleware)

Create a new lazy middleware.

The $middleware identifier is not required to be a class name. Any string that refers to a container identifier can be used.

use Northwoods\Middleware\LazyMiddlewareFactory;

/** @var ContainerInterface */
$container = /* any container */;

$lazyMiddleware = new LazyMiddlewareFactory($container);

/** @var \Psr\Http\Server\MiddlewareInterface */
$middleware = $lazyMiddleware->defer(Acme\BarMiddleware::class);
You might also like...
Slim Framework CSRF protection middleware

Slim Framework CSRF Protection This repository contains a Slim Framework CSRF protection PSR-15 middleware. CSRF protection applies to all unsafe HTTP

Guide to setting up a lazy loader with the jQuery Lazy library in WordPress.

Run jQuery Lazy in Wordpress Guide to setting up a lazy loader with the jQuery Lazy library in WordPress. Installation Step 1: Refer to the footer.php

PSR-7 middleware foundation for building and dispatching middleware pipelines

laminas-stratigility From "Strata", Latin for "layer", and "agility". This package supersedes and replaces phly/conduit. Stratigility is a port of Sen

Load files and classes as lazy collections in Laravel.

Lody Load files and classes as lazy collections in Laravel. Installation composer require lorisleiva/lody Usage Lody enables you to fetch all exist

Framework agnostic package to load heavy JSON in lazy collections.

Lazy JSON Framework agnostic package to load heavy JSON in lazy collections. Under the hood, the brilliant JSON Machine by @halaxa is used as lexer an

šŸ¼ Framework agnostic package using asynchronous HTTP requests and PHP generators to load paginated items of JSON APIs into Laravel lazy collections.

Framework agnostic package using asynchronous HTTP requests and generators to load paginated items of JSON APIs into Laravel lazy collections.

 Lazyline - Innovative Lazy-Load & LQIP WordPress Plugin
Lazyline - Innovative Lazy-Load & LQIP WordPress Plugin

Multifunctional WordPress image-optimization plugin. Provides many lazy-load features (backgrounds, video, sources, iframes, scripts, hidpi, webp), full LQIP support (thumbnails, color palette, pixelart, primitives), and additional image optimization/validation options.

Guide to setting up a lazy loader with the Lozad library in WordPress.

Install WordPress LazyLoader with LOZAD Guide to setting up a lazy loader with the Lozad library in WordPress. Installation Step 1: Refer to the foote

Guide to setting up a lazy loader with the Lozad library in WordPress.

Install WordPress LazyLoader with LOZAD Guide to setting up a lazy loader with the Lozad library in WordPress. Installation Step 1: Refer to the foote

PSR-15 middleware in minutes!

zend-expressive Repository abandoned 2019-12-31 This repository has moved to mezzio/mezzio. Develop PSR-7 middleware applications in minutes! zend-exp

Middleware for PHP built on top of PSR-7 and PSR-15

zend-stratigility Repository abandoned 2019-12-31 This repository has moved to laminas/laminas-stratigility. From "Strata", Latin for "layer", and "ag

Slim Framework 2 middleware

Slim Framework Middleware This repository contains a library of optional middleware for your Slim Framework application. How to Install Update your co

Fast PSR-7 based routing and dispatch component including PSR-15 middleware, built on top of FastRoute.

Route This package is compliant with PSR-1, PSR-2, PSR-4, PSR-7, PSR-11 and PSR-15. If you notice compliance oversights, please send a patch via pull

A pjax middleware for Laravel
A pjax middleware for Laravel

A pjax middleware for Laravel Pjax is a jQuery plugin that leverages ajax to speed up the loading time of your pages. It works by only fetching specif

Provides a Middleware to integration Tideways into Symfony Messenger Processing

Tideways Middleware for Symfony Messenger This package is currently under development and might be moved into the Tideways PHP Extension or stay indep

CORS (Cross-Origin Resource Sharing) middleware for Hyperf application.

CORS Middleware for Hyperf Implements fruitcake/laravel-cors for Hyperf. Features Handles CORS pre-flight OPTIONS requests Adds CORS headers to your r

Laravel Idempotency Middleware

Laravel Idempotency Middleware Install Require this package with composer using the following command: composer require revangelista/laravel-idempoten

Disable Google's FLoC with help of PSR-15 middleware

Disable Google's FLoC with PSR-15 middleware This package will help you disable Google's FLoC. Installation You can install the package via composer:

A simple and flexible PHP middleware dispatcher based on PSR-7, PSR-11, and PSR-15

Woohoo Labs. Harmony Woohoo Labs. Harmony is a PSR-15 compatible middleware dispatcher. Harmony was born to be a totally flexible and almost invisible

Comments
  • Remove type check on identifiers

    Remove type check on identifiers

    Checking the type of container identifier is inconsistent with PSR-11, which allows for identifiers that are not class names. The correct solution is to enforce typing via the resolve() method.

    opened by shadowhand 1
Owner
Northwoods Technology
Artisan packages developed in the woods
Northwoods Technology
Yii-specific middleware

Yii Middleware The package ... Requirements PHP 8.0 or higher. Installation The package could be installed with composer: composer require yiisoft/yii

Yii Software 9 Nov 4, 2022
This repository contains a library of optional middleware for your Slim Framework application

Slim Framework Middleware This repository contains a library of optional middleware for your Slim Framework application. How to Install Update your co

Slim Framework 47 Nov 7, 2022
Juliangut Slim Framework Doctrine handler middleware

Juliangut Slim Framework Doctrine handler middleware Doctrine handler middleware for Slim Framework. Slim3 version Doctrine integration service for Sl

JuliƔn GutiƩrrez 6 Mar 23, 2021
This Slim Framework middleware will compile LESS CSS files on-the-fly using the Assetic library

This Slim Framework middleware will compile LESS CSS files on-the-fly using the Assetic library. It supports minification and caching, also via Asseti

Gerard Sychay 22 Mar 31, 2020
Middleware to execute request handlers discovered by a router

middlewares/request-handler Middleware to execute request handlers discovered by a router.

Middlewares 39 Dec 9, 2022
Access control middleware for Slim framework

Slim Access Access control middleware for Slim framework. Supported formats IPv4 and IPv6 addresses CIDR notation all keyword Installation composer re

Alexandre Bouvier 7 Oct 22, 2019
Redis cache middleware for Slim framework

RedisCache Redis cache middleware for Slim framework. Installation composer require abouvier/slim-redis-cache Usage Cache every successful HTTP respo

Alexandre Bouvier 16 Sep 20, 2021
Slim Framework HTTP cache middleware and service provider

Slim Framework HTTP Cache This repository contains a Slim Framework HTTP cache middleware and service provider. Install Via Composer $ composer requir

Slim Framework 107 Dec 15, 2022
CORS Middleware for PHP Slim Framework

CorsSlim Cross-origin resource sharing (CORS) Middleware for PHP Slim Framework. Usage Composer Autoloader Install with Composer Update your composer.

Palani Kumanan 92 Nov 30, 2021
PHP slim framework middleware to minify HTML output

slim-minify Slim middleware to minify HTML output generated by the slim PHP framework. It removes whitespaces, empty lines, tabs beetween html-tags an

Christian Klisch 35 Oct 31, 2021