phpthis / framework
A checked PHP profile and minimal web framework for AI-authored code; start applications with phpthis/skeleton.
Requires
- php: ~8.4.0
- ext-pdo: *
- ext-session: *
Requires (Dev)
- ext-pdo_sqlite: *
- ext-redis: ^6.3
- phpstan/phpstan: ^2.1
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^13.0
This package is auto-updated.
Last update: 2026-08-21 10:32:44 UTC
README
PHPThis
PHPThis is an experimental PHP 8.4 framework foundation for AI-first authoring with human accountability. It stays close to ordinary PHP so an AI can follow the real execution path and a human can review it without first reconstructing hidden framework behavior.
PHPThis favors code that is local, literal, typed, bounded, and mechanically checked. It does not provide AI or LLM APIs; “AI-first” describes the code-authoring and knowledge workflow.
PHPThis is prerelease evaluation software. APIs may change between prereleases. Do not use it in production.
Why PHPThis
- Ordinary typed PHP with visible manual composition and zero third-party framework runtime dependencies.
- Explicit finite routes, immutable HTTP values, and one traceable request path.
- Direct engine-specific SQL through a thin PDO transport boundary, with bound data, query budgets, and scale-sensitive tests.
- No ORM, Active Record, lazy loading, query builder, repository layer, service container, facade, autowiring, or runtime discovery.
- A versioned checked PHP subset with permanent, repair-oriented
PHTdiagnostics. - Installed contracts, task-routed context, source, and tests that an AI can cite and a human can audit.
- Application-owned product policy, configuration, authentication, authorization, caching, jobs, migrations, deployment, and operational evidence.
The framework supplies a small execution foundation and strict verification boundary. It does not turn application decisions into hidden framework services.
Current release state
| Boundary | Recorded state |
|---|---|
| Latest framework tag | Alpha 7, v0.1.0-alpha.7, Consumer Contract version 13, Strict Profile version 3, and diagnostics PHT001 through PHT007 |
| Latest proved application starter | Alpha 7 is the latest matching framework/skeleton pair with complete clean Packagist-only public-distribution evidence in Issue #53 |
| Coordinated release status | Alpha 7 remains partial pending both GitHub prereleases and the final announcement; Alpha 6 remains the latest fully completed and announced coordinated release |
Current post-tag main |
Mutable Alpha 7 release-state documentation and guardrail coherence only; it is not part of v0.1.0-alpha.7 and changes no framework runtime or published package |
Package availability and current release state are external facts: verify the exact framework and skeleton versions before installation. The Alpha 7 release notes describe the framework changes and compatibility boundary.
The Alpha 7 framework tag is immutable. Issue #53 records both exact Alpha 7 candidates, required CI, both immutable tags and Packagist versions, and the clean Packagist-only public-distribution proof. Alpha 7 remains an unannounced partial coordinated release until both GitHub prereleases and the final announcement are separately authorized and recorded; Alpha 6 remains the latest fully completed and announced coordinated release. ADR 054, the tagged Alpha 7 source-preparation notes, and the approved Alpha 7 source-preparation subsection in the release process preserve their acceptance-time PENDING values and non-authority statements as historical evidence. The post-tag main change is mutable release-state documentation and its guardrail mirrors only; it changes no framework runtime, Consumer Contract, Strict Profile, diagnostic, dependency, candidate, tag, or published package.
Start a PHPThis application
Consumers install PHPThis through Composer. Do not clone or copy the PHPThis framework repository to start an application.
Create the latest proved public framework/skeleton pair explicitly:
composer create-project --stability=alpha --prefer-dist phpthis/skeleton my-app '0.1.0-alpha.7' cd my-app composer check php -S 127.0.0.1:8080 -t public curl -i http://127.0.0.1:8080/health
phpthis/skeleton becomes the application root and Composer installs phpthis/framework under vendor/phpthis/framework. The runtime requires PHP 8.4.x, PDO, and ext-session.
Do not infer a matching starter release from a framework tag alone. Issue #53 records the exact Alpha 7 skeleton and clean public-install evidence; verify the current package-host state before installation. Existing applications may assess Alpha 7 against the upgrade notes. The getting-started guide covers the Composer path, existing-application adoption, and source evaluation.
Ask the project AI
Every application owns a thin AGENTS.md and task-routed .ai/ context. Ask the AI working in that application to inspect those files, the installed PHPThis contract, and the concrete source and tests before explaining or changing behavior.
Useful requests include:
Explain this request path and cite the installed PHPThis contract, application wiring, and nearest tests.Add a bounded database read using this application's canonical pattern and prove its query count stays constant.Explain this PHT diagnostic, find the cause in this project, and repair it without weakening the profile.Does PHPThis support this mechanism? Distinguish installed behavior, application policy, and a proposal.
The AI may author code and draft decisions. A human still supplies intent, approves consequential choices, and remains accountable for the result.
Key documentation
- Vision — AI-first authoring, human accountability, and framework non-goals.
- Getting started — installation and deliberate adoption.
- Consumer Contract — the portable application validity floor.
- Knowledge map — the smallest relevant guide, source, and evidence route for each task.
- Request handling and database boundaries — the core HTTP and PDO patterns.
- Alpha 7 release notes — compatibility changes and the carried-forward boundary.
- Architecture decisions — accepted rationale and reconsideration triggers.
- Security policy and release process — experimental support limits and publication gates.
Installed consumers use the packaged contract and knowledge map. The source repository’s .ai/ context is maintainer-only and is intentionally excluded from the Composer package.
Develop or evaluate PHPThis itself
Cloning this repository is for contributing to PHPThis or evaluating its framework source and checked example. It is not the consumer application installation path.
git clone https://github.com/balgf/PHPThis.git
cd PHPThis
composer install
composer check
composer check is the complete maintainer gate. PHPStan, PHPUnit, and the Strict Profile are development and verification dependencies; they do not affect the framework runtime or require consumers to select the same test runner. See CONTRIBUTING.md and the guardrail catalogue before changing the framework.
License
PHPThis is open-source software licensed under the MIT License.
