quellabs / canvas
A modern, lightweight PHP framework with contextual containers, automatic service discovery, and ObjectQuel ORM integration
Installs: 185
Dependents: 1
Suggesters: 0
Security: 0
Stars: 13
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/quellabs/canvas
Requires
- ext-curl: *
- ext-fileinfo: *
- ext-gd: *
- ext-json: *
- ext-mysqli: *
- ext-pdo: *
- dragonmantank/cron-expression: *
- monolog/monolog: *
- quellabs/annotation-reader: ^1.
- quellabs/canvas-smarty: ^1.
- quellabs/contracts: ^1.
- quellabs/dependency-injection: ^1.
- quellabs/discover: ^1.
- quellabs/sculpt: ^1.
- quellabs/signal-hub: ^1.
- quellabs/support: ^1.
- symfony/http-foundation: *
- dev-main
- 1.0.72
- 1.0.71
- 1.0.70
- 1.0.69
- 1.0.68
- 1.0.67
- 1.0.66
- 1.0.65
- 1.0.64
- 1.0.63
- 1.0.62
- 1.0.61
- 1.0.60
- 1.0.59
- 1.0.58
- 1.0.57
- 1.0.56
- 1.0.55
- 1.0.54
- 1.0.53
- 1.0.52
- 1.0.51
- 1.0.50
- 1.0.49
- 1.0.48
- 1.0.47
- 1.0.46
- 1.0.45
- 1.0.44
- 1.0.43
- 1.0.42
- 1.0.41
- 1.0.40
- 1.0.39
- 1.0.38
- 1.0.37
- 1.0.36
- 1.0.35
- 1.0.34
- 1.0.33
- 1.0.32
- 1.0.31
- 1.0.30
- 1.0.29
- 1.0.28
- 1.0.27
- 1.0.26
- 1.0.25
- 1.0.24
- 1.0.23
- 1.0.22
- 1.0.21
- 1.0.20
- 1.0.12
- 1.0.11
- 1.0.10
- 1.0.9
- 1.0.8
- 1.0.7
- 1.0.6
- 1.0.5
- 1.0.4
- 1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
This package is auto-updated.
Last update: 2026-02-10 07:12:42 UTC
README
A lightweight PHP framework built for real-world projects — especially the messy ones. Canvas drops into existing PHP codebases without forcing a rewrite, while giving new projects a clean, annotation-driven architecture with contextual dependency injection and a readable ORM.
Why Canvas?
Most frameworks assume a greenfield project. Canvas doesn't. Its legacy-first integration lets you wrap an existing PHP application and incrementally modernize — new routes handled by Canvas controllers, old .php files served through route fallthrough. No big bang migration required.
On top of that, Canvas ships with things you'd normally bolt on separately: aspect-oriented programming for cross-cutting concerns, a Qt-style signal/slot event system, cron-style task scheduling, and a visual debug inspector. All without the weight of a full-stack monolith.
Quick Start
# New project composer create-project quellabs/canvas-skeleton my-app # Existing project composer require quellabs/canvas
class BlogController extends BaseController { /** * @Route("/posts/{id:int}") */ public function show(int $id) { $post = $this->em()->find(Post::class, $id); return $this->render('post.tpl', $post); } }
Annotation-based routing, automatic controller discovery, typed route parameters — no configuration files.
ObjectQuel ORM
Canvas integrates with ObjectQuel through the quellabs/canvas-objectquel package, giving you an ORM with a query language inspired by QUEL. For simple lookups you get the familiar find and findBy methods. For complex queries, ObjectQuel's declarative syntax reads closer to intent than DQL or query builders:
$results = $this->em()->executeQuery(" range of p is App\\Entity\\Post range of u is App\\Entity\\User via p.authorId retrieve (p, u.name) where p.title = /^Tech/i sort by p.publishedAt desc ");
Aspects for Cross-Cutting Concerns
Authentication, caching, rate limiting, CSRF — Canvas handles these as composable aspects applied via annotations, not scattered through controller logic:
/** * @Route("/admin/users") * @InterceptWith(RequireAuthAspect::class, priority=100) * @InterceptWith(CacheAspect::class, ttl=300) * @InterceptWith(RateLimitAspect::class, limit=100, window=3600) */ public function manage() { return $this->em()->findBy(User::class, ['active' => true]); }
Before, Around, and After aspects with priority ordering, inheritance through controller hierarchies, and parameterized configuration.
Features
- Legacy-first integration — drop into existing PHP projects via route fallthrough
- Annotation-based routing — typed parameters, prefixes, method constraints
- ObjectQuel ORM — readable query language with relationship traversal and regex support
- Aspect-oriented programming — composable cross-cutting concerns with priority ordering
- Contextual dependency injection — different implementations per context
- Signal/slot event system — decoupled service communication
- Task scheduling — cron-style jobs with timeouts and concurrency handling
- Visual inspector — debug bar with queries, request analysis, and custom panels
- Validation & sanitization — declarative rules applied as aspects
- CLI tooling — route listing, route matching, task management, asset publishing
Documentation
Full docs, guides, and API reference: canvasphp.com/docs
Contributing
Bug reports and feature requests via GitHub issues. PRs welcome — fork, branch, follow PSR-12, add tests.
License
MIT