PHPackages                             york8/poa-static - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. york8/poa-static

ActiveLibrary[HTTP &amp; Networking](/categories/http)

york8/poa-static
================

Poa static file serving middleware.

0.1.0(8y ago)17MITPHP

Since Feb 23Pushed 8y agoCompare

[ Source](https://github.com/york8/php-poa-static)[ Packagist](https://packagist.org/packages/york8/poa-static)[ RSS](/packages/york8-poa-static/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

poa-static
==========

[](#poa-static)

[![Latest Version on Packagist](https://camo.githubusercontent.com/e19d1ce78a7da14df9461377e5d26458645ed9b5ed90299d7bfe77c5fcf923a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f796f726b382f706f612d7374617469632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/york8/poa-static)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/f407720fa516356ed717804abc3864418bb29ba80b71a773194948ecc5db262d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f796f726b382f706f612d7374617469632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/york8/poa-static)

poa-static 是[POA](https://raw.githubusercontent.com/york8/php-poa)框架的一个中间件，用来处理静态文件的请求

作者
--

[](#作者)

- [York](https://github.com/york8)

安装
--

[](#安装)

```
composer require york8/poa-static
```

使用
--

[](#使用)

```
$app = new Application();

$staticMiddleware = new StaticMiddleware('..');
$staticMiddleware->use(new ProfileMiddleware())->use(new SimpleFilenamePlugin('/static'));

// 定义路由器，将路径 /static 前缀开头的请求交给 StaticMiddleware 处理
$router = new RouterMiddleware(function (Context $context) {
    $context->statusCode(404)->send('Not Found');
});
$router->get('/static', $staticMiddleware);

$app->useErrorMiddleware(function (Throwable $throwable) {
    // 全局未捕获 错误/异常 处理
    fwrite(STDERR, $throwable->getMessage() . "\n");
})
    // 简单请求错误异常处理
    ->use(function (Context $context) {
        try {
            yield;
        } catch (Throwable $exception) {
            fwrite(STDERR, $exception->getMessage() . "\n");
            $context->statusCode(500)->send($exception->getMessage());
        }
    })
    // 使用路由器
    ->use($router);

$app->listen('0.0.0.0:8088');
```

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

3003d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/f2e9047ab03fd9d26c0e915fb310145415891c35c0a7c55eb95f8a37de0ff433?d=identicon)[york8](/maintainers/york8)

---

Top Contributors

[![york8](https://avatars.githubusercontent.com/u/22073873?v=4)](https://github.com/york8 "york8 (1 commits)")

---

Tags

react-phpkoapoapoa-middlewarekoa-static

### Embed Badge

![Health badge](/badges/york8-poa-static/health.svg)

```
[![Health](https://phpackages.com/badges/york8-poa-static/health.svg)](https://phpackages.com/packages/york8-poa-static)
```

###  Alternatives

[friendsofsymfony/rest-bundle

This Bundle provides various tools to rapidly develop RESTful API's with Symfony

2.8k73.3M319](/packages/friendsofsymfony-rest-bundle)[php-http/discovery

Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations

1.3k309.5M1.2k](/packages/php-http-discovery)[nyholm/psr7

A fast PHP7 implementation of PSR-7

1.3k235.4M2.4k](/packages/nyholm-psr7)[pusher/pusher-php-server

Library for interacting with the Pusher REST API

1.5k94.8M293](/packages/pusher-pusher-php-server)[spatie/crawler

Crawl all internal links found on a website

2.8k16.3M52](/packages/spatie-crawler)[react/http

Event-driven, streaming HTTP client and server implementation for ReactPHP

78126.4M414](/packages/react-http)

PHPackages © 2026

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