middag-io / moodle
MIDDAG Moodle adapter — platform bindings, ACL layer, and Moodle-specific implementations for middag-framework
Requires
- php: ^8.3
- ext-json: *
- middag-io/framework: ^1.20.4
- middag-io/ui: ^1.10.1
- nyholm/psr7: ^1.8
- psr/container: ^2.0
- psr/http-client: ^1.0
- psr/http-message: ^1.1 || ^2.0
- psr/log: ^3.0
- psr/simple-cache: ^3.0
- symfony/dependency-injection: ^7.4 || ^8.1
- symfony/event-dispatcher-contracts: ^3.0
- symfony/http-client: ^7.4 || ^8.1
- symfony/http-client-contracts: ^3.0
- symfony/http-foundation: ^7.4 || ^8.1
- symfony/messenger: ^7.4 || ^8.1
- symfony/psr-http-message-bridge: ^7.4 || ^8.1
- symfony/routing: ^7.4 || ^8.1
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.0
- michaelmeneses/moodle-stubs: ~5.3.0
- phpstan/phpstan: ^2.0
- phpunit/phpunit: ^11.0
- rector/rector: 2.8.4
Suggests
None
Provides
None
Conflicts
None
Replaces
None
- dev-main
- v1.19.1
- v1.19.0
- v1.18.0
- v1.17.2
- v1.17.1
- v1.17.0
- v1.16.1
- v1.16.0
- v1.15.1
- v1.15.0
- v1.14.0
- v1.13.2
- v1.13.1
- v1.13.0
- v1.12.2
- v1.12.1
- v1.12.0
- v1.11.1
- v1.11.0
- v1.10.0
- v1.9.0
- v1.8.0
- v1.7.1
- v1.7.0
- v1.6.0
- v1.5.0
- v1.4.0
- v1.3.0
- v1.2.3
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.1
- v1.1.0
- v1.0.2
- v1.0.1
- v1.0.0
- v0.5.0
- v0.4.0
- dev-fix/message-email-failure
This package is auto-updated.
Last update: 2026-11-17 20:53:23 UTC
README
MIDDAG Moodle adapter — platform bindings, ACL layer, and Moodle-specific
implementations of the middag-io/framework
contracts.
License: Apache-2.0.
What this package is
middag-io/moodle is the Moodle host adapter for the MIDDAG framework. It
provides the Moodle-side implementations of the framework's adapter contracts —
bootstrap, config resolution, signal dispatch, command bus, user context — plus
Moodle API wrappers (Support/), entities, DTOs, settings types, and HTTP /
Inertia infrastructure.
It binds the framework to a Moodle site. A Moodle plugin provides the
composition root that wires it in; any local_* or mod_* plugin can play that
role.
What it does not include
- No product features, business rules, or governed domain capabilities.
- No dependency on any non-OSS MIDDAG package — the adapter builds only on the
OSS framework and the host platform. Importing any non-OSS MIDDAG namespace or
package is forbidden and enforced by the adapter isolation guard test
(
tests/AdapterPluginIsolationTest.php, part ofcomposer test). - No bundled Moodle plugin. You wire the adapter into your own plugin.
Requirements
| Item | Value |
|---|---|
| PHP | ^8.3: 8.3, 8.4 and 8.5, within the PHP versions the Moodle version supports; ext-json |
| Symfony | ^7.4 || ^8.1 for every Symfony component it requires (the contracts keep their own ranges) |
| Sibling libraries | middag-io/framework ^1.20.4 and middag-io/ui ^1.10.1 |
| Moodle | 4.5 (PHP 8.3), 5.1, 5.2 and 5.3 (PHP 8.3 and 8.4); 5.0 as best effort, with no support promise |
| Database engines | PostgreSQL, MySQL and MariaDB, as supported by the Moodle version |
The DbSupport sql* helpers are tested against real databases: the
Engines workflow installs Moodle 4.5, 5.1, 5.2
and 5.3 on PostgreSQL, MySQL and MariaDB and executes the SQL of every helper
(tests/Integration/Engine). SQL Server is not
tested. Oracle is not tested yet.
The Moodle range follows upstream support. The 1.x line is pre-stable and
unsupported; support starts at 2.0.0 (see
Versioning and compatibility).
Installation
composer require middag-io/moodle
This pulls middag-io/framework and middag-io/ui automatically.
The
middag-io/*packages are published on Packagist, so they resolve from the default Composer registry with no extra configuration. No manualrepositoriesentry is required.
Moodle 4.5 runs up to PHP 8.3: resolve the vendor/ you ship to it on PHP 8.3
(Moodle adapter reference).
Documentation
The architecture and reference of this adapter live on
docs.middag.dev.
This repository keeps the README, API-STABILITY.md, the
CHANGELOG.md and the decision records in
docs/decisions/.
Development
git clone https://github.com/middag-io/middag-php-moodle
cd middag-php-moodle
composer install
Run the quality gates and the test suite:
composer check # PHP-CS-Fixer (dry-run) + Rector (dry-run) + PHPStan composer test # PHPUnit (includes the isolation and loadability guard tests)
Git hooks are configured automatically via post-install-cmd. The commit-msg
hook enforces Conventional Commits.
Working against a sibling framework checkout
This package declares no repositories entries: middag-io/framework (and
every other dependency) resolves from the default Composer registry. To edit
the framework and the adapter side by side, declare the path repository in the
consuming (root) project's composer.json — Composer only reads the root
package's repositories; entries inside a dependency would be ignored anyway:
{
"repositories": [
{"type": "path", "url": "../middag-php-framework", "options": {"symlink": true}}
]
}
This is a development-only convenience in the consumer. Published releases of this package always resolve through the normal Composer registry.
composer.lock is gitignored
Like a typical library, this repo does not commit composer.lock; consumers pin
versions in their own application. Because local development may resolve the
framework through a consumer-declared path repository, a local
composer.lock can show path or dev references. That is expected local
development state and not a defect in the released package.
The platform is pinned to PHP 8.3 (config.platform.php 8.3.0), so a local
install resolves the Symfony 7.4 line whatever PHP runs Composer. CI runs the
checks and the tests on PHP 8.3, 8.4 and 8.5 with the pin, a highest job on
8.4 and 8.5 without it that asserts the Symfony components resolve to 8.x, and
PHPStan against the Moodle stubs of 4.5, 5.0 (best effort), 5.1, 5.2 and 5.3
(Platform).
See CONTRIBUTING.md for the full contributor setup,
including the dependency-resolution notes.
Commit format
type(scope): description
Types: feat, fix, chore, docs, style, refactor, perf, test, build, ci, revert
Releases
Releases are managed by release-please.
Conventional commits merged to main open a Release PR automatically.
This library is on the pre-stable 1.x line. From 2.0.0 it joins the
middag-php-* version family: every library shares MAJOR.MINOR, a minor
never breaks, and a consumer declares the same ^2.N range for all of them.
See API-STABILITY.md and
Versioning and compatibility.
Help and status
- Status: the
1.xline is pre-stable and unsupported; support starts at2.0.0. See Versioning and compatibility. - Documentation: Reference — Moodle Adapter on docs.middag.dev.
- Questions and bugs: GitHub issues.
- Security reports: see
SECURITY.md. Do not open a public issue. - Changes:
CHANGELOG.md.
License
Licensed under the Apache License 2.0. See NOTICE for
attribution.