Download the PHP package pionia/pionia-app without Composer
On this page you can find all versions of the php package pionia/pionia-app. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download pionia/pionia-app
More information about pionia/pionia-app
Files in pionia/pionia-app
Package pionia-app
Short Description Pionia application template — Moonlight REST API on PHP 8.5+
License MIT
Informations about the package pionia-app
Pionia Application (pionia/pionia-app)
Official Pionia v3 application template. Moonlight REST API on PHP 8.5+ with AppRealm bootstrap, CLI, optional Vite frontend, and optional RoadRunner workers.
Create a project
Default URL: http://127.0.0.1:8000/ (environment/.env → PORT; [roadrunner] in settings.ini uses the same default).
API (Moonlight)
Register services in switches/MainSwitch.php. Dispatch with JSON:
| Endpoint | Method | Purpose |
|---|---|---|
/api/v1/ping |
GET | Framework health check |
/api/v1/ |
POST | Service actions |
Use path helpers in code — not hard-coded strings: apiVersionPath(), apiPingPath(), apiBase().
Directory layout
middlewares/, authentications/, and commands/ are created when you run make:middleware, make:auth, or make:command.
Base classes (extend these)
| Kind | Class |
|---|---|
| Switch | Pionia\Http\Switches\ApiSwitch |
| Service | Pionia\Http\Services\Service |
| Authentication | Pionia\Auth\Authentication |
| Middleware | Pionia\Middlewares\Middleware |
| Command | Pionia\Console\Command |
Frontend (optional)
CORS for :5173 is preconfigured in environment/settings.ini.
Background work
Post-response tasks (logging, webhooks) — not a new thread; runs after the client gets JSON:
Requires composer require react/promise. Durable jobs (email, reports) use RoadRunner Jobs — see Background work.
RoadRunner (persistent workers)
RoadRunner packages ship in require-dev. After composer install:
Enable Moonlight jobs in environment/settings.ini ([jobs] ENABLED=true) when using the jobs pool.
Port resolution: CLI --port → .env PORT / SERVER_PORT → [roadrunner] in settings.ini → .rr.yaml → 8000.
Production: switch jobs.pipelines.moonlight to redis in .rr.yaml and set [jobs] ENABLED=true.
Production performance (OPcache, opt-in)
Performance files are not shipped in the default template. Run once on deploy:
This installs bootstrap/preload.php, environment/php.ini.production.example, and [performance] in settings.ini, then generates storage/bootstrap/preload.php.
- Point
php.iniopcache.preloadatbootstrap/preload.php - Restart RoadRunner or PHP-FPM after deploy
php pionia optimize:clear --scaffoldremoves opt-in files
RoadRunner without global php.ini:
API documentation
Document actions with @moonlight-* PHPDoc on service classes:
Remove the path repository before publishing a Packagist release (consumers install core from Packagist).
Documentation
| Resource | URL |
|---|---|
| User guides | pionia.netlify.app |
Helpers (defer, Porm, cache, …) |
Helpers |
| Framework architecture | PioniaCore AGENTS.md |
| This app | AGENTS.md (short app notes) |
Requirements
- PHP 8.5+
- Composer
pionia/pionia-core^3.0ext-pdo(SQLite default; configure other drivers insettings.ini)
All versions of pionia-app with dependencies
ext-pdo Version *
pionia/pionia-core Version ^3.0
react/promise Version ^3.2