2017 © Pedro Peláez
 

library stack-static-files

StackPHP middleware that serves static files from a configured asset directory.

image

matthimatiker/stack-static-files

StackPHP middleware that serves static files from a configured asset directory.

  • Friday, September 4, 2015
  • by Matthimatiker
  • Repository
  • 1 Watchers
  • 1 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

StackStaticFiles

Build Status Coverage Status, (*1)

Simple StackPHP middleware that serves files from a given directory. If the requested file does not exist, then the request is delegated to the next kernel., (*2)

Motivation

This middleware has been created to be able to use php-pm/php-pm with php-pm/php-pm-httpkernel as a standalone server. It avoided the need of nginx for serving static files., (*3)

Installation

This library is installed via Composer. Add the following dependency to your composer.json:, (*4)

"require" :  {
    // ...
    "matthimatiker/stack-static-files": "^0.0.1"
}

Concept

Usage

You can use stack/builder to compose your middleware stack:, (*5)

$stack = (new Builder())->push(StaticFiles::class, __DIR__ . '/public-files');
$app = $stack->resolve($kernel);

Alternatively, you can combine kernel and middleware manually:, (*6)

$app = new StaticFiles($kernel,  __DIR__ . '/public-files');

Known Issues

Do not register a directory, which contains files that should not be served! This middleware has no security baked in and will serve any existing file, for example PHP scripts, VCS files etc., (*7)

The Versions

04/09 2015

dev-master

9999999-dev

StackPHP middleware that serves static files from a configured asset directory.

  Sources   Download

MIT

The Requires

 

The Development Requires

04/09 2015

0.0.1

0.0.1.0

StackPHP middleware that serves static files from a configured asset directory.

  Sources   Download

MIT

The Requires

 

The Development Requires