Web scaffold and request lifecycle
triangle/web is an application scaffold, not the Engine library. Its manifest includes Engine, HTTP engine, Console, Database, Session, View and Events. Use the verified quick start and retain the resulting application lock.
| Path | Role |
|---|---|
| master | CLI startup; Composer, paths, environment, Autoload, Console |
| config/app.php | Effective app/debug/response/header behavior |
| config/server.php | Listener, worker count, handler, runtime file settings |
| config/route.php | Executable route registration |
| config/process.php | Optional background processes/monitor |
| app/controller | Controller classes; preserve namespace/path case |
| app/view | Trusted templates, not user uploads |
| public | Public assets; no secrets or private files |
| runtime | Writable logs/session/runtime data; not source-controlled secrets |
Request flow
Section titled “Request flow”The Server receives transport input, HTTP engine creates request/context and resolves an explicit/default route. Middleware wraps the controller/callback; the returned response is encoded by Server. Context cleanup and exception rendering are runtime code, not permission checks. Add application authorization explicitly. Long-lived workers can reuse classes/services between requests; avoid retaining user state in static or cached objects.
Application behavior
Section titled “Application behavior”Use responseJson for an explicit API, view() for a configured template renderer and the Database component after bootstrap for SQL. Configure sessions and CSRF for browser state changes. The complete route example is intentionally independent of a database: CRUD requires migrations, validation, authorization and mass-assignment policy, not a copy/paste User::create endpoint.
Deploying
Section titled “Deploying”Apply effective production config, disable debug, set correct status behavior and restrict CORS. Use TLS at the intended proxy, private internal listeners, writable per-instance runtime files and a supervised foreground process. Test actual request/reload/shutdown and external dependencies. Config/production.php is not automatically an app/server overlay in the reviewed loader. HTTP and WS engines conflict in Composer; use separate app scaffolds where required.
Configuration · Security · Components. Source: Web 9e2ab3eab3ff and Engine 89dac7f51f94.