定制 witals/framework 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

witals/framework

Composer 安装命令:

composer require witals/framework

包简介

README 文档

README

A modern, high-performance PHP framework designed for dual runtime support. Witals seamlessly adapts between Traditional Web Servers (PHP-FPM, Apache, Nginx) and Long-Running Runtimes (RoadRunner, ReactPHP, Swoole, OpenSwoole).

✨ Key Features

  • 🎭 Unified Entry Point: One command to rule them all with php witals serve.
  • 🔄 Ambient Runtime Detection: Automatically detects and adapts to its environment.
  • 🏗️ Architected for Scale: Built-in IoC container with advanced request-isolation scopes.
  • 🔒 Stateless & Stateful Support: Fine-grained state management tailored for each runtime.
  • Turbocharged Performance: Optimized for async, coroutines, and event loops.
  • 📝 Enterprise Logging: High-performance PSR-3 logging with memory buffering and JSON support.
  • 🛠️ Developer Experience: Modern PHP 8.1+ features with strict typing.

📦 Requirements

  • PHP 8.1+
  • Composer
  • (Optional) Extensions for high-performance runtimes: ext-swoole, ext-openswoole, or ext-roadrunner.

🚀 Quick Start

1. Installation

composer require witals/framework

2. Traditional Serving (FPM/CGI)

Point your web server (Nginx/Apache) to public/index.php. Witals automatically detects the traditional runtime and handles request/response in a stateless manner.

3. High-Performance Serving

Witals comes with a unified binary to launch high-performance servers:

# Start with auto-detected runtime (RoadRunner > Swoole > OpenSwoole > ReactPHP)
php witals serve

# Force a specific runtime
php witals serve --swoole
php witals serve --reactphp --port=9000

🛠️ Core Concepts

Request Lifecycle Management

Witals manages the request lifecycle through specific phases: Init → Execute → Respond → Shutdown.

  • Stateless: The entire app boots and shuts down for every request.
  • Stateful: The app boots once, handles multiple requests in an isolation scope, and cleans up after each request to prevent memory leaks.

Dependency Injection & Scoping

The framework ensures that services resolved during a request are automatically cleaned up when the request ends.

// Services resolved within handle() are request-scoped
$response = $app->handle($request); 

📚 Documentation

🤝 Contributing

We welcome contributions! Please follow the PSR-12 coding standard and ensure all tests pass before submitting a PR.

📄 License

The Witals Framework is open-sourced software licensed under the MIT license.

Created with ❤️ by Puleeno Nguyen (puleeno@gmail.com)

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固