How turanmahmudov/phpmicroframework works
Main Components
a) Core Framework Components:
• Application Core
• Router System
• Middleware Dispatcher
• Response Emitter
• Container/Factory System
b) Key Architectural Patterns:
• Middleware Pipeline Pattern
• Factory Pattern
• Router Pattern (using FastRoute)
Top Layer (HTTP Layer):
• Show incoming HTTP Request
• ResponseEmitter for handling responses
Middle Layer (Core Framework):
• Application class as the central component
• MiddlewareDispatcher with pipeline flow
• Router system (FastRoute implementation)
Bottom Layer (Factory Layer):
• Container Factory
• Application Factory
• Router Factory
• Middleware Factory
Component Relationships
• Bidirectional connections between Application and Router
• Exception handling flow with red lines (showing HTTP exceptions)
Specific Implementation Details
• Rectangles: Core components (Application, Router, MiddlewareDispatcher)
• Hexagons: Factories
• Diamonds: Decision points (routing, middleware dispatch)
• Ovals: Entry/Exit points (Request/Response)
• Blue: Core framework components
• Green: HTTP request/response flow
• Yellow: Factory components
• Red: Exception handling components
Important Elements to Highlight
a) Middleware System:
• Middleware pipeline structure
• EmptyPipelineHandler as the terminal point
• Middleware dispatch flow
b) Routing System:
• FastRoute integration
• Route collection and dispatch process
• Group routing capabilities
c) Exception Handling:
• Hierarchy of HTTP exceptions
• How exceptions flow through the system