suvera / winter-boot
Winter Boot Framework
Requires
- ext-pcntl: *
- ext-posix: *
- lastguest/murmurhash: 2.1.*
- monolog/monolog: 2.3.*
- promphp/prometheus_client_php: v2.3.*
- ramsey/uuid: 4.2.*
- suvera/monolog-cascade: dev-master
- swoole/ide-helper: @dev
- symfony/yaml: 5.4.x-dev
- vanilla/garden-cli: v3.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-09-13 07:47:29 UTC
README
Documentation: https://suvera.mintlify.site/ — full guides, references, and module docs live there.
Inspired by the elegance of Spring Boot, Winter Boot empowers you to build robust and scalable microservices in PHP 8.5 with unparalleled ease and familiarity. If you're a Spring Boot enthusiast looking to dive into the world of PHP, Winter Boot is your perfect gateway!
Effortless Application Setup:
Get your Winter Boot application up and running in no time. The @WinterBootApplication attribute simplifies your main application class, making bootstrapping a breeze.
#[WinterBootApplication] class MyApplication { public static function main() { (new WinterWebSwooleApplication())->run(MyApplication::class); } } MyApplication::main();
Key Features that will make you love Winter Boot:
- Dependency Injection with PHP 8 Attributes: Say goodbye to complex configurations! Winter Boot leverages the power of PHP 8 Attributes (Annotations) for seamless and intuitive dependency injection.
Build Powerful Services with Ease
Craft your services and REST APIs with a clean, attribute-driven approach.
Example Service Implementation:
Define your services with the @Service attribute and inject dependencies effortlessly using @Autowired.
#[Service] class UserServiceImpl implements UserService { #[Autowired] private PdbcTemplate $pdbc; public function createUser(string $name, string $email) { $this->pdbc->update(/* ... */); } }
Crafting RESTful APIs:
Transform your classes into powerful REST controllers using @RestController and map your endpoints with @RequestMapping. Handling requests and returning ResponseEntity has never been this elegant!
#[RestController] class MyController { #[Autowired] private UserService $userService; #[RequestMapping(path: "/api/v2/users", method: [RequestMethod::POST]] public function createUser( #[RequestParam] string $name, #[RequestParam] string $email ): ResponseEntity { $this->userService->createUser($name, $email); return ResponseEntity::ok()->withJson($someJsonArray); } }
Test Your API Instantly:
Quickly test your newly created API endpoint with a simple curl command.
curl "http://localhost/api/v2/users" -d "name=Abc&email=mail"
1. Explore a Live Example Microservice
Dive into a complete, working example of a Winter Boot microservice to see it in action! Check out the example application here example-service
2. Getting Started: Installation
Ready to build amazing things with Winter Boot? Follow these simple steps to get started!
-
Prerequisite: Ensure you have PHP 8.5 (or greater) installed.
-
Unleash Asynchronous Power: For blazing-fast asynchronous functions (
#[Async]) and scheduled tasks (#[Scheduled]), theswooleextension is highly recommended.
pecl install swoole
Seamless Installation with Composer
Integrate Winter Boot into your project effortlessly using Composer.
composer require suvera/winter-boot composer require suvera/winter-modules
You're Done! Get ready to code!
3. Build & Deploy Your Winter Boot Applications
Winter Boot provides robust support for building and deploying your services, Explore our comprehensive guide on Building Services to learn how to:
- Generate optimized Phar files for easy distribution.
- Effortlessly build Docker Images for containerized deployments. See a practical example in the example-service repository:
4. In-Depth Documentation
Full documentation lives at https://suvera.mintlify.site/ — same content and structure as below.
Framework
Getting Started
Core Concepts
Web & REST
Data
Async & Concurrency
Operations
Building Applications
Libraries
Overview
Data
Messaging
Storage & Search
Distributed Systems
Planned
Embedded In-Memory Servers
Examples
Examples built with Winter Boot and Winter Modules
Reference
5. Extend Your Horizons with Module Extensions
Winter Boot is designed for extensibility! Expand its capabilities even further by integrating powerful modules from the Winter Modules project.
Craft Your Own Modules!
Want to contribute or build a custom integration? Creating a new module is straightforward! Simply extend [WinterModule](src/core/app/WinterModule.php).
Check out these existing modules for inspiration and reference:
- Doctrine ORM/DBAL Module: Robust database abstraction and ORM.
- Redis Module: High-performance caching and data structures.
- Apache Kafka Module: Stream processing with Kafka.
- DTCE Module: Distributed Transaction Coordination.
- S3 Module: Seamless integration with Amazon S3.
- SQS Module: Seamless integration with Amazon SQS.
- OpenSearch Module: Seamless integration with OpenSearch.
- Memdb Module: Integrate with popular in-memory databases like Apache Ignite, Redis, Memcached, Hazelcast, and more!
- Service Discovery: Connect with Consul, Netflix Eureka, and other service discovery solutions.
6. Frequently Asked Questions (FAQ)
Got questions? We've got answers!
1. Can I integrate components from other PHP frameworks into my Winter Boot project?
Absolutely! Winter Boot is designed to be highly interoperable. You can seamlessly incorporate any component from popular PHP frameworks like Symfony, Yii2, Laravel, CodeIgniter, and more, simply by using Composer.
Examples:
# Symfony Security component composer require symfony/security # Laravel illuminate events component composer require illuminate/events # Yii Arrays Component composer require yiisoft/arrays --prefer-dist
Important: Always ensure that the components you integrate are compatible with PHP 8.0+.
2. Is it possible to use RoadRunner or Workerman with Winter Boot?
Yes, indeed! Winter Boot's flexible architecture allows you to extend the framework and create your own core Application runner classes to support different server environments.
Current Swoole Integration:
Winter Boot already provides a robust integration with Swoole:
class WinterWebSwooleApplication extends WinterApplicationRunner implements WinterApplication { }
Your Custom Integrations:
You can follow the same pattern to integrate with RoadRunner, Workerman, or any other server:
class WinterWebWorkermanApplication extends WinterApplicationRunner implements WinterApplication { } class WinterRoadRunnerApplication extends WinterApplicationRunner implements WinterApplication { }