Download the PHP package chubbyphp/chubbyphp-static-file without Composer
On this page you can find all versions of the php package chubbyphp/chubbyphp-static-file. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download chubbyphp/chubbyphp-static-file
More information about chubbyphp/chubbyphp-static-file
Files in chubbyphp/chubbyphp-static-file
Download chubbyphp/chubbyphp-static-file
More information about chubbyphp/chubbyphp-static-file
Files in chubbyphp/chubbyphp-static-file
Vendor chubbyphp
Package chubbyphp-static-file
Short Description A minimal static file middleware for PSR 15.
License MIT
Package chubbyphp-static-file
Short Description A minimal static file middleware for PSR 15.
License MIT
Please rate this library. Is it a good library?
Informations about the package chubbyphp-static-file
chubbyphp-static-file
Description
A minimal PSR-15 middleware that serves static files from a public directory.
- Serves only regular, readable files inside the public directory; path traversal and symlinks pointing outside are rejected.
- Handles
GETandHEADrequests, any other method is passed to the next handler. - Sends
Content-Type(based on the file extension,application/octet-streamas fallback),Content-Length,ETagandX-Content-Type-Options: nosniff. - Responds with
304 Not Modifiedif theIf-None-Matchheader matches the file'sETag. - Passes the request to the next handler if no matching file exists.
Requirements
- php: ^8.3
Installation
Through Composer as chubbyphp/chubbyphp-static-file.
Usage
Register the middleware before the routing of your PSR-15 based framework, so that static files are served without hitting a route.
Options
The constructor accepts two optional arguments:
$hashAlgorithm(default:md5): the algorithm used to calculate theETag, must be supported by hash_algos().$mimetypes(default: bundled list based on the Apache mime.types, regenerate withphp generate-mimetypes.php): a map of file extension to mime type.
Copyright
2026 Dominik Zogg
All versions of chubbyphp-static-file with dependencies
PHP Build Version
Package Version
Requires
php Version
^8.3
psr/http-factory Version ^1.1
psr/http-message Version ^1.1|^2.0
psr/http-server-handler Version ^1.0.2
psr/http-server-middleware Version ^1.0.2
psr/http-factory Version ^1.1
psr/http-message Version ^1.1|^2.0
psr/http-server-handler Version ^1.0.2
psr/http-server-middleware Version ^1.0.2
The package chubbyphp/chubbyphp-static-file contains the following files
Loading the files please wait ...