sirosoft / core
Core engine powering the Siro API Framework with zero external dependencies.
0.35.1
2026-08-01 04:23 UTC
Requires
- php: >=8.2
- ext-curl: *
- ext-fileinfo: *
- ext-json: *
- ext-mbstring: *
- ext-openssl: *
- ext-pdo: *
Requires (Dev)
- cyclonedx/cyclonedx-php-composer: ^6.0
- infection/infection: ^0.29 || ^0.30
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^11.5.55
- squizlabs/php_codesniffer: ^3.0
- vimeo/psalm: ^5.0 || ^6.0
Suggests
- ext-redis: Required for Redis cache, session, and rate limiter drivers
README
⚡ Siro Core
Core engine powering the Siro API Framework.
Routing · ORM · CLI · Debug. Zero external dependencies.
Install
# Standalone engine composer require sirosoft/core # Or with full skeleton (recommended) composer create-project sirosoft/api my-app
Debug production in 1 command
php siro api:why POST /api/orders
Request
────────────────────────────────────────────────────────
Route: POST /api/orders
Status: ✗ 500
Duration: 143ms
Middleware Pipeline
└ ✗ OrderMiddleware 35ms ⚠ slow
SQL Queries
└ ⚠ UPDATE inventory 102ms ⚠ slow
Exception
PDOException: Deadlock found when trying to get lock
Possible Cause
• Concurrent transaction conflict
• Missing retry logic for deadlock scenarios
Suggested Fix
▸ Wrap transaction in retry loop (max 3 attempts)
Replay
[r] php siro replay id --force
[e] php siro replay id --edit
[d] php siro replay id --diff
[t] php siro make:test --from-trace=id
One command. Full context. No other framework has this flow.
Full workflow
┌─────────────────┐
│ HTTP Request │
└────────┬────────┘
▼
┌─────────────────┐
│ Router (O(1)) │
└────────┬────────┘
▼
┌─────────────────┐
│ Middleware │
└────────┬────────┘
▼
┌─────────────────┐
│ Controller │
│ → Service │
│ → Model / DB │
└────────┬────────┘
▼
┌─────────────────┐
│ Resource / JSON │
└─────────────────┘
php siro make:crud Product # Build php siro why # Debug php siro replay --diff # Replay php siro fix # Fix & auto-test
Features
| Layer | What's included |
|---|---|
| Router | O(1) static dispatch, regex dynamic, groups, middleware pipeline, PHP 8 Attributes |
| ORM | Active Record, HasOne/HasMany/BelongsTo/BelongsToMany, eager loading, soft deletes, identity map, N+1 detection |
| Auth | JWT (HS256/RS256), key rotation, per-token revocation, refresh rotation, API keys, RBAC |
| Security | CSP, CSRF, CORS, rate limiting (Redis/file), audit logging, OWASP Top 10 mitigated |
| CLI | 80 commands: make:crud, migrate, db:why, api:why, log:replay, test:regression, fix |
| Debug | Request replay, trace search (IP/path/status/time), api:why, db:why, N+1 detection, log sanitization |
| Database | Query Builder, Schema Builder, migrations, SQLite/MySQL/PostgreSQL, pagination, row locking |
| Cache | File + Redis drivers, HMAC-signed config cache |
| Queue | DB-based, exponential backoff, priority, timeout, failed job retry |
| SMTP (STARTTLS), sendmail, async queue, HTML + attachments | |
| Validation | 15+ rules, custom rules + messages, FormRequest |
| Storage | Local filesystem, S3-compatible |
| Events | Pub/sub, wildcards, one-time listeners, model lifecycle hooks |
| AI/MCP | MCP Server built-in — Claude/GPT/Copilot reads your project |
Performance
Cold boot (Linux + OPcache): ~0.5 ms
Cold boot (Windows, no OPcache): ~2.4 ms
Route dispatch static O(1): ~0.003 ms (~300K ops/sec)
Full-stack (warm route+response): ~0.003 ms (~360K ops/sec)
Memory (framework baseline): ~4 MB
Methodology: BENCHMARK.md
Quality
| Gate | Result |
|---|---|
| PHPStan (Level Max) | 0 errors |
| Psalm (Level 1 + taint) | 0 errors |
| Unit + Integration tests | 1,488+ — 0 failures |
| Fuzz tests | 17,851 — 0 failures |
| DAST security tests | 157 — 0 failures |
| Mutation testing | MSI ≥80% |
| Composer audit | 0 vulnerabilities |
Requirements
- PHP 8.2+
ext-pdo,ext-json,ext-mbstring
Ecosystem
| Project | Description |
|---|---|
| SiroPHP | Full project skeleton — 7 controllers, 462 tests, Docker, K8s |
| siro-mcp-server | AI agent integration — Claude/GPT/Copilot |
License
MIT — see LICENSE.