Download the PHP package kislayphp/persistence without Composer
On this page you can find all versions of the php package kislayphp/persistence. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download kislayphp/persistence
More information about kislayphp/persistence
Files in kislayphp/persistence
Package persistence
Short Description Request-safe persistence runtime for KislayPHP (transaction guard + bounded cache)
License Apache-2.0
Homepage https://github.com/KislayPHP/persistence
Informations about the package persistence
KislayPHP Persistence
Per-request data persistence lifecycle for PHP microservices. Automatic transaction management when attached to a
kislayphp/coreApp — begin on request start, commit or rollback on request end.
Part of the KislayPHP ecosystem.
✨ What It Does
kislayphp/persistence provides a persistence runtime that integrates with kislayphp/core's request lifecycle hooks. Attach it to your App and every request gets automatic transaction management — begin on start, commit on success, rollback on exception.
Every request now has a clean transaction scope. No manual begin/commit/rollback per handler.
Fixed 2026-08-12: this automatic lifecycle is now genuinely implemented and verified against a real database - previously attach()'s request-start hook never actually called beginTransaction(), and DB::insert()/update()/delete() never participated in any per-request transaction at all (always ran in bare autocommit), so a thrown exception left already-written rows committed regardless. Now: the first write (insert/update/delete, not select) within a request auto-begins a transaction if one isn't already open, and Core's onRequestEnd hook tells the cleanup step whether the request ended in error, so it commits on a clean return and rolls back on an uncaught exception - confirmed with a real sqlite database, not just by reading the code.
Enable in php.ini:
🚀 Quick Start
Automatic Transaction Per Request
Manual Usage
📖 Public API
Fixed 2026-08-12: these four instance methods previously didn't exist on the compiled extension at all (every call in "Manual Usage" above threw "Call to undefined method") - Runtime was static-only. Now real, backed by the same begin/commit/rollback primitives the working DB::transaction()/Runtime::transaction() static API already used correctly. begin()'s optional $connectionName selects a named connection (same default-connection behavior as DB::connection()) - omit it for the default connection, matching the "Manual Usage" example above exactly.
Legacy aliases: KislayPHP\Persistence\Runtime
🔗 Ecosystem
core · gateway · discovery · metrics · queue · eventbus · persistence
📄 License
Full Docs