Slim Framework 2 middleware

Overview

Slim Framework Middleware

This repository contains a library of optional middleware for your Slim Framework application.

How to Install

Update your composer.json manifest to require the slim/middleware package (see below). Run composer install or composer update to update your local vendor folder.

{
    "require": {
        "slim/middleware": "*"
    }
}

How to Contribute

Pull Requests

  1. Fork this repository
  2. Create a new branch for each feature or improvement
  3. Send a pull request from your feature branch to this repository's master branch

It is very important to separate new features or improvements into separate feature branches, and to send a pull request for each branch. This allows me to review and pull in new features or improvements individually.

Style Guide

All pull requests must adhere to the PSR-2 standard.

Author

The Slim Framework is created and maintained by Josh Lockhart. Josh is a senior web developer at New Media Campaigns. Josh also created and maintains PHP: The Right Way, a popular movement in the PHP community to introduce new PHP programmers to best practices and good information.

License

All code in this repository is released under the MIT public license.

http://www.slimframework.com/license

Comments
  • Added improved implementation of CSRF guard with ajax protection

    Added improved implementation of CSRF guard with ajax protection

    Added CSRF guard with request header check, compatible with AngularJS cookie & header names by default.

    Added configuration options including action on token check fail to address issues like this: http://help.slimframework.com/discussions/questions/912-catch-csrf-error

    Added helpers for Twig to ease template updates and jQuery configuration

    opened by siberex 2
  • Migrated StrongAuth middleware from Slim-Extras

    Migrated StrongAuth middleware from Slim-Extras

    This simply takes the StrongAuth middleware from Slim-Extras and ports it to the new slim middleware repo. This allows for StrongAuth to be used without having to include Slim-Extras which may cause problems with also using Slim-Views.

    opened by grantlucas 4
  • How start phpunit?

    How start phpunit?

    Hi, I have a problem with phpunit. I downloaded the project and init with "composer install". Then I started: "phpunit", but seems to have some problems. Can you help me? :D

    vagrant@vagrant:/tmp/Slim-Middleware-master$ phpunit PHPUnit 4.0.17 by Sebastian Bergmann.

    You have installed PHPUnit via PEAR. This installation method is no longer supported and http://pear.phpunit.de/ will be shut down no later than December, 31 2014.

    Please read http://phpunit.de/manual/current/en/installation.html and learn how to use PHPUnit from a PHAR or install it via Composer.

    Configuration read from /tmp/Slim-Middleware-master/phpunit.xml.dist

    FF

    Time: 43 ms, Memory: 3.75Mb

    There were 2 failures:

    1. ContentNegotiationTest::testBestFormatIsSet Failed asserting that null is not null.

    /tmp/Slim-Middleware-master/tests/ContentNegotiationTest.php:64

    1. ContentNegotiationTest::testBestFormatWithPriorities Failed asserting that null is not null.

    /tmp/Slim-Middleware-master/tests/ContentNegotiationTest.php:82

    FAILURES!
    Tests: 2, Assertions: 2, Failures: 2.

    opened by hachreak 0
  • [Proposal] add respondTo or respondWith

    [Proposal] add respondTo or respondWith

    I just come to read that http://help.slimframework.com/discussions/questions/65-content-types What do you think of adding that to the content negotiation middleware ? I can make a pr in this way if you are ok.

    opened by lalop 0
  • ParseRequestBody: like ContentTypes, but without breaking getBody()

    ParseRequestBody: like ContentTypes, but without breaking getBody()

    supplementing https://github.com/codeguy/Slim-Middleware/pull/2

    This feature branch would contain the variant where ContentTypes is deprecated and replaced by ParseRequestBody.

    This solution is not pretty, a programmer would need to write $env = $app->environment(); $env['slim.input_parsed']

    On the other hand, sneaking a method into the request object, so it would be possible to $app->request->getBodyParsed() would result in complex code more likely to contain bugs, and will sure enough cause some other programmer considerable headache sometime in the future. That's why I left it that way.

    In the end, it MAY be best to just do nothing and discard both of my pull requests. But first I wanted to discuss the matter with you.

    regards,

    Max

    opened by qyanu 0
Owner
Slim Framework
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.
Slim Framework
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

Zend Framework 718 Dec 9, 2022
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

Zend Framework 236 Sep 9, 2022
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

Slim Framework 47 Nov 7, 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
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
Routes and Middleware for Using OAuth2 Server within a Slim Framework API

Chadicus\Slim\OAuth2 A collection of OAuth2 Server routes, middleware and utilities for use within a Slim 3 Framework API Requirements Chadicus\Slim\O

Chad Gray 126 Oct 8, 2022
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
Image Resize Middleware for Slim Framework

Image Resize Middleware for Slim This middleware implements automatic image resizing based on image filename. Install You can install latest version u

Mika Tuupola 61 Apr 12, 2022
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
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

Slim Framework 302 Dec 11, 2022
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

Laminas Project 47 Dec 22, 2022
Slim Auth is an authorization and authentication library for the Slim Framework.

Slim Auth is an authorization and authentication library for the Slim Framework. Authentication is provided by the Zend Framework Zend\Authentication component, and authorization by the Zend Framework Zend\Permissions\Acl component.

Jeremy Kendall 246 Dec 16, 2022
Slim-Logger - A stand-alone logger class for use with the Slim Framework

Slim-Logger - A stand-alone logger class for use with the Slim Framework

Josh Lockhart 41 Mar 12, 2022
CORS Middleware for Lumen micro-framework

Lumen-CORS Cross-origin resource sharing (CORS) Middleware for Lumen micro-framework. Installation After you install lumen as per lumen docs, install

Palani Kumanan 101 Nov 21, 2022
PSR-15 middleware for Symfony framework.

PSR-15 middleware now in Symfony Contents Installation Configuration Usage Examples Customization Caching Real World Example Middlewares Testing Licen

kafkiansky 60 Dec 14, 2022
Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs.

Slim Framework Slim is a PHP micro-framework that helps you quickly write simple yet powerful web applications and APIs. Installation It's recommended

Slim Framework 11.5k Jan 4, 2023