Download the PHP package gilsegura/shared without Composer

On this page you can find all versions of the php package gilsegura/shared. 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 shared

SHARED

tests codecov static analysis coding standards

Framework-agnostic building blocks for DDD, CQRS and event sourcing. It provides the domain primitives (value objects, events, aggregates), the command/query and event bus contracts, the event store and upcasting contracts, a criteria DSL for querying, and read-model projection support — all as plain PHP, with no framework dependency. The gilsegura/shared-bundle package wires these onto Symfony, Messenger and Doctrine.

Installation

Domain primitives

Shared\Domain holds the value objects and the event envelope every other piece builds on:

Command and query handling

Shared\CommandHandling defines the CQRS contracts, with no transport opinion:

Event handling

Shared\EventHandling is the synchronous, in-process event bus:

Event sourcing

Shared\EventSourcing turns event streams into aggregates and back:

Event store

Shared\EventStore is the persistence contract for streams:

Upcasting

Shared\Upcasting keeps old event shapes loadable as the schema evolves:

Snapshotting

Shared\Snapshotting makes loading long-lived aggregates cheap by skipping the replay of their whole history. It is opt-in: without it, aggregates always rebuild from the full stream.

The aggregate is unaware of snapshotting throughout: capturing and restoring its state is done from the outside.

Criteria

Shared\Criteria is a small DSL for expressing filters and ordering in domain terms, independent of any database:

An infrastructure adapter translates these into a concrete query (the bundle, for example, converts them to Doctrine criteria).

Queries and read models

Replaying

Shared\Replaying\Replayer visits the events matching a criteria from the store and feeds them to an event visitor — e.g. to rebuild a read model from history. When the store is an UpcastingEventStore, the visited events are upcast too, so a projector reacting to the replay sees the current event shapes.

Specifications

Shared\Specification\AbstractSpecification is the base for composable domain specifications (business rules expressed as objects).

Exceptions

Shared\Exception provides a hierarchy mapping domain failures to intent — NotFoundException, ConflictException, ForbiddenException, UnauthorizedException, InfrastructureException, UnexpectedException — so transport layers can translate them to the right status without leaking domain details. Value objects validate their input with the native \InvalidArgumentException. Namespace-specific exceptions (EventStoreException, CorruptSnapshotException, InvalidAggregateRootException, InvalidExpressionException, …) extend the base that matches their intent.

Support

Shared\Support\ClassName resolves the short name of a class, used to map events to their applyXxx methods.

License

MIT. See LICENSE.


All versions of shared with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
ext-mbstring Version *
gilsegura/serializer Version ^1.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 gilsegura/shared contains the following files

Loading the files please wait ...