PHPackages                             york8/poa - 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. [Framework](/categories/framework)
4. /
5. york8/poa

ActiveLibrary[Framework](/categories/framework)

york8/poa
=========

POA Web框架灵感来自于Node.js的KOA框架，基于React-PHP，使用生成器来实现中间件，轻松的组合管理多个中间件之间的协作

0.4.1(8y ago)11611MITPHPPHP &gt;=7.1.0

Since Jan 21Pushed 8y agoCompare

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

READMEChangelog (4)Dependencies (5)Versions (7)Used By (1)

POA
===

[](#poa)

[![Latest Version on Packagist](https://camo.githubusercontent.com/c2d48dc919f35184e9a81d4bb1d502274769ca6d7d24d97ed170d8e5d1b2aaad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f796f726b382f706f612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/york8/poa)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/b5c31f13f9ca456aba7bec21b8014e5cc276c6bfd2f58090e83c574178c43838/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f796f726b382f706f612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/york8/poa)

POA（Php cOroutine based Application framework）Web框架，灵感来自于 Node.js 的 KOA 框架，基于 React-PHP， 使用 PHP 的生成器来实现中间件，轻松的组合管理多个中间件之间的协作。

作者
--

[](#作者)

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

安装
--

[](#安装)

```
composer require york8/poa
```

使用
--

[](#使用)

```
// 1. create the Application
$app = new Application();

// 2. define the route rules
$router = new RouterMiddleware(function (Context $context) {
    $context->statusCode(404)->send('Not Found');
});
$router->get(
    '/foo/bar$',
    function (Context $context) {
        $context->send('Hello, ' . $context->getRequest()->getUri());
    }
)->get(
    '/foo/exception',
    function () {
        throw new Exception('I throw an exception just for fun, haha!');
    }
);

// 3. use middlewares what you need
$app->use(new ProfileMiddleware())
    // simple error handle middleware
    ->use(function (Context $context) {
        try {
            yield;
        } catch (Exception $e) {
            fwrite(STDERR, 'EXP: ' . $e->getMessage() . "\n");
            $context->statusCode(500)->send('Exp: ' . $e->getMessage());
        }
    })
    ->use(function (Context $context) {
        $uri = $context->getRequest()->getUri();
        if ($uri->getPath() === '/bar') {
            $context->send('you fire.');
            return false;
        }
        return null;
    })
    ->use($router)
    // global error handle middleware
    ->useErrorMiddleware(function (Throwable $throwable, Context $context) {
        // handle global exception
        $msg = $throwable->getMessage();
        fwrite(STDERR, 'Global Exp: ' . $msg . "\n");
        if ($context) {
            $context->statusCode(500)->send('Oh, No! ' . $msg);
        }
    });

// 4. listen and start the server
$app->listen(8088);
```

License
-------

[](#license)

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

###  Health Score

24

—

LowBetter than 31% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity52

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

Every ~7 days

Total

6

Last Release

3044d 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 (19 commits)")

---

Tags

middlewareframeworkgeneratorreact-phpkoa

### Embed Badge

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

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

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k86.9M2.2k](/packages/symfony-symfony)[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[slim/slim

Slim is a PHP micro framework that helps you quickly write simple yet powerful web applications and APIs

12.3k51.8M1.4k](/packages/slim-slim)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k496.1k34](/packages/neuron-core-neuron-ai)

PHPackages © 2026

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