chubbyphp/chubbyphp-static-file
最新稳定版本:1.4.0
Composer 安装命令:
composer require chubbyphp/chubbyphp-static-file
包简介
A minimal static file middleware for PSR 15.
README 文档
README
Description
A minimal static file middleware for PSR 15.
Requirements
- php: ^8.3
- psr/http-factory: ^1.1
- psr/http-message: ^1.1|^2.0
- psr/http-server-handler: ^1.0.2
- psr/http-server-middleware: ^1.0.2
Installation
Through Composer as chubbyphp/chubbyphp-static-file.
composer require chubbyphp/chubbyphp-static-file "^1.4"
Usage
<?php declare(strict_types=1); namespace App; use Chubbyphp\StaticFile\StaticFileMiddleware; use Psr\Http\Message\ResponseFactoryInterface; use Psr\Http\Message\StreamFactoryInterface; /** @var ResponseFactoryInterface $responseFactory */ $responseFactory = ...; /** @var StreamFactoryInterface $streamFactory */ $streamFactory = ...; $app = ...; // add the static file middleware before the routing your PSR15 based framework $app->add(new StaticFileMiddleware( $responseFactory, $streamFactory, __DIR__ . '/public' ));
Copyright
2025 Dominik Zogg
统计信息
- 总下载量: 97
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 2
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-10-17