flytachi / winter-kernel
The kernel of the Winter framework โ a PHP 8.4 library that turns a directory of classes into a running application on a resident Swoole runtime.
Requires
- php: >=8.4
- ext-fileinfo: *
- ext-pcntl: *
- ext-posix: *
- flytachi/file-store: ^2.0
- flytachi/winter-base: ^3.0
- flytachi/winter-cdo: ^4.0
- flytachi/winter-di: ^2.0
- flytachi/winter-logger: ^1.0
- flytachi/winter-thread: ^3.0
- vlucas/phpdotenv: ^5.6
Requires (Dev)
- flytachi/winter-ppa: ^1.0
- flytachi/winter-redis: ^1.0
- monolog/monolog: @stable
- phpunit/phpunit: @stable
- squizlabs/php_codesniffer: @stable
- swoole/ide-helper: ^6.0
Suggests
- ext-bcmath: Optional for BcMath\Number type casting in HTTP parameter resolution
- ext-decimal: Optional for Decimal\Decimal type casting in HTTP parameter resolution
- ext-pdo: Required for database access
- ext-shmop: Recommended for Swoole mode โ enables PAYLOAD_SHM in Thread dispatch, avoiding fd conflicts with proc_open (fallback: PAYLOAD_PIPE)
- ext-simplexml: Required for XML file operations and XML body parsing in HTTP parameter resolution
- ext-swoole: Required for coroutine-based connection pooling (Swoole mode)
- flytachi/winter-ppa: The database layer: repositories, entity mapping, migrations and a coroutine connection pool.
- flytachi/winter-redis: Pooled Redis: prefixed stores, hashes, lists and streams, with a coroutine-safe connection pool.
This package is auto-updated.
Last update: 2026-08-21 11:32:35 UTC
README
๐ winterframe.net/docs ยท Install ยท Quick start ยท Key concepts
Every link here points at
winterframe.netand is language-neutral โ the site serves the page in your language, RU or EN. Both are complete.
The kernel of the Winter framework: the package you install, and the only one you install directly. It turns a directory of classes into a running application โ routing, request binding and validation, responses, dependency injection, managed processes and daemons, scheduling, localization, diagnostics and the console.
It is a library, not a skeleton. There is nothing to scaffold and no directory tree to create: you add it to a project, write one class saying what the application contains, and run it.
What is not in it
The database layer and the Redis client are separate packages, installed on demand. The kernel knows just enough about them to find your classes and hand them over when the package is there โ an application that talks only to an external API should not carry an ORM, a connection pool and a migration engine it never loads.
| Package | What it adds | Docs |
|---|---|---|
flytachi/winter-ppa |
Repositories, entities, query builder, migrations, DB pool | PPA |
flytachi/winter-redis |
Pooled Redis: prefixed stores, hashes, lists, streams | Redis |
See Ecosystem for the full picture, including the libraries the kernel already brings with it (DI, logger, CDO, thread).
Requirements
| PHP | 8.4+ |
| Required extensions | pcntl, posix, fileinfo |
| For the HTTP server | swoole โ coroutines, connection pooling, static files |
| Optional | pdo (database) ยท bcmath, decimal (exact numbers) ยท simplexml (XML bodies) |
Everything else comes from composer. Details: Installation.
Install
composer require flytachi/winter-kernel
Mini start โ two files
bootstrap.php โ loads the autoloader and declares what the application contains:
<?php declare(strict_types=1); use Flytachi\Winter\Kernel\App\Attribute\EnableWeb; use Flytachi\Winter\Kernel\WinterApplication; require __DIR__ . '/vendor/autoload.php'; #[EnableWeb] final class Application extends WinterApplication { public static function main(array $argv): never { parent::run($argv); } }
call โ the single entry point for everything, the server included
(chmod +x call once):
#!/usr/bin/env php <?php chdir(__DIR__); require './bootstrap.php'; Application::main($argv);
chdir() is not decoration: it ties .env, storage/ and resources/ to the project
rather than to wherever the command was typed, which is what makes calls from cron,
systemd and docker exec predictable.
That is a working project โ no .env, no directories. The kernel creates what it needs
when it needs it.
php call # the command list php call run # bring the application up php call run dev # same, restarting when a .php file changes
Add a controller anywhere under the project; the scan finds it, no registration:
use Flytachi\Winter\Kernel\Http\Stereotype\Controller; use Flytachi\Winter\Kernel\Route\Annotation\GetMapping; final class PingController extends Controller { #[GetMapping('/ping')] public function ping(): array { return ['pong' => true]; } }
curl http://localhost:8000/ping # {"pong":true}
Walk-through with a path variable, a query parameter and the JSON it returns: Quick start.
What the application contains โ #[Enable*]
The attributes on the application class are the manifest. Each adds a component; declare none and boot fails rather than starting an application that does nothing.
| Attribute | Effect | Docs |
|---|---|---|
#[EnableWeb] |
the Swoole HTTP server | Routing |
#[EnableScheduler] |
runs #[Scheduled] methods on their triggers |
Scheduler |
#[EnableProcess(Foo::class)] |
a managed worker beside the server | Processes |
#[EnableDaemon(Bar::class)] |
a supervised fleet of workers | Daemons |
#[EnableAsync] |
proxies #[Async] methods so they run off the request |
Async |
#[EnableActuator] |
/actuator โ health, pools, metrics, mappings |
Actuator |
#[Import('vendor/pkg', '/prefix')] |
mounts a package under a URL prefix | Packages |
Everything else is an ordinary class the scan finds โ there are no configuration hooks to override:
#[Configuration] / #[Bean] // DI factories โ dependency-injection WebConfigurer // host, port, CORS, static โ web-configuration LoggingConfigurer // extra log channels โ logging
Full list and the rules: Components.
Documentation map
The whole reference lives at winterframe.net. The tree below mirrors the site's own navigation.
1. Introduction โ what this is, and whether it fits you
2. Getting started โ from an empty directory to a served request
3. Web basics โ everything between the request and the response
- Routing
- Web-layer configuration
- Controllers
- Middleware
- Requests and parameter binding
- Validation
- Responses
- Cookies
- Views
- Error handling
4. Background components โ work that outlives a request
5. Database (PPA) โ needs flytachi/winter-ppa
6. Redis โ needs flytachi/winter-redis
7. CLI โ the call command and everything under it
- Overview
- make โ generate a component
- cfg โ
.env, keys, Docker, completion - run โ serve the application
- db โ ping, migrate, SQL preview, pools
- mapping โ the route table
- storage โ service directories
- script โ your own commands
- di โ scanner cache and
#[Async]proxies - process โ start, stop, status
- daemon โ fleets of workers
- schedule โ the scheduler
8. Advanced โ the parts you reach for later
- Logging
- Localization
- Asynchronous calls
- Actuator / Health
- File storage
- Packages
- Runtimes (FPM and Swoole)
License
MIT โ see LICENSE.