Download the PHP package golovanov/weft without Composer
On this page you can find all versions of the php package golovanov/weft. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download golovanov/weft
More information about golovanov/weft
Files in golovanov/weft
Package weft
Short Description A lightweight PHP engine for quickly launching simple websites: SEO, optional i18n, caching, tracing and form protection out of the box.
License MIT
Homepage https://github.com/golovanov-dev/weft
Informations about the package weft
Weft
A lightweight PHP 8.4 engine for quickly launching simple websites — SEO, optional multilingual routing, caching, request tracing and form protection out of the box. You write pages and a little business logic; the engine handles the rest.
Weft is for content-first sites: landing pages, portfolios, product and documentation sites. It is deliberately not a full-stack framework — no ORM, no DI container, no admin panel.
That file is the whole route. No route table, no controller, no registration.
Why
Every small site re-solves the same problems: clean URLs, locale prefixes, a correct <head>,
sitemap, spam-resistant forms, tracing, asset hashing. Weft puts all of it behind a small,
convention-driven core so a new site is mostly content.
Features
- Convention routing —
pages/about.php→/about,api/contact.php→/api/contact,pages/notes/[slug].php→/notes/anything. - SEO under the hood — title templates, canonical, Open Graph, Twitter cards, hreflang and
JSON-LD rendered from config + per-page overrides. Generated
/sitemap.xmland/robots.txt. - Optional i18n — off by default. Turn it on and the default locale stays prefix-free
(
/about), others get/ru/about, with automatic hreflang and canonical redirects. - Optional caching — file or Redis.
Cache::remember()is safe even when caching is off. - Request tracing — one JSONL timeline per request via traceloom, with automatic redaction.
- Form protection by default — rate limiting, CSRF, honeypot and Google reCAPTCHA v3.
- Alerting for sensitive spots — push events to AlertLoop; best-effort, never blocks a request, and a failed delivery is recorded on the request trace instead of vanishing.
- Batteries in the engine — HTTP client, PDO wrapper, JWT (firebase/php-jwt), security headers.
- Vite — dev server with HMR, hashed production assets from the manifest, with preload hints for the entry and its statically imported chunks.
Requirements
- PHP 8.4+ with
ext-curlandext-json ext-pdoonly if you use the database,ext-redisonly for the Redis cache- Node.js 18+ only to rebuild the frontend — not needed to run the example, whose built assets are committed
Install
Weft expects a small site skeleton around it. The fastest way to get one is to clone the repo
and copy the example/ directory — it is a complete, working site:
Get the example by cloning, not by "Download ZIP". The package archive is kept lean:
example/,tests/and CI config areexport-ignored, socomposer require— and GitHub's ZIP / release "Source code" downloads — contain only the engine.git clonegives you everything.
Project layout
Quick start
No build step: the example's built assets are committed, so it runs straight after
composer install.
Open http://localhost:8000. The example is the Weft documentation site — it documents the
engine while being built with it. With no config/config.php present, it falls back to
config/config.example.php (DEV_MODE=false) and serves the committed assets.
Working on the frontend (optional)
Node is needed only to edit styles/JS:
npm run build refreshes the committed public/dist/.
Configuration in two layers
- Environment —
config/config.php, plaindefine()constants: secrets, DB/Redis credentials,DEBUG,DEV_MODE,APP_TIMEZONE. Per server, gitignored. - Business —
app/Configs/app.php, an array read with dot keys: SEO, locales, feature flags, rate limits. Committed.
Everything optional is a flag:
Documentation
Full documentation lives in example/content/en and is served by the
example site itself. Start with Getting Started.
Versioning
Weft follows semantic versioning. Pre-1.0 the API may still change between minor versions.
License
MIT © Roman Golovanov. See LICENSE.
All versions of weft with dependencies
ext-curl Version *
ext-json Version *
firebase/php-jwt Version ^7.0
golovanov/traceloom Version ^0.4