detain / myadmin-contracts
Shared MyAdmin\App\Contracts\* interfaces (Accounts, Database, RequestContext, Session) extracted from interserver/my so the MyAdmin core and every detain/* module can depend on and unit-test against a single source of truth.
Requires
- php: >=7.4
- ext-mysqli: *
This package is auto-updated.
Last update: 2026-07-21 18:10:16 UTC
README
Shared MyAdmin\App\Contracts\* interfaces for the MyAdmin
billing/management platform, extracted from the core interserver/my repo so that the core and
every detain/myadmin-* module can depend on a single source of truth — and unit-test against these
contracts with fakes without pulling in the whole core.
Interfaces
| Interface | Purpose |
|---|---|
AccountsInterface |
Accounts abstraction (read/add/update/delete/cross_reference/exists/get_next_id). |
DatabaseInterface |
Abstraction over MyDb\Generic / MyDb\Mysqli\Db (query/next_record/num_rows/real_escape/getLastInsertId/qr/f). |
RequestContextInterface |
Per-request user/view state (ima/accountId/locale/language/theme/isAdmin). |
SessionInterface |
Session abstraction (verify/create/destroy/appsession/CSRF helpers). |
Namespace-preserving: the interfaces keep their original MyAdmin\App\Contracts\ namespace, so moving
them out of core requires no changes to the ~23 core consumers or to any module.
Install
composer require detain/myadmin-contracts
Writing fakes in a module's tests
use MyAdmin\App\Contracts\DatabaseInterface; final class FakeDb implements DatabaseInterface { // ... implement the interface, return canned rows ... }
License
LGPL-2.1-only.