PHPackages                             geggleto/infrastructure - 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. geggleto/infrastructure

ActiveLibrary

geggleto/infrastructure
=======================

0.0.4(9y ago)321MITPHP

Since Jan 27Pushed 9y ago1 watchersCompare

[ Source](https://github.com/geggleto/framework-infrastructure)[ Packagist](https://packagist.org/packages/geggleto/infrastructure)[ RSS](/packages/geggleto-infrastructure/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (4)Dependencies (3)Versions (5)Used By (0)

Command And Event Structure for Slim
====================================

[](#command-and-event-structure-for-slim)

Usage
-----

[](#usage)

In order to take advantage of the Command Bus and Event Bus, you will need to base your Controllers/Actions on the `AbstractAction` object

```
public MyAction extends Infra\AbstractAction implements EventListenerInterface {
    protected $sent;

    public function __construct(CommandBus $bus) {
        parent::__construct($bus);

        $this->sent = false;

        //Register Our Action class as a listener for the SentEmailToUser Event
        $eventBus = $bus->getEventBus();
        $eventBus->addListener(SentEmailToUser::NAME, $this);
        //We are waiting for the domain model to return to us wether the email was sent or not.
        //We do not care about anything else, except whether or not it was successful.
    }

    //In this action we will Queue and Email to be sent.
    public function __invoke(Request $request, Response $response, array $args = []) {
        $this->commandBus->handle(new SendEmailToUser());

        //Return our response
        return $this->respond($response);
    }

    //We received the event mark it as a yes
    public function receiveEvent(SentEmailToUser $event) {
        $this->sent = true;
    }

    public function respond(Response $response) {
        if ($sent) { //Yes we did
            return $response->withJson(['message' => 'Sent Email to User']);
        } else { //No We did not.
            return $response->withJson(['message' => 'Sent Email to User'], 500);
        }
    }

    public function getCommands() {
        return []; //We are not queueing any other commands
    }

    public function getEvents() {
        return []; //We are not queuing any other events
    }
}
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

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 ~0 days

Total

4

Last Release

3391d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7f941aecd52e3f8ac94dbe9b714801c7adc767acc32644d3ee6a4efeded84c5e?d=identicon)[geggleto](/maintainers/geggleto)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/geggleto-infrastructure/health.svg)

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

###  Alternatives

[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[neuron-core/neuron-ai

The PHP Agentic Framework.

1.8k245.3k21](/packages/neuron-core-neuron-ai)[php-heroku-client/php-heroku-client

A PHP client for the Heroku Platform API

24404.8k4](/packages/php-heroku-client-php-heroku-client)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[iwechatpay/openapi

为 wechatpay/wechatpay 增加IDE提示的接口描述包。

406.7k](/packages/iwechatpay-openapi)

PHPackages © 2026

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