PHPackages                             matthimatiker/stack-static-files - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. matthimatiker/stack-static-files

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

matthimatiker/stack-static-files
================================

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

0.0.1(10y ago)117[1 issues](https://github.com/Matthimatiker/StackStaticFiles/issues)MITPHPPHP &gt;=5.5.0

Since Sep 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/Matthimatiker/StackStaticFiles)[ Packagist](https://packagist.org/packages/matthimatiker/stack-static-files)[ RSS](/packages/matthimatiker-stack-static-files/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

StackStaticFiles
================

[](#stackstaticfiles)

[![Build Status](https://camo.githubusercontent.com/9d84d811ad2f98e25802ae24da1a6a21bccec0313849a603d3f7cbb83eaf3cf6/68747470733a2f2f7472617669732d63692e6f72672f4d61747468696d6174696b65722f537461636b53746174696346696c65732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/Matthimatiker/StackStaticFiles)[![Coverage Status](https://camo.githubusercontent.com/150585d30263d543d52cf66c9f9f996e7178b00b7a92c477a09f0072bf063737/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f4d61747468696d6174696b65722f537461636b53746174696346696c65732f62616467652e7376673f6272616e63683d6d617374657226736572766963653d676974687562)](https://coveralls.io/github/Matthimatiker/StackStaticFiles?branch=master)

Simple [StackPHP](http://stackphp.com/) middleware that serves files from a given directory. If the requested file does not exist, then the request is delegated to the next kernel.

Motivation
----------

[](#motivation)

This middleware has been created to be able to use [php-pm/php-pm](https://github.com/php-pm/php-pm)with [php-pm/php-pm-httpkernel](https://github.com/php-pm/php-pm-httpkernel) as a standalone server. It avoided the need of nginx for serving static files.

Installation
------------

[](#installation)

This library is installed via [Composer](http://getcomposer.org/). Add the following dependency to your `composer.json`:

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

```

Concept
-------

[](#concept)

Usage
-----

[](#usage)

You can use [stack/builder](https://github.com/stackphp/builder) to compose your middleware stack:

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

```

Alternatively, you can combine kernel and middleware manually:

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

```

Known Issues
------------

[](#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.

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3956d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6355640b8a36b275627380128860f32f7eb196a5ca559b21ab473af98e7e99f6?d=identicon)[Matthimatiker](/maintainers/Matthimatiker)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/matthimatiker-stack-static-files/health.svg)

```
[![Health](https://phpackages.com/badges/matthimatiker-stack-static-files/health.svg)](https://phpackages.com/packages/matthimatiker-stack-static-files)
```

###  Alternatives

[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M388](/packages/easycorp-easyadmin-bundle)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k185.6M2.4k](/packages/symfony-security-bundle)[symfony/security-http

Symfony Security Component - HTTP Integration

1.7k177.2M382](/packages/symfony-security-http)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)[symfony/ux-autocomplete

JavaScript Autocomplete functionality for Symfony

645.9M39](/packages/symfony-ux-autocomplete)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
