Download the PHP package power-modules/persistence without Composer

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

Modular Persistence

CI Packagist Version PHP Version

A type-safe, multi-tenant persistence layer for PHP 8.4+ built on the Modular Framework. It provides a robust Repository pattern implementation with native support for Postgres schemas and strict type safety.

💡 Robust: Built for complex applications requiring strict data integrity, multi-tenancy, and clear separation of concerns.

✨ Why Modular Persistence?

🚀 Installation

⚙️ Configuration

Register the module in your ModularAppBuilder and provide configuration in config/modular_persistence.php:

🏗️ Quick Start

1. Define Schema

2. Implement persistence layer: entity, hydrator and repository

Note: You can generate these classes via the CLI commands (persistence:make-entity, persistence:make-hydrator, persistence:make-repository)

3. Register persistence layer in a module

📦 Repository API

AbstractGenericRepository implements the IRepository<TModel> interface, providing a complete CRUD contract out of the box. Type-hint IRepository<TModel> in consumers (services, controllers) — not AbstractGenericRepository — to enable decorator patterns (e.g., caching repos) and testability:

All repository methods:

🔍 Conditions

Type-safe query conditions using schema enum cases:

JSONB Conditions

PostgreSQL JSONB operators are supported natively:

Raw SQL Conditions

For complex expressions that cannot be represented via Condition (e.g. custom casts, functions, or advanced JSONB paths), use addRawCondition() on any statement:

addRawCondition() is available on SelectStatement, UpdateStatement, and DeleteStatement. Raw conditions are AND-joined with standard conditions. Bind::json() auto-encodes arrays to JSON strings. bash php bin/console persistence:generate-schema App\Schema\UserSchema bash

Start PostgreSQL (port 15432)

make docker-up

Run all tests (unit + integration)

make test

Run unit tests only (no DB required)

make test-unit

Run integration tests only (requires PostgreSQL)

make test-integration

Static analysis (PHPStan level 8)

make phpstan

Code style check

make codestyle

Stop PostgreSQL

make docker-down



### Test Architecture

- **Unit tests** (`tests/Unit/`): Fast, no database — mock `IDatabase`/`IQueryExecutor` to verify SQL generation and bind parameters
- **Integration tests** (`tests/Integration/`): Run against a real PostgreSQL 17 instance, testing the full stack from repository through PDO
- **Test isolation**: Integration tests use transaction-based isolation (`BEGIN` in setUp / `ROLLBACK` in tearDown) for speed. Tests that exercise transactions or DDL manage their own cleanup.
- **Fixtures**: Shared test entities, schemas, hydrators, and repositories live in `tests/Unit/Fixture/` (mocked DB) and `tests/Integration/Fixture/` (real DB). Integration support classes (`PostgresTestCase`, `ConnectionHelper`) live in `tests/Integration/Support/`.
- **Namespace**: `Modular\Persistence\Test\` (PSR-4 → `tests/`)

### CI

The GitHub Actions workflow automatically provisions a PostgreSQL service container and runs the full suite on every push/PR.

All versions of persistence with dependencies

PHP Build Version
Package Version
Requires php Version ^8.4
power-modules/framework Version ^2.1
psr/log Version ^3.0
ramsey/uuid Version ^4.9
power-modules/console Version ^0.3.0
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 power-modules/persistence contains the following files

Loading the files please wait ...