anvyr / loom
PHP content-application framework. File-native pages, explicit runtime.
Requires
- php: ^8.4
- composer/semver: ^3.4
- psr/container: ^2.0
- psr/log: ^3.0
- symfony/yaml: ^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.93
- league/commonmark: ^2.8
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.0
Suggests
- erusev/parsedown: Required for the 'parsedown' content parser driver
- league/commonmark: Required for the 'commonmark' content parser driver
Provides
None
Conflicts
None
Replaces
None
README
Why Anvyr Loom?
A PHP content-application framework. Every service binding, middleware, and routing decision is visible in code you own. We call this Pragmatic Zero Magic.
- Explicit over Implicit: Service bindings, routes, and middleware are declared directly.
- No facades: Dependencies arrive through constructors and method signatures, not Laravel-style static facades.
- Content first: Pages are files with frontmatter — nested folders are URL paths.
- Modern & Stable: PHP 8.4+. We track current PHP and drop legacy detours early.
- Lean by design: Small runtime, short dependency graph, compact enough to inspect end to end.
Features
Content & ORM
- File-native pages
.vltor.mdwith YAML frontmatter. Nested paths (docs/install.vlt→/docs/install,docs/index.vlt→/docs). Versionable in Git. No database required for a content site. - ORM with relationships Models, eager/lazy loading, casts, soft deletes, scopes, model events, and pivot operations (
hasOne,hasMany,belongsTo,belongsToMany). - Query builder Fluent SQL with joins, pagination, upsert, and query caching. SQLite, MySQL, PostgreSQL.
- Schema builder & migrations Database-agnostic table definitions with versioned migrations.
Multi-Tenancy
- Host, path & callback resolvers Map domains, path segments, or custom logic to tenants.
- Full isolation Content, views, storage, cache, sessions, and database all scope per tenant.
- CLI orchestration
--tenant=<id>,--all-tenants, and checkpoint-based batched migrations.
Modules
- Manifest-driven
module.jsonwith semver dependencies and topological load order. - Declarative integration Routes, views, and CLI commands are declared in the manifest.
HTTP
- Router Named routes, parameters (optional/wildcard), groups, middleware pipelines, caching.
/{slug*}serves nested pages. - Middleware CSRF, sessions, rate limiting, ETag response caching, error handling.
- Rate limiting Named limiters, dynamic callbacks, IP whitelisting.
- View engine Blade-like syntax, layout inheritance, partials, namespace support.
- HTTP client cURL-backed with retry, auth, and typed responses.
System
- Job queue Database-backed with retry, deduplication, and worker daemon.
- Task scheduler Cron-style scheduling via CLI or web endpoint.
- Validation Standalone validator with built-in rules and custom extensions.
- CLI Scaffolding, migrations, modules, cache, page index, diagnostics.
- Caching File, Redis, or APCu with tag-based invalidation.
- Logging PSR-3 with daily rotation.
- Security Auto-escaped templates, CSRF tokens, prepared statements, path traversal protection.
Requirements
- PHP 8.4+ (+ extensions:
pdo,mbstring,json,openssl) - Optional PHP extensions:
curlfor the HTTP client,apcufor APCu cache,redisfor Redis cache - Linux, macOS, or WSL2
- Composer
- SQLite, MySQL, or PostgreSQL (optional)
Quick Start
# Clone and install git clone https://github.com/anvyr/loom.git cd loom ./install.sh # Start dev server ./loom serve
Visit http://localhost:8000
You can also run install.sh as a standalone bootstrapper; when it is outside a checkout it clones Anvyr Loom first, then continues setup.
Development QA
Routine local checks use Composer:
composer qa
composer test
For a reproducible PHP 8.4/8.5 environment without changing your host PHP install, use Podman:
PHP_VERSION=8.4 podman compose run --rm test PHP_VERSION=8.5 podman compose run --rm test PHP_VERSION=8.5 podman compose run --rm test-external
Documentation
- Product: anvyr.dev/loom
- Reference docs: anvyr.dev/loom/docs (forthcoming)
License
Anvyr Loom is licensed under the Apache License 2.0.
Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
Security Issues: Email security@anvyr.dev (do not open public issues!)
Credits
Built by Anvyr.
See composer.json for dependencies.