StaticFileHandlingHelper
in package
FinalYes
Helper for serving static files
Table of Contents
Constants
- ALLOWED_EXTENSIONS = ['css', 'js', 'png', 'jpg', 'jpeg', 'ico', 'svg']
Properties
- $mimeMap : array<string|int, mixed>
- $publicRoot : string
Methods
- __construct() : mixed
- serve() : bool
Constants
ALLOWED_EXTENSIONS
private
mixed
ALLOWED_EXTENSIONS
= ['css', 'js', 'png', 'jpg', 'jpeg', 'ico', 'svg']
Properties
$mimeMap
private
array<string|int, mixed>
$mimeMap
= ['css' => 'text/css', 'js' => 'application/javascript', 'png' => 'image/png', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'ico' => 'image/x-icon', 'svg' => 'image/svg+xml']
$publicRoot read-only
private
string
$publicRoot
Methods
__construct()
public
__construct(string $publicRoot) : mixed
Parameters
- $publicRoot : string
serve()
public
serve(string $uriPath) : bool
Parameters
- $uriPath : string