phlo / tech
Full-stack web framework with its own .phlo language: express backend logic, routing, HTML views, scoped CSS and single-page behavior in one concise file format that transpiles to plain PHP, CSS and JS.
Requires
- php: >=8.3
Requires (Dev)
- phpunit/phpunit: ^11.0 || ^12.0
Suggests
- ext-gd: Required by the icon sprite builder (build config key: icons)
- ext-pdo: Required by the DB resources (MySQL, PostgreSQL, SQLite)
- ext-sodium: Required by the security/encryption resource
This package is auto-updated.
Last update: 2026-07-03 22:08:13 UTC
README
A transpile-to-PHP web framework with its own .phlo language, a built-in
SPA runtime, the Phlo Control Center (built-in dev panel), and first-class introspection for AI
agents. Zero runtime dependencies.
prop title = 'Hello'
route GET => $this->home
method home => view($this->main, 'Home')
view main:
<h1>$this->title</h1>
<p>{{ date('Y') }}</p>
That file transpiles to a PHP class, a route, an HTML page, and (with a
<style>/<script> block) a CSS and JS bundle. One .phlo file is one
class; the build writes plain PHP you can read, lint and source-map back to
the line you wrote.
Why Phlo
Phlo is opinionated on purpose. The bets it makes:
- Transpile, don't interpret.
.phlois transformed to readable PHP at build time. Errors at runtime map back to your.phloline, not to generated soup. - One closed loop. Source to build to lint to sourcemap to error page to Control Center to CLI introspection. Every layer points back at the source.
- Small and dependency-free. The engine ships its own CSS transpiler, JS minifier and SPA runtime. No vendor tree to audit. The bet is proven server tech: PHP still runs more than 70% of the web (W3Techs), and Phlo builds on that instead of on a JavaScript build chain.
- Agent-first.
docs/SKILL.mdis a complete language reference written for AI agents, and thereflect::CLI exposes routes, views, the parsed AST and dependency graphs as JSON. An agent can build, introspect and fix a Phlo app without guessing. - Convention over configuration. File name becomes class name. Named
phlo_app()arguments become constants.data/app.jsonstays tiny.
If you want a large ecosystem, a package for everything, and a team-standard hiring pool, reach for Laravel or Symfony. If you want a small, legible full-stack engine that one person (or one agent) can hold in their head, Phlo is for you.
One platform, four layers
The language is the bottom layer of one continuous system; each layer is built with the previous one, in the same syntax:
- Language:
.phlosource transpiles to readable PHP, CSS and JS. - Application: backend resources (ORM, sessions, security, AI) plus the
phlo.js SPA engine and the
apply()protocol; Phlo CMS adds a schema-driven CRUD and admin layer on top. - Server: production on FrankenPHP in worker mode, with the Phlo Daemon for warm workers, realtime and scheduled tasks.
- Operations: the Phlo Dashboard manages apps and servers as a fleet: uptime, domains, databases, notifications.
The full story, guide, tutorial and reference live at phlo.tech; machine-readable docs at phlo.tech/llms.txt.
Quick start
Requirements: PHP >= 8.3. Optional extensions per resource (pdo_mysql,
sodium, gd).
git clone https://github.com/q-ainl/phlo.git php phlo/install.php /path/to/my-app
The installer asks for a name, host, purpose and which resources to enable,
writes a buildable skeleton (app.phlo, www/app.php, data/app.json,
data/app.md), and runs the build so the app is verified before you start.
Serve it with FrankenPHP, Docker, PHP-FPM or, for a quick look:
php /path/to/my-app/www/app.php reflect::context # inspect without a server php -S 127.0.0.1:80 /path/to/my-app/www/app.php # then open http://localhost
See docs/deploy.md for FrankenPHP (incl. worker mode), Docker and nginx setups.
The development loop
With build: true set in www/app.php, the app rebuilds changed .phlo
files on request. Two CLI namespaces drive everything:
php www/app.php build::run # transpile changed sources, returns changed files php www/app.php build::lint # parse-check the generated PHP, [] means clean php www/app.php reflect::context # app identity, routes, views, recent errors php www/app.php reflect::routes # full route map
With build and debug on (dev only), the Phlo Control Center auto-mounts at /phlo and offers home,
config, source, build, release and error views. Move it with the optional control: key or set
control: false to disable.
Documentation
- docs/SKILL.md the full language and build reference (also the agent skill).
- docs/design.md the rationale behind Phlo's non-obvious design decisions (read before changing the engine).
- docs/deploy.md deployment options.
- docs/apply-protocol.md the
apply()SPA protocol. - docs/websocket-contract.md the realtime WebSocket contract (Phlo Daemon).
- docs/tasks.md cron tasks.
- docs/model-opt-in.md ORM opt-in features.
- docs/connectors.md API connectors (webshops, messaging, accounting, cloud) and how to write your own.
- CONTRIBUTING.md how contributions are judged.
Editor support
Syntax highlighting under editor/: a VS Code extension (TextMate grammar, reusable in Sublime/JetBrains/Zed) and a Notepad++ user-defined language with a function-list parser.
License
MIT. See LICENSE.
