How walkor/webman works
Project type and purpose
• This is “webman,” a high-performance, event-driven PHP web framework built on top of Workerman.
• It provides an HTTP server, middleware pipeline, routing, controllers, models, views, and custom process support for long-running PHP services.
File structure
• Top-level:
• start.php / windows.php: entry points that bootstrap the Workerman server.
• composer.json: framework dependencies (Workerman, PSR interfaces, etc.).
• app/: your application code
• controller/IndexController.php – MVC controllers
• model/Test.php – data models
• middleware/StaticFile.php – built-in static file handler
• process/Http.php, Monitor.php – custom Workerman processes
• view/index/view.html – template files
• functions.php – global helper functions
• config/: all framework and application configuration
• route.php, server.php, process.php, middleware.php, container.php, etc.
• public/: default document root for static assets
• runtime/: writable directory for logs and compiled views
• support/: framework support classes (Request, Response, bootstrap)
README for additional insights
• Confirms the purpose: a production-grade PHP framework optimized for high concurrency.
• Points to docs and emphasizes open-source, MIT-licensed.
a. Main components
• Workerman Server Core
• HTTP Worker Process
• Monitor Process
• Configuration & Dependency Injection Container
• Middleware Pipeline (including StaticFile)
• Router
• Controllers & Models (app/controller, app/model)
• View Renderer (app/view + runtime/views)
• Public Asset Directory (public/)
• Support Layer (Request, Response)
• Runtime (logs, caches)
b. Relationships & data flow
1. Client → Workerman HTTP Worker
2. Worker: load config → init DI container
3. Worker: HTTP request enters Middleware Pipeline
– StaticFile middleware intercepts asset requests (public/)
– Other middleware (session, exception handler, etc.)
4. After middleware: Router dispatches to Controller
5. Controller invokes Model(s), business logic, collects data
6. Controller returns Response or View
7. View Renderer compiles template (app/view → runtime/views)
8. Response goes back through pipeline → Workerman → Client
9. Monitor Process runs alongside: watches Worker, restarts on failure
c. Architectural patterns & principles
• Event-driven, non-blocking IO (Workerman event loop)
• MVC pattern in app/
• Middleware pipeline pattern (chain of responsibility)
• Dependency Injection via container.php
• Process isolation: separate Monitor and HTTP processes
d. Key technologies & libraries
• PHP 7+
• Workerman – event-driven server
• PSR-7/PSR-15 (Request/Response, Middleware)
• Composer‐managed dependencies