Download the PHP package componenta/cqrs without Composer

On this page you can find all versions of the php package componenta/cqrs. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cqrs

Componenta CQRS

componenta/cqrs is the neutral CQRS runtime for PHP 8.4+. main is the CQRS v4 line.

Register Componenta\CQRS\ConfigProvider. It provides the standard command/query buses, locators, operation factory, metadata provider, and the shared arrays of CQRS registrations.

Commands and operations

One dispatch() creates one OperationInterface and sends it through the complete command pipeline.

An operation contains:

createdAt is deliberately not named startedAt: operation creation happens before middleware and is not the same thing as handler execution start. Async transports must not restore producer createdAt as a worker execution timestamp.

CQRS v4 keeps the operation factory separate from middleware composition:

The operation factory is optional; OperationFactory is used by default.

Multiple commands

BatchCommandBus is the explicit sequential multi-dispatch decorator:

Each command is dispatched independently through the wrapped bus and receives its own operation. Core no longer contains SequentialMiddleware; nested dispatch() calls use normal reentrant dispatch semantics. Work that must happen after the current command or transaction should use an explicit event, outbox, async transport, or workflow/process manager.

Command middleware

Command middleware implements:

HandleCommandHandler is the terminal handler. ConfigProvider registers EventMiddleware as a service, but does not insert it into the pipeline automatically. Add it to ConfigKey::COMMAND_MIDDLEWARES when command lifecycle listeners should run.

Middleware order

Middleware execute exactly in the order supplied by application configuration. CommandBus validates the middleware collection and compiles that order; it does not infer, reorder, or reject application topology based on other packages.

The order is therefore part of application behavior. For example, with retry and transaction middleware:

creates a new transaction for each retry attempt, while:

keeps all retry attempts inside one surrounding transaction. Neither topology is rejected by CQRS core; applications choose the semantics they need.

Optional package documentation describes useful ordering patterns and their consequences, but ordering remains configuration responsibility.

Command lifecycle events

EventMiddleware can emit:

Listener failures propagate by default. The position of EventMiddleware relative to policy, transport, retry, lock, transaction, or custom middleware is application-defined.

Queries

QueryBusInterface::handle(object $query, ContextInterface|array $context = []) normalizes array context to immutable Context. Query context attributes use the same non-empty string-key invariant as operation attributes.

Registration and maps

The core package uses arrays and does not scan application classes or read cache files. It requires Config 3 and DI 5. Packages and applications append registration lists through their ConfigProvider:

Register the core provider before application providers. Handler and listener services use normal DI autowiring or explicit factories. The shared DI service cqrs.maps contains three arrays: command_handlers, query_handlers, and command_listeners. Each locator receives its own section.

For direct construction, handlers are keyed by message name:

Identical handler registrations collapse; different handlers for one name throw CqrsMapConflictException. Identical explicit listener registrations throw InvalidCqrsMapException. Listeners run by descending priority, then service ID and canonical event list. An empty event list matches every command lifecycle event.

Names are resolved for each message instance. supports() does not instantiate a handler. Each locateFor() obtains services through the container, preserving the container's sharing rules. Listeners are filtered by event before service lookup.

componenta/cqrs-app adds attribute discovery and app:build. A current file avoids discovery; a missing or invalid file falls back to source. Both paths use these same locators and registration rules.

Metadata

CommandMetadataProviderInterface exposes one operation:

The default ReflectionCommandMetadataProvider reads the command class independently of handler registration and maps. Each call creates a fresh attribute, including object arguments. An absent attribute or command class returns null. Invalid attribute declarations, repeated metadata, or construction failures throw InvalidCommandMetadataException; construction failures retain their original cause.

Retry, lock and transport middleware use this provider. Their attributes need no separate registration or compilation.

Discovery attributes

componenta/cqrs-app understands:

A handler's message must occupy the first parameter slot. Additional required handler parameters are not dependency-injected by the CQRS runtime.

Optional packages

Package Responsibility
componenta/cqrs-app Attribute discovery and explicit map building
componenta/cqrs-policy Command/query authorization
componenta/cqrs-retry Retry metadata and middleware
componenta/cqrs-lock Resource locking
componenta/cqrs-transaction-cycle Cycle Database transactions
componenta/cqrs-transport Async transport contracts, serializers, middleware, worker
componenta/cqrs-transport-cycle Cycle Database transport
componenta/cqrs-transport-console Symfony Console worker

Verification

CI targets PHP 8.4/8.5, runs the Pest suite and PHPStan at maximum level.


All versions of cqrs with dependencies

PHP Build Version
Package Version
Requires php Version >=8.4
componenta/config Version ^3.0.0
componenta/di Version ^5.0.0
componenta/reflection Version ^2.0.1
psr/container Version ^2.0
ramsey/uuid Version ^4.7
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package componenta/cqrs contains the following files

Loading the files please wait ...