Skip to content

Latest commit

 

History

History
1130 lines (949 loc) · 63.7 KB

File metadata and controls

1130 lines (949 loc) · 63.7 KB

Changelog

All notable changes to the PivotPHP Framework will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[2.0.0] - 2025-11-15 - Modular Routing & Legacy Cleanup Edition

🎯 Major Breaking Changes - Architectural Modernization

Breaking Release: Complete removal of deprecated code, legacy aliases elimination, and architectural cleanup resulting in 18% codebase reduction while maintaining 100% test success rate.

🗑️ Removed - Legacy Code Elimination

Classes Removed (4 files - 1,468 lines):

  • src/Utils/OpenApiExporter.php - Use ApiDocumentationMiddleware instead
  • src/Middleware/SimpleTrafficClassifier.php - Feature too complex for microframework
  • src/Legacy/Middleware/TrafficClassifier.php - Legacy v1.x implementation
  • src/Legacy/Performance/HighPerformanceMode.php - Legacy v1.x implementation

Test Files Removed (26 files - 10,486 lines):

  • All test files for removed classes and deprecated features
  • Legacy integration test suites (ApplicationCoreIntegrationTest, EndToEndIntegrationTest, etc.)
  • Over-engineered stress tests (HighPerformanceStressTest)
  • Deprecated middleware tests (AuthMiddlewareTest, CsrfMiddlewareTest, XssMiddlewareTest)
  • Legacy utility tests (ArrTest using old Support namespace)

Aliases Removed (110 lines from aliases.php - 59% reduction):

  • PSR-15 Legacy Aliases (8 aliases): CorsMiddleware, ErrorMiddleware, CsrfMiddleware, XssMiddleware, SecurityHeadersMiddleware, AuthMiddleware, RateLimitMiddleware, CacheMiddleware
  • Simple Redundant Aliases* (7 aliases): SimplePerformanceMode, SimpleLoadShedder, SimpleMemoryManager, SimplePoolManager, SimplePerformanceMonitor, SimpleJsonBufferPool, SimpleEventDispatcher
  • v1.1.x Compatibility Aliases (5 aliases): PerformanceMonitor, DynamicPoolManager, DynamicPool, Application, Arr

🔄 Changed - Updated References

Test Files Updated (8 files):

  • Updated namespace imports in Core tests (CacheMiddleware, ErrorMiddleware, SecurityHeadersMiddleware)
  • Changed SimpleLoadShedder → LoadShedder in middleware tests
  • Changed DynamicPoolManager → PoolManager in MemoryManagerTest
  • Fixed ArrayCallableIntegrationTest error handling
  • Updated validation scripts to check ApiDocumentationMiddleware

Fixed - Breaking Change Corrections

  • MemoryManagerTest: Fixed mock to use PoolManager instead of deprecated DynamicPoolManager
  • ArrayCallableIntegrationTest: Corrected error handling expectations (500 status code)
  • Namespace Imports: Updated all test files to use correct modern namespaces
  • Autoloader: Regenerated composer autoloader after removals

📊 Impact Metrics

Code Reduction:

  • Files changed: 42 files
  • Lines removed: -11,954 lines
  • Net reduction: -11,871 lines (18% of codebase)
  • Files removed: 30 files total

Alias Cleanup:

  • aliases.php: 187 → 77 lines (59% reduction)

Test Results:

  • Total Tests: 5,548 tests ✅
  • Assertions: 21,985 assertions
  • Success Rate: 100%
  • Execution Time: 00:57.388
  • Memory Usage: 130.99 MB

🚀 Benefits Achieved

  1. Cleaner Codebase - 18% code reduction
  2. Modern Namespaces - No legacy PSR-15 aliases
  3. Focused Testing - 30 legacy test files removed
  4. Better Maintainability - 59% fewer aliases
  5. Performance - Less autoloading overhead
  6. Clarity - Removed redundant "Simple*" naming
  7. Documentation - Clear migration path
  8. Zero Regressions - All tests passing

⚠️ Migration Required

BREAKING CHANGES - Action Required:

  1. Update PSR-15 Middleware Imports:

    // ❌ OLD (will not work)
    use PivotPHP\Core\Http\Psr15\Middleware\CorsMiddleware;
    
    // ✅ NEW (correct namespace)
    use PivotPHP\Core\Middleware\Http\CorsMiddleware;
  2. Remove "Simple" Prefix*:

    // ❌ OLD
    use PivotPHP\Core\Middleware\SimpleLoadShedder;
    
    // ✅ NEW
    use PivotPHP\Core\Middleware\LoadShedder;
  3. Replace OpenApiExporter:

    // ❌ OLD (removed)
    use PivotPHP\Core\Utils\OpenApiExporter;
    
    // ✅ NEW (use middleware)
    use PivotPHP\Core\Middleware\Http\ApiDocumentationMiddleware;
    $app->use(new ApiDocumentationMiddleware());
  4. Update Pool Manager:

    // ❌ OLD
    use PivotPHP\Core\Http\Pool\DynamicPoolManager;
    
    // ✅ NEW
    use PivotPHP\Core\Http\Pool\PoolManager;

📚 Documentation

🔍 Validation

  • ✅ PHPStan Level 9: Zero errors
  • ✅ PSR-12: 100% compliant
  • ✅ All Tests: 5,548 passing
  • ✅ Zero Regressions: All functionality preserved

[1.2.0] - 2025-07-21 - Simplicity Edition (Simplicidade sobre Otimização Prematura)

Added

  • ApiDocumentationMiddleware - Automatic OpenAPI/Swagger documentation generation
  • Swagger UI Integration - Interactive documentation interface at /swagger
  • OpenAPI 3.0.0 Support - Complete specification generation from routes
  • PHPDoc Route Parsing - Automatic extraction of route metadata
  • Example Application - api_documentation_example.php demonstrating features
  • Legacy Namespace - New src/Legacy/ namespace for complex implementations
  • Simplified Core Classes - Clean, maintainable implementations as defaults
  • Enhanced Code Readability - Improved formatting and readability across test files
  • Better Error Messages - Enhanced test failure messages with more descriptive output
  • Environment-Aware Testing - Improved test skipping logic for different environments

Changed

  • Architecture Simplification - Simple classes promoted to core defaults following "Simplicidade sobre Otimização Prematura"
  • Core Classes Renamed - SimplePerformanceModePerformanceMode, SimpleLoadShedderLoadShedder, etc.
  • Legacy Namespace - Complex classes moved to src/Legacy/ for backward compatibility
  • Core Classes - PerformanceMode, LoadShedder, MemoryManager, PoolManager, etc. are now simple implementations
  • Documentation Focus - Emphasis on automatic documentation generation as key differentiator
  • Middleware Organization - ApiDocumentationMiddleware properly organized under src/Middleware/Http/
  • Code Formatting - Standardized code formatting for better maintainability
  • Test Messages - Improved clarity of test assertions and error messages
  • Function Parameters - Simplified unused parameters in test route closures using $_ convention
  • Line Length Management - Improved code readability by managing long lines appropriately

Deprecated

  • Complex Classes - HighPerformanceMode, ExtensionManager, OpenApiExporter, SerializationCache moved to src/Legacy/ namespace
  • Manual Documentation - Superseded by automatic middleware approach
  • Over-engineered Components - Complex implementations deprecated in favor of simple alternatives

Fixed

  • OpenAPI Documentation - Restored automatic documentation generation functionality that was lost during simplification
  • Middleware Organization - Proper namespace structure for HTTP middleware
  • JsonBufferPool Compatibility - Fixed test compatibility issues with renamed classes
  • Alias System - Resolved autoloader conflicts during class transitions
  • IDE Diagnostics - Resolved all unused variable warnings and undefined type issues
  • Code Style Compliance - Enhanced PSR-12 compliance across test files
  • Test Reliability - Improved test stability in various environments
  • Long Line Formatting - Better handling of long strings and complex assertions

Backward Compatibility

  • 100% Compatible - All existing code continues to work via automatic aliases
  • Alias System - 15+ aliases maintain compatibility with old class names
  • Zero Breaking Changes - Drop-in replacement for existing applications
  • Legacy Support - Complex classes still available via src/Legacy/ namespace
  • Smooth Migration - Optional migration to new simple classes

Performance

  • Maintained Performance - All v1.1.4 performance improvements preserved
  • Object Pool Reuse - 100% request pool reuse, 99.9% response pool reuse maintained
  • Framework Throughput - 44,092 ops/sec maintained with simplified architecture
  • Cleaner Code Execution - No performance impact from code quality improvements

Quality Improvements

  • Zero IDE Warnings - All IDE diagnostics issues resolved across the entire codebase
  • Enhanced Test Coverage - Better test environment detection and handling
  • Cleaner Codebase - Removed unnecessary whitespace and improved formatting
  • Maintainable Tests - More readable test code with descriptive error messages
  • PSR-12 Compliance - Enhanced code style compliance throughout the project
  • Developer Experience - Improved code readability and maintainability

[1.1.4] - 2025-07-15

🔧 Infrastructure Consolidation & Automation Edition

Script Infrastructure Overhaul: Complete consolidation and reorganization of script ecosystem with logical organization in subfolders, 40% reduction (25 → 15 scripts), automatic version detection via mandatory VERSION file, GitHub Actions optimization, and comprehensive versioning documentation while maintaining 100% backward compatibility and zero impact on framework performance.

📁 Script Organization & Structure

  • Logical Subfolder Organization: Scripts organized by functionality for better maintainability
    scripts/
    ├── validation/     # Validation scripts (validate_all.sh, validate-docs.sh, etc.)
    ├── quality/        # Quality checks (quality-check.sh, validate-psr12.php)
    ├── release/        # Release management (prepare_release.sh, version-bump.sh)
    ├── testing/        # Testing scripts (test-all-php-versions.sh, run_stress_tests.sh)
    └── utils/          # Utilities (version-utils.sh, switch-psr7-version.php)
    
  • Comprehensive Documentation: README files in each subfolder with usage examples
  • Backward Compatibility: All existing script names preserved, only location changed
  • Updated Integrations: GitHub Actions workflows, composer.json, and documentation updated

🔧 Script Infrastructure Consolidation

  • 40% Script Reduction: Consolidated from 25 to 15 scripts, eliminating duplication

    • Removed Scripts: 10 duplicate/obsolete scripts eliminated
      • quality-check-v114.sh → Hardcoded version, consolidated into scripts/quality/quality-check.sh
      • validate_all_v114.sh → Hardcoded version, consolidated into scripts/validation/validate_all.sh
      • quick-quality-check.sh → Duplicate functionality integrated
      • simple_pre_release.sh → Replaced by enhanced scripts/release/prepare_release.sh
      • quality-gate.sh → Functionality consolidated into scripts/quality/quality-check.sh
      • quality-metrics.sh → Functionality consolidated into scripts/quality/quality-check.sh
      • test-php-versions-quick.sh → Replaced by scripts/testing/test-all-php-versions.sh
      • ci-validation.sh → Functionality consolidated into scripts/quality/quality-check.sh
      • setup-precommit.sh → One-time setup script, no longer needed
      • adapt-psr7-v1.php → Specific utility script removed for simplicity
  • Shared Utility Library: Created scripts/utils/version-utils.sh with common functions

    • get_version() - Automatic version detection from VERSION file
    • get_project_root() - Project root directory detection
    • validate_project_context() - PivotPHP Core context validation
    • print_version_banner() - Consistent version display across scripts

📦 Automatic Version Management System

  • VERSION File Requirement: Central version source with strict validation

    • Mandatory Format: X.Y.Z semantic versioning strictly enforced
    • Automatic Detection: All scripts now detect version from single source
    • Strict Validation: Scripts fail immediately if VERSION file missing or invalid
    • Portuguese Error Messages: Clear error messages for better developer experience
  • Enhanced Version Management: New scripts/release/version-bump.sh with automation

    # Semantic version management
    scripts/release/version-bump.sh patch    # 1.1.4 → 1.1.5
    scripts/release/version-bump.sh minor    # 1.1.4 → 1.2.0
    scripts/release/version-bump.sh major    # 1.1.4 → 2.0.0
    
    # Preview mode
    scripts/release/version-bump.sh minor --dry-run
    • Git Integration: Automatic commit and tag creation
    • Composer Integration: Updates composer.json if present
    • Validation: Semantic version format enforcement

🚀 GitHub Actions Optimization

  • 25% Workflow Reduction: Consolidated from 4 to 3 workflows

    • Removed: quality-gate.yml - duplicate functionality eliminated
    • Updated: ci.yml - now uses consolidated quality-check.sh
    • Enhanced: pre-release.yml - automatic version detection from VERSION file
    • Fixed: release.yml - corrected repository URLs from express-php to pivotphp-core
  • Workflow Improvements:

    • Automatic version detection eliminates hardcoded references
    • Consolidated script usage for consistency
    • Fixed broken references to removed scripts
    • Enhanced validation consistency across all workflows

📚 Comprehensive Documentation System

  • Versioning Guide: New docs/VERSIONING_GUIDE.md (315 lines)

    • When to increment MAJOR, MINOR, PATCH with specific examples
    • Complete workflow from development to release
    • Script usage examples with troubleshooting
    • FAQ section addressing common versioning questions
  • Script Documentation: Complete rewrite of scripts/README.md

    • Categorized organization by script purpose and usage
    • Workflow examples for daily development and releases
    • Command reference with detailed descriptions
    • Troubleshooting section for common issues
  • Release Documentation: Comprehensive v1.1.4 documentation suite

    • Framework Overview: Complete technical overview and metrics
    • Release Notes: Detailed changes and migration guidance
    • Migration Guide: Step-by-step upgrade instructions
    • Changelog: Comprehensive change documentation

Validation and Error Handling Improvements

  • Strict Error Handling: No fallback mechanisms, fail-fast approach

    # Error examples (in Portuguese for clarity)
    ❌ ERRO CRÍTICO: Arquivo VERSION não encontrado
    ❌ ERRO CRÍTICO: Formato de versão inválido: invalid.format
    ❌ ERRO CRÍTICO: Arquivo VERSION está vazio ou inválido
  • Project Context Validation: Ensures scripts run in correct environment

    • Automatic detection of PivotPHP Core project structure
    • Path-independent execution - works from any directory within project
    • Context validation prevents execution in wrong projects
  • Enhanced Script Capabilities:

    • Cross-directory execution: Scripts work from any project directory
    • Improved error messages: Clear, actionable feedback in Portuguese
    • Consistent interface: Uniform behavior across all scripts
    • Zero configuration: Automatic setup and detection

🔄 Development Workflow Optimization

  • Simplified Commands: Single entry points for complex operations

    # Quality validation (replaces multiple scripts)
    scripts/quality/quality-check.sh
    
    # Complete validation
    scripts/validation/validate_all.sh
    
    # Release preparation
    scripts/release/prepare_release.sh
  • Improved Developer Experience:

    • Fewer commands to remember (40% reduction)
    • Consistent behavior across all environments
    • Automatic version detection eliminates manual errors
    • Better error feedback with actionable solutions

📊 Infrastructure Metrics

  • Script Consolidation Results:

    • Active Scripts: 25 → 15 (40% reduction)
    • Duplications Eliminated: 10 scripts removed
    • GitHub Actions: 4 → 3 workflows (25% reduction)
    • Hardcoding Eliminated: 100% removal of hardcoded versions and paths
    • Documentation Added: 500+ lines of new infrastructure documentation
  • Performance Impact: Zero framework performance impact

    • All v1.1.3 performance characteristics maintained
    • JSON pooling: 161K ops/sec (small), 17K ops/sec (medium), 1.7K ops/sec (large)
    • Framework average: 40,476 ops/sec maintained
    • Infrastructure changes only, no framework code modifications

🛡️ Quality Assurance

  • Enhanced Validation: Comprehensive quality checks maintained

    • PHPStan Level 9: Zero errors maintained
    • PSR-12 Compliance: 100% compliance maintained
    • Test Coverage: All 684 CI tests + 131 integration tests passing
    • Cross-platform Compatibility: Linux, macOS, WSL validation
  • Security Improvements:

    • VERSION file validation prevents malformed version injection
    • Project context validation ensures correct environment
    • Input sanitization for version strings and paths
    • No sensitive information exposed in error messages

[1.1.3] - 2025-07-12

🚀 Performance Optimization & Architectural Excellence Edition

Major Performance Breakthrough: +116% performance improvement with optimized object pooling, comprehensive array callable support for PHP 8.4+ compatibility, strategic CI/CD pipeline optimization, and complete architectural overhaul following modern design principles.

🏗️ Architectural Excellence Initiative

  • ARCHITECTURAL_GUIDELINES Implementation: Complete overhaul following established architectural principles
    • Separation of Concerns: Functional tests (<1s) completely separated from performance tests (@group performance)
    • Simplified Complexity: Removed over-engineered features (circuit breakers, load shedding for microframework)
    • Realistic Timeouts: Eliminated extreme timeouts (>30s) and replaced with production-realistic expectations
    • Test Organization: Split complex test suites into focused, maintainable components
    • Over-Engineering Elimination: Removed premature optimizations that added complexity without value

CI/CD Pipeline Optimization

  • Optimized GitHub Actions: Reduced CI/CD time from ~10-15 minutes to ~2-3 minutes

    • Single PHP Version: CI/CD now uses PHP 8.1 only for critical breaking changes detection
    • Local Multi-PHP Testing: Comprehensive PHP 8.1-8.4 testing via composer docker:test-all
    • Quality Gate: Focused on critical validations (PHPStan L9, PSR-12, Security, Performance baseline)
    • Speed vs Coverage: CI optimized for speed, comprehensive testing done locally via Docker
  • Test Architecture Modernization: Complete restructure following best practices

    • MemoryManagerTest.php (662 lines) → Split into:
      • MemoryManagerSimpleTest.php (158 lines): Functional testing only
      • MemoryManagerStressTest.php (155 lines): Performance/stress testing (@group performance/stress)
    • HighPerformanceStressTest.php: Simplified from over-engineered distributed systems to realistic microframework testing
    • EndToEndIntegrationTest.php: Separated functional integration from performance metrics
  • Architectural Red Flags Eliminated:

    • Removed: Circuit breaker implementation (over-engineered for microframework <500 req/s)
    • Removed: Load shedding with adaptive strategies (premature optimization)
    • Removed: Distributed pool coordination requiring Redis (unnecessary complexity)
    • Fixed: Extreme timeout assertions (60s → realistic 3-5s expectations)
    • Simplified: 598-line HighPerformanceMode with 40+ configurations for simple use cases
  • Guideline Compliance Results:

    • Functional Tests: All core tests execute in <1s (was up to 60s)
    • Performance Separation: @group performance properly isolated from CI pipeline
    • Simplified Implementation: SimplePerformanceMode (70 lines) created as microframework-appropriate alternative
    • Realistic Expectations: Production-appropriate thresholds and timeouts
    • Zero Breaking Changes: All existing functionality preserved while improving architecture

🚀 Performance Optimizations

  • Object Pool System: Revolutionary performance improvements in pooling efficiency
    • Request Reuse Rate: Improved from 0% to 100% (perfect efficiency)
    • Response Reuse Rate: Improved from 0% to 99.9% (near-perfect efficiency)
    • Benchmark Performance: Overall framework performance increased by +116% (20,400 → 44,092 ops/sec)
    • Pool Warming Strategy: Implemented intelligent pre-warming instead of clearing pools
    • Memory Efficiency: Optimized object return-to-pool mechanisms for sustained performance
    • Production Ready: Pool optimization validated in Docker benchmarking environment

🎯 Array Callable Support

  • Full PHP 8.4+ Compatibility: Comprehensive support for array callable route handlers
    • callable|array type union in Router methods for modern PHP strict typing
    • Support for instance methods: [$controller, 'method']
    • Support for static methods: [Controller::class, 'staticMethod']
    • Compatible with parameters: /users/:id routes work seamlessly
    • Comprehensive validation: invalid callables throw InvalidArgumentException
    • 47 new tests: Complete test coverage for array callable functionality (481 assertions)
    • Performance validated: ~23-29% overhead compared to closures (acceptable for production)

🛠️ Code Quality & Test Stability Improvements

  • PSR-12 Compliance: Achieved 100% PSR-12 compliance across the entire codebase

    • Zero violations: All code style issues resolved
    • Test structure optimization: Test helper classes properly separated into individual files
    • Namespace standardization: Consistent PivotPHP\Core\Tests\* namespace structure
    • Autoloader optimization: Enhanced autoloading with proper PSR-4 compliance
  • Test Suite Stabilization: Comprehensive fixes for test reliability and compatibility

    • PHPUnit 10 Compatibility: Fixed assertObjectHasProperty() deprecation issues
    • Dynamic Pool Manager: Enhanced factory pattern support (callable, class, args)
    • Route Conflict Resolution: Fixed /test route conflicts in integration tests
    • Test Coverage Enhancement: Added essential assertions to prevent risky tests

🔧 Parameter Routing Test Suite

  • Comprehensive validation of route parameter functionality

    • 12 unit tests: Basic parameters, constraints, multiple parameters, special characters
    • 8 integration tests: Full application lifecycle with array callables
    • 4 example tests: Practical usage patterns with performance benchmarks
    • Parameter constraint testing: /:id<\d+>, /:filename<[a-zA-Z0-9_-]+\.[a-z]{2,4}>
    • Nested group parameter testing: /api/v1/users/:id/posts/:postId
    • Route conflict resolution: static routes vs parameterized routes priority
  • Performance Route Implementation: /performance/json/:size route for testing and validation

    • Size validation: small, medium, large with appropriate error handling
    • JSON generation with performance metrics: generation time, memory usage
    • Comprehensive test coverage: valid/invalid parameters, response structure, error handling
    • Additional performance routes: /performance/test/memory, /performance/test/time
  • Comprehensive Integration Testing Infrastructure: Complete testing framework for real-world scenarios

    • IntegrationTestCase: Base class with utilities for memory monitoring, performance collection, and HTTP simulation
    • PerformanceCollector: Real-time metrics collection for execution time, memory usage, and resource tracking
    • TestHttpClient: HTTP client for simulating requests with reflection-based route execution
    • TestResponse: Response wrapper for validation and assertion in integration tests
    • TestServer: Advanced testing scenarios with configurable server simulation
  • Phase 2 - Core Integration Tests (COMPLETE): Comprehensive validation of core framework components

    • Application + Container + Routing Integration: 11 tests validating seamless interaction between fundamental components
    • Dependency Injection Validation: Container service binding, singleton registration, and resolution testing
    • Service Provider Integration: Custom provider registration and lifecycle management
    • Multi-Method Routing: GET, POST, PUT, DELETE route handling with proper parameter extraction
    • Configuration Integration: Test configuration management and runtime application
    • Middleware Stack Testing: Execution order validation and error handling integration
    • Error Handling Integration: Exception recovery and graceful error response generation
    • Application State Management: Bootstrap lifecycle and multiple boot call handling
    • Performance Integration: High Performance Mode integration with JSON pooling
    • Memory Management: Garbage collection coordination and resource cleanup validation
  • Phase 3 - HTTP Layer Integration Tests (COMPLETE): Complete HTTP request/response cycle validation

    • HttpLayerIntegrationTest: 11 comprehensive tests validating HTTP processing pipeline
    • PSR-7 Compliance Validation: Real-world PSR-7 middleware scenarios with attribute handling
    • Request/Response Lifecycle: Complete HTTP cycle from request creation to response emission
    • Headers Management: Complex header handling, custom headers, and Content-Type negotiation
    • Body Processing: JSON, form data, and multipart handling with proper parsing
    • HTTP Methods Integration: GET, POST, PUT, DELETE, PATCH with method-specific behaviors
    • Content Types: JSON, text/plain, text/html response generation and validation
    • Status Codes: Complete status code handling (200, 201, 400, 401, 404, 500)
    • Parameter Extraction: Route parameters with type conversion and validation
    • File Upload Simulation: Multipart form data and file handling validation
    • Performance Integration: HTTP layer performance with High Performance Mode
  • Phase 4 - Routing + Middleware Integration Tests (COMPLETE): Advanced routing and middleware pipeline validation

    • RoutingMiddlewareIntegrationTest: 9 comprehensive tests validating complex routing scenarios
    • Middleware Execution Order: Complex middleware chains with proper before/after execution
    • Route Parameter Modification: Middleware transformation of route parameters
    • Request/Response Transformation: Middleware-based request enhancement and response modification
    • Error Handling Pipeline: Exception handling through middleware stack with recovery
    • Conditional Middleware: Path-based middleware execution (API, admin, public routes)
    • Shared State Management: Cross-request state sharing and session simulation
    • Complex Route Patterns: Nested routes, versioned APIs, and file pattern matching
    • Performance Integration: Routing performance with High Performance Mode and JSON pooling
    • Memory Efficiency: Multiple middleware and route memory usage validation
  • Phase 5 - Security Integration Tests (COMPLETE): Comprehensive security and authentication validation

    • SecurityIntegrationTest: 9 comprehensive tests validating security mechanisms and middleware
    • Basic Authentication: HTTP Basic Auth with credential validation and user management
    • JWT Token System: Token generation, HMAC SHA-256 signing, validation, expiration, and refresh
    • Role-Based Authorization: User/admin role permissions, access control, and forbidden access handling
    • CSRF Protection: Token generation, validation, one-time use enforcement, and form security
    • XSS Prevention: HTML escaping, content sanitization, and security header implementation
    • Rate Limiting: Time-window based throttling, configurable limits, retry logic, and client tracking
    • Security Headers: HSTS, CSP, X-Frame-Options, XSS-Protection, Content-Type-Options, and more
    • Performance Integration: Security middleware compatibility with High Performance Mode and JSON pooling
    • Memory Efficiency: Multi-layer security middleware with optimized memory usage
  • Phase 6 - Load Testing Framework (COMPLETE): Advanced load testing and stress validation

    • LoadTestingIntegrationTest: 10 comprehensive tests validating framework behavior under load
    • Concurrent Request Handling: Simulation of 20+ simultaneous requests with throughput measurement
    • CPU Intensive Load Testing: Complex computational workloads with performance analysis
    • Memory Management Under Stress: Large data structure handling with memory leak detection
    • JSON Pooling Performance: High Performance Mode integration with varying data sizes
    • Error Handling Under Load: Exception, memory pressure, and timeout simulation with graceful recovery
    • Throughput Measurement: Request rate control, latency analysis, and performance metrics collection
    • System Recovery Testing: Stress application followed by cleanup and recovery validation
    • Performance Degradation Analysis: Multi-batch testing with degradation pattern detection
    • Concurrent Counter Consistency: Thread-safe operation validation and data consistency checks
    • Cross-Scenario Memory Efficiency: Memory usage analysis across different load patterns
  • Request/Response Object Pooling Fixes: Critical fixes for real request execution

    • Request Constructor Fix: Proper instantiation with required parameters (method, path, pathCallable)
    • Container Method Standardization: Updated all make() calls to use PSR-11 standard get() method
    • ServiceProvider Constructor: Fixed anonymous provider instantiation with required Application parameter
    • Enhanced MockRequest: Improved mock request with complete method implementation

Fixed

  • 🏗️ Architectural Anti-Patterns: Complete resolution of over-engineering and complexity issues

    • Timeout Extremes: Fixed 60-second test timeouts → realistic 3-5 second expectations
    • Test Cache Isolation: Fixed FileCacheTest TTL timing issues with proper buffer (2s → 3s)
    • Request Constructor: Fixed EndToEndPerformanceTest parameter errors (method, path, pathCallable)
    • PSR-12 Code Style: Fixed RoutePrecompiler brace spacing issues for clean code compliance
  • 🔧 Object Pool Performance Crisis: Completely resolved 0% pool reuse rates causing performance degradation

    • Root Cause: Benchmark was clearing pools instead of warming them, zeroing reuse statistics
    • Solution: Implemented intelligent pool warming with object return mechanisms
    • Impact: Request pool efficiency: 0% → 100%, Response pool efficiency: 0% → 99.9%
    • Performance gain: Framework throughput improved by +116% (20,400 → 44,092 ops/sec)
  • 🚀 PHP 8.4+ Array Callable Compatibility: Resolved TypeError issues with array callable route handlers

    • Root Cause: Strict typing in PHP 8.4+ prevented invalid arrays from reaching is_callable() validation
    • Solution: Updated Router method signatures to use callable|array union types
    • Methods Fixed: add(), get(), post(), put(), delete(), patch(), options(), head(), any()
    • Compatibility: Maintains 100% backward compatibility while supporting modern PHP strict typing
  • 🧪 Test Suite Stability: Comprehensive fixes for test reliability and PHPUnit 10 compatibility

    • PHPUnit 10 Compatibility: Fixed deprecated assertObjectHasProperty() method calls
    • Route Conflicts: Resolved /test route conflicts between different test suites
    • Dynamic Pool Manager: Enhanced factory pattern support for callable, class, and args configurations
    • Test Coverage: Added essential assertions to eliminate risky tests warnings
  • 📁 PSR-12 Code Structure: Complete resolution of code style violations and namespace issues

    • Test Controllers: Moved test helper classes to separate files for PSR-12 compliance
    • Namespace Standardization: Corrected all test namespaces to PivotPHP\Core\Tests\* pattern
    • Autoloader Optimization: Regenerated autoloader with proper PSR-4 compliance
    • Zero Violations: Achieved 100% PSR-12 compliance across the entire codebase

Changed

  • 🏗️ Router Method Signatures: Enhanced type safety with union types for PHP 8.4+ compatibility

    • Before: callable $handler - caused TypeError with array callables in PHP 8.4+ strict mode
    • After: callable|array $handler - accepts both closures and array callables seamlessly
    • Impact: Zero breaking changes, improved developer experience, future-proof type safety
  • ⚡ Benchmark Strategy: Revolutionized performance testing approach for accurate pool metrics

    • Before: clearPools() approach - zeroed statistics and prevented reuse measurement
    • After: warmUpPools() + object return strategy - enables accurate efficiency tracking
    • Methodology: Implemented proper object lifecycle (borrow → use → return) for realistic metrics
  • 🧪 Test Architecture: Improved test organization and reliability standards

    • Structure: Test helper classes separated into dedicated files for PSR-12 compliance
    • Namespaces: Standardized all test namespaces to PivotPHP\Core\Tests\* pattern
    • Coverage: Enhanced test assertions to eliminate risky tests and improve reliability
    • Integration: Improved route isolation to prevent conflicts between test suites
  • 🔧 Composer Scripts: Enhanced development workflow with optimized command ecosystem

    • New Commands: Added quality:gate and quality:metrics for strategic validation approach
    • CI Integration: Added ci:validate for ultra-fast CI/CD validation (30 seconds)
    • Docker Testing: Added docker:test-all and docker:test-quality for local multi-version testing
    • Strategic Focus: Scripts now follow local comprehensive + CI minimal validation strategy

📊 Performance Metrics Summary

Metric Before v1.1.3 After v1.1.3 Improvement
Framework Throughput 20,400 ops/sec 44,092 ops/sec 🚀 +116%
Request Pool Reuse 0% 100% ✅ Perfect
Response Pool Reuse 0% 99.9% ✅ Near-Perfect
PSR-12 Violations Multiple 0 ✅ 100% Compliant
Array Callable Support ❌ TypeError ✅ Full Support ✅ PHP 8.4+ Ready
Test Coverage Basic +47 Tests (481 Assertions) ✅ Comprehensive
CI/CD Pipeline Speed ~5 minutes ~30 seconds 🚀 90% Faster
Functional Test Speed Up to 60s <1s (all tests) 🚀 >95% Faster
Architectural Complexity Over-engineered Simplified ✅ Guideline Compliant
Test Organization Mixed concerns Separated (@group) ✅ Clean Architecture

Production Impact: This release delivers a major performance breakthrough with sustained high-throughput object pooling and strategic CI/CD optimization, making PivotPHP v1.1.3 significantly more efficient for both production workloads and development workflows.

  • Integration Test Execution: Resolved critical blocking issues preventing real application execution

    • Request Instantiation: Fixed "Too few arguments" error by providing proper constructor parameters
    • Container Interface: Corrected method calls from make() to get() for PSR-11 compliance
    • ServiceProvider Creation: Fixed anonymous class constructor requiring Application instance
    • TestHttpClient Robustness: Enhanced reflection-based route execution with proper error handling
  • Performance System Validation: Completed high-performance mode integration testing

    • PerformanceMonitor Configuration: Robust threshold access with fallback values
    • Memory Usage Assertions: Flexible assertions compatible with test environment limitations
    • Metric Format Standardization: Consistent decimal format (0.75) vs percentage (75%) across all tests
    • JSON Pooling Integration: Validated automatic optimization with various data sizes

Validated

  • Phase 1 - Performance Features (100% COMPLETE): All high-performance systems fully validated
    • High Performance Mode: Enable/disable, profile switching, monitoring integration
    • JSON Buffer Pooling: Automatic optimization, pool statistics, memory efficiency
    • Performance Monitoring: Live metrics, latency tracking, error recording
    • Memory Management: Pressure detection, garbage collection, resource cleanup
    • Concurrent Operations: 20 simultaneous operations with zero active requests at completion
    • Error Resilience: System stability under encoding errors and recovery scenarios
    • Resource Cleanup: 100% cleanup verification when disabling performance features
    • Performance Regression Detection: Baseline vs load comparison with degradation limits
    • Extended Stability: 50 operations across 5 batches with controlled memory growth

Testing Results

  • Architectural Excellence Tests: ✅ 22/22 tests passing (90 assertions)

    • Memory Manager Simple: ✅ 9/9 tests passing (35 assertions) - Functional testing only
    • Memory Manager Stress: ✅ 4/4 tests passing (16 assertions) - @group performance/stress
    • High Performance Stress: ✅ 9/9 tests passing (27 assertions) - 3 skipped (over-engineered removed)
    • Test separation validation and architectural guideline compliance
  • Array Callable Tests: ✅ 27/27 tests passing (229 assertions)

    • Unit Tests: ✅ 13/13 passing (70 assertions) - Router functionality validation
    • Integration Tests: ✅ 10/10 passing (46 assertions) - Full application lifecycle
    • Example Tests: ✅ 4/4 passing (113 assertions) - Practical usage patterns
  • Parameter Routing Tests: ✅ 20/20 tests passing (102 assertions)

    • Basic parameter extraction and validation
    • Complex constraint patterns and special characters
    • Nested group parameters and route conflicts
  • Performance Route Tests: ✅ 8/8 tests passing (50 assertions)

    • JSON generation and validation for different sizes
    • Memory and time performance testing routes
  • Compatibility Validation: ✅ 88/88 routing tests passing (340 assertions)

    • All existing Router functionality preserved
    • Zero breaking changes confirmed
  • Phase 2 - Core Integration: ✅ 11/11 tests passing (36 assertions)

  • Phase 3 - HTTP Layer Integration: ✅ 11/11 tests passing (120 assertions)

  • Phase 4 - Routing + Middleware: ✅ 9/9 tests passing (156 assertions)

  • Phase 5 - Security Integration: ✅ 9/9 tests passing (152 assertions)

  • Phase 6 - Load Testing Framework: ✅ 10/10 tests passing (47 assertions)

  • Performance Integration Tests: ✅ 9/9 passing (76 assertions)

  • Total New Integration Tests: ✅ 50/50 tests passing (511 assertions)

  • Overall Integration Success Rate: ✅ 107/119 tests passing (90% success rate)

  • Load Testing Coverage: 100% concurrent handling, CPU/memory stress, throughput, recovery validation

  • Security Coverage: 100% authentication, authorization, CSRF, XSS, rate limiting validation

  • Memory Efficiency: Growth < 25MB under extended load with security middleware and stress testing

  • Error Recovery: 100% system resilience validated under load and stress conditions

  • Resource Management: Complete cleanup verification across all scenarios

Final Test Validation (Post-Architectural Improvements)

  • CI Test Suite: ✅ 684/684 tests passing (5 appropriate skips)
    • Time: 19.44 seconds (significant improvement from potential timeouts)
    • Memory: 82.99 MB (efficient memory usage)
    • Assertions: 2,425 total assertions validated
  • Integration Test Suite: ✅ 131/131 tests passing (1 appropriate skip)
    • Time: 11.75 seconds (fast integration testing)
    • Memory: 28.00 MB (optimized for integration scenarios)
    • Assertions: 1,641 total assertions validated
  • Architectural Compliance: ✅ 100% compliance with ARCHITECTURAL_GUIDELINES
    • Functional tests execute in <1s each
    • Performance tests properly isolated with @group annotations
    • Over-engineered features removed or simplified
    • All extreme timeouts replaced with realistic expectations

Documentation

  • Integration Test Validation Report: Complete documentation of testing phase results
  • Test Infrastructure Guide: Comprehensive guide for using integration testing framework
  • Performance Validation: Detailed metrics and benchmarks for high-performance features
  • Phase 2 Completion: Core integration between Application, Container, and Router fully validated

Technical Quality

  • Test Maintainability: Enhanced with constants instead of hardcoded values
  • Error Handling: Graceful fallbacks and comprehensive exception management
  • Memory Monitoring: Advanced tracking with garbage collection coordination
  • Performance Metrics: Real-time collection with statistical analysis
  • Type Safety: Strict typing enforcement with PHPStan Level 9 compliance

Completed Phases

  • ✅ Phase 1 - Performance Features: High Performance Mode, JSON pooling, monitoring (100% complete)
  • ✅ Phase 2 - Core Integration: Application, Container, Routing integration (100% complete)
  • ✅ Phase 3 - HTTP Layer Integration: Request/Response, PSR-7, Headers (100% complete)
  • ✅ Phase 4 - Routing + Middleware: Complex routing, middleware chains (100% complete)

Completed Phases

  • ✅ Phase 1 - Performance Features: High Performance Mode, JSON pooling, monitoring (100% complete)
  • ✅ Phase 2 - Core Integration: Application, Container, Routing integration (100% complete)
  • ✅ Phase 3 - HTTP Layer Integration: Request/Response, PSR-7, Headers (100% complete)
  • ✅ Phase 4 - Routing + Middleware: Complex routing, middleware chains (100% complete)
  • ✅ Phase 5 - Security Integration: Authentication, authorization, security middleware (100% complete)
  • ✅ Phase 6 - Load Testing Framework: Advanced concurrent request simulation and stress testing (100% complete)

Integration Testing Program Status

COMPLETE: All 6 phases of comprehensive integration testing successfully implemented and validated

🔄 CI/CD Pipeline Strategy Optimization

  • Strategic CI/CD Redesign: Complete overhaul of GitHub Actions workflows based on redundancy elimination strategy

    • Problem Identified: CI/CD, Quality Gate, and local validation were running identical tests redundantly
    • Solution Implemented: Local Docker multi-version testing + minimal CI/CD validation approach
    • Performance Impact: CI/CD execution time reduced from ~5 minutes to ~30 seconds (90% faster)
  • Optimized Validation Scripts: Complete script ecosystem redesign for focused responsibilities

    • ci-validation.sh: Ultra-fast critical validations (PHPStan Level 9, PSR-12, Composer, Autoload)
    • quality-gate.sh: Comprehensive quality assessment with clean output (no JSON contamination)
    • quality-metrics.sh: Extended analysis without redundant validations (coverage, complexity, docs)
    • test-all-php-versions.sh: Docker-based local testing across PHP 8.1-8.4
  • GitHub Actions Workflow Updates: All 4 workflows optimized for new strategy

    • ci.yml: Multi-PHP testing with optimized scripts, clean CI test suite execution
    • quality-gate.yml: Minimalist approach focusing on critical validations only
    • pre-release.yml: Fixed PHP version matrix (8.1-8.4), corrected class references
    • release.yml: Streamlined release validation using optimized quality gate
  • Output Contamination Elimination: Complete resolution of JSON output issues in CI/CD pipelines

    • QuietBenchmark.php: Created clean performance testing without JSON outputs
    • Response Test Mode: Automatic test mode detection to prevent output during CI/CD
    • Stream Redirection: All scripts properly redirect outputs to logs for clean CI/CD execution
  • Strategic Benefits Achieved:

    • 🚀 Speed: CI/CD pipelines 90% faster (30 seconds vs 5 minutes)
    • 🎯 Focus: Critical breaking changes detection only in CI/CD
    • 🐳 Local: Comprehensive testing via Docker multi-version locally
    • 🧹 Clean: Zero JSON contamination in pipeline outputs
    • ♻️ Efficiency: Eliminated redundant test execution across environments

[1.1.2] - 2025-07-11

🎯 Consolidation Edition

Added

  • Structured Middleware Architecture: Complete reorganization of middleware system

    • src/Middleware/Security/: Authentication, CSRF, XSS, Security Headers
    • src/Middleware/Performance/: Cache, Rate Limiting
    • src/Middleware/Http/: CORS, Error Handling
    • 12 Compatibility Aliases: 100% backward compatibility maintained
  • Enhanced Code Quality:

    • PHPStan Level 9: Zero errors, maximum static analysis
    • 100% Test Success: 430/430 tests passing
    • PSR-12 Compliance: Complete coding standards adherence
    • Performance Maintained: 48,323 ops/sec average maintained

Changed

  • Consolidated Duplicate Classes: Eliminated 100% of critical duplications

    • Removed Support/Arr.php → Migrated to Utils/Arr.php
    • Consolidated PerformanceMonitor → Single implementation in Performance/
    • Unified DynamicPoolDynamicPoolManager in Http/Pool/
    • 3.1% Code Reduction: 1,006 lines removed (30,627 → 29,621)
    • 2.5% File Reduction: 3 files removed (121 → 118)
  • Improved Architecture:

    • Standardized Namespaces: Consistent naming across all components
    • Logical Organization: Components grouped by responsibility
    • Enhanced Maintainability: Cleaner, more navigable codebase
    • Developer Experience: Intuitive structure for faster development

Fixed

  • DynamicPoolManager: Complete method compatibility with original DynamicPool
  • Arr Utility: Added missing shuffle() method with key preservation
  • Pool Statistics: Enhanced getStats() method with comprehensive metrics
  • Memory Management: Improved memory tracking and statistics

Removed

  • Critical Duplications: All 5 identified duplications eliminated
  • Deprecated Code: Removed obsolete Support/Arr.php wrapper
  • Redundant Implementations: Consolidated multiple duplicate classes

Migration

  • Automatic Compatibility: All existing code continues working
  • Recommended Updates: New namespace structure for better organization
  • Migration Scripts: Available for gradual transition to new structure
  • Zero Breaking Changes: 100% backward compatibility preserved

[1.1.1] - 2025-07-10

🚀 JSON Optimization Edition

Added

  • High-Performance JSON Buffer Pooling System: Revolutionary JSON processing optimization

    • JsonBuffer: Optimized buffer class for JSON operations with automatic expansion
    • JsonBufferPool: Intelligent pooling system with buffer reuse and size categorization
    • Automatic Integration: Response::json() now uses pooling transparently for optimal performance
    • Smart Detection: Automatically activates pooling for arrays 10+ elements, objects 5+ properties, strings >1KB
    • Graceful Fallback: Small datasets use traditional json_encode() for best performance
    • Public Constants: All size estimation and threshold constants are now publicly accessible for advanced usage and testing
  • Performance Monitoring & Statistics:

    • Real-time pool statistics with reuse rates and efficiency metrics
    • Configurable pool sizes and buffer categories (small: 1KB, medium: 4KB, large: 16KB, xlarge: 64KB)
    • Production-ready monitoring with JsonBufferPool::getStatistics()
    • Performance tracking for optimization and debugging
  • Developer Experience:

    • Zero Breaking Changes: All existing code continues working without modification
    • Transparent Optimization: Automatic activation based on data characteristics
    • Manual Control: Direct pool access via JsonBufferPool::encodeWithPool() when needed
    • Configuration API: Production tuning via JsonBufferPool::configure()
    • Enhanced Error Handling: Precise validation messages separating type vs range errors
    • Type Safety: encodeWithPool() now always returns string, simplifying error handling

Performance Improvements

  • Sustained Throughput: 101,000+ JSON operations per second in continuous load tests
  • Memory Efficiency: 100% buffer reuse rate in high-frequency scenarios
  • Reduced GC Pressure: Significant reduction in garbage collection overhead
  • Scalable Architecture: Adaptive pool sizing based on usage patterns

Technical Details

  • PSR-12 Compliant: All new code follows project coding standards
  • Comprehensive Testing: 84 JSON tests with 329+ assertions covering all functionality
  • Backward Compatible: No changes required to existing applications
  • Production Ready: Tested with various data sizes and load patterns
  • Centralized Constants: All thresholds and size constants are unified to avoid duplication
  • Test Maintainability: Tests now use constants instead of hardcoded values for better maintainability

Files Added

  • Architectural Improvement Files:
    • tests/Memory/MemoryManagerSimpleTest.php: Functional memory manager testing (158 lines)
    • tests/Performance/MemoryManagerStressTest.php: Stress testing with @group performance (155 lines)
    • src/Performance/SimplePerformanceMode.php: Lightweight alternative to HighPerformanceMode (70 lines)
    • docs/ARCHITECTURAL_GUIDELINES.md: Comprehensive architectural principles and anti-pattern identification

Files Modified

  • Enhanced Test Architecture:
    • tests/Stress/HighPerformanceStressTest.php: Simplified by removing over-engineered features
    • tests/Integration/HighPerformanceIntegrationTest.php: Separated functional from performance testing
    • tests/Integration/EndToEndIntegrationTest.php: Focused on functional integration only
    • tests/Cache/FileCacheTest.php: Fixed TTL timing issues with proper test isolation
    • tests/Performance/EndToEndPerformanceTest.php: Fixed constructor parameter errors
    • src/Routing/RoutePrecompiler.php: Fixed PSR-12 brace spacing compliance

Files Added (JSON Optimization)

  • src/Json/Pool/JsonBuffer.php: Core buffer implementation
  • src/Json/Pool/JsonBufferPool.php: Pool management system
  • tests/Json/Pool/JsonBufferTest.php: Comprehensive buffer tests
  • tests/Json/Pool/JsonBufferPoolTest.php: Pool functionality tests
  • benchmarks/JsonPoolingBenchmark.php: Performance validation tools

Files Modified

  • src/Http/Response.php: Integrated automatic pooling in json() method
  • Enhanced with smart detection and fallback mechanisms

Post-Release Improvements (July 2025)

  • Enhanced Configuration Validation: Separated type checking from range validation for more precise error messages
  • Improved Type Safety: encodeWithPool() method now has tightened return type (always returns string)
  • Public Constants Exposure: Made all size estimation and threshold constants public for advanced usage and testing
  • Centralized Thresholds: Unified pooling decision thresholds across Response.php and JsonBufferPool to eliminate duplication
  • Test Maintainability: Updated all tests to use constants instead of hardcoded values
  • Documentation Updates:
    • Added comprehensive Constants Reference Guide
    • Updated performance guide with recent improvements
    • Enhanced error handling documentation

[1.1.0] - 2025-07-09

🚀 High-Performance Edition

📖 Complete documentation: docs/releases/v1.1.0/

Added

  • High-Performance Mode: Centralized performance management with pre-configured profiles
    • STANDARD profile for applications <1K req/s
    • HIGH profile for 1K-10K req/s
    • EXTREME profile for >10K req/s
    • Easy one-line enablement: HighPerformanceMode::enable(HighPerformanceMode::PROFILE_HIGH)
  • Dynamic Object Pooling: Auto-scaling pools with intelligent overflow handling
    • DynamicPool with automatic expansion/shrinking based on load
    • Four overflow strategies: ElasticExpansion, PriorityQueuing, GracefulFallback, SmartRecycling
    • Emergency mode for extreme load conditions
    • Pool metrics and efficiency tracking
  • Performance Middleware Suite:
    • LoadShedder: Intelligent request dropping under overload (priority, random, oldest, adaptive strategies)
    • CircuitBreaker: Failure isolation with automatic recovery (CLOSED, OPEN, HALF_OPEN states)
    • Enhanced RateLimiter with burst support and priority handling
  • Memory Management System:
    • MemoryManager with adaptive GC strategies
    • Automatic pool size adjustments based on memory pressure
    • Four pressure levels: LOW, MEDIUM, HIGH, CRITICAL
    • Emergency mode activation under critical conditions
  • Distributed Pool Coordination (Extension-based):
    • DistributedPoolManager for multi-instance deployments
    • Built-in NoOpCoordinator for single-instance operation
    • Redis/etcd/Consul support via optional extensions
    • Leader election for pool rebalancing
    • Cross-instance object sharing
  • Real-Time Performance Monitoring:
    • PerformanceMonitor with live metrics collection
    • Latency percentiles (P50, P90, P95, P99)
    • Throughput and error rate tracking
    • Prometheus-compatible metric export
    • Built-in alerting system
  • Pool Management:
    • Pool statistics and metrics collection
    • Performance monitoring capabilities
    • Health status tracking

Performance Improvements

  • 25x faster Request/Response creation (2K → 50K ops/s)
  • 90% reduction in memory usage per request (100KB → 10KB)
  • 90% reduction in P99 latency (50ms → 5ms)
  • 10x increase in max throughput (5K → 50K req/s)
  • Zero downtime during pool scaling operations

Documentation

  • HIGH_PERFORMANCE_GUIDE.md: Complete usage guide with examples
  • ARCHITECTURE.md: Technical architecture and component design
  • PERFORMANCE_TUNING.md: Production tuning for maximum performance
  • MONITORING.md: Monitoring setup with Prometheus/Grafana

[1.0.1] - 2025-07-09

🔄 PSR-7 Hybrid Support & Performance Optimizations

📖 See complete overview: docs/technical/http/

Added

  • PSR-7 Hybrid Implementation: Request/Response classes now implement PSR-7 interfaces while maintaining Express.js API
    • Request implements ServerRequestInterface with full PSR-7 compatibility
    • Response implements ResponseInterface with full PSR-7 compatibility
    • 100% backward compatibility - existing code works without changes
    • Lazy loading for PSR-7 objects - created only when needed
    • Support for PSR-15 middleware with type hints
  • Object Pooling System: Advanced memory optimization for high-performance scenarios
    • Psr7Pool class managing pools for ServerRequest, Response, Uri, and Stream objects
    • OptimizedHttpFactory with configurable pooling settings
    • Automatic object reuse to reduce garbage collection pressure
    • Configurable pool sizes and warm-up capabilities
    • Performance metrics and monitoring tools
  • Debug Mode Documentation: Comprehensive guide for debugging applications
    • Environment configuration options
    • Logging and error handling best practices
    • Security considerations for debug mode
    • Performance impact analysis
  • Enhanced Documentation: Complete PSR-7 hybrid usage guides
    • Updated Request/Response documentation with PSR-7 examples
    • Object pooling configuration and usage examples
    • Performance optimization techniques

Changed

  • Request Class: Now extends PSR-7 ServerRequestInterface while maintaining Express.js methods
    • getBody() method renamed to getBodyAsStdClass() for legacy compatibility
    • Added PSR-7 methods: getMethod(), getUri(), getHeaders(), getBody(), etc.
    • getHeaders() renamed to getHeadersObject() for Express.js style (returns HeaderRequest)
    • Immutable with*() methods for PSR-7 compliance
    • Lazy loading implementation for performance
  • Distributed Pooling: Now requires external extensions for coordination backends
    • Redis support moved to pivotphp/redis-pool extension
    • Built-in NoOpCoordinator for single-instance deployments
    • Automatic fallback when extensions are not available
  • Response Class: Now extends PSR-7 ResponseInterface while maintaining Express.js methods
    • Added PSR-7 methods: getStatusCode(), getHeaders(), getBody(), etc.
    • Immutable with*() methods for PSR-7 compliance
    • Lazy loading implementation for performance
  • Factory System: Enhanced with pooling capabilities
    • OptimizedHttpFactory replaces basic HTTP object creation
    • Configurable pooling for better memory management
    • Automatic object lifecycle management

Fixed

  • Type Safety: Resolved PHPStan Level 9 issues with PSR-7 implementation
  • Method Conflicts: Fixed getBody() method conflict between legacy and PSR-7 interfaces
  • File Handling: Improved file upload handling with proper PSR-7 stream integration
  • Immutability: Ensured proper immutability in PSR-7 with*() methods
  • Test Compatibility: Updated test suite to work with hybrid implementation

Performance Improvements

  • Lazy Loading: PSR-7 objects created only when accessed, reducing memory usage
  • Object Pooling: Significant reduction in object creation and garbage collection
  • Optimized Factory: Intelligent object reuse for better performance
  • Memory Efficiency: Up to 60% reduction in memory usage for high-traffic scenarios

Examples

// Express.js API (unchanged)
$app->get('/users/:id', function($req, $res) {
    $id = $req->param('id');
    return $res->json(['user' => $userService->find($id)]);
});

// PSR-7 API (now supported)
$app->use(function(ServerRequestInterface $request, ResponseInterface $response, $next) {
    $method = $request->getMethod();
    $newRequest = $request->withAttribute('processed', true);
    return $next($newRequest, $response);
});

// Object pooling configuration
OptimizedHttpFactory::initialize([
    'enable_pooling' => true,
    'warm_up_pools' => true,
    'max_pool_size' => 100,
]);

[1.0.1] - 2025-07-08

🆕 Regex Route Validation Support & PSR-7 Compatibility

📖 See complete overview: docs/releases/FRAMEWORK_OVERVIEW_v1.0.1.md

Added

  • Regex Constraints: Advanced pattern matching for route parameters
  • Predefined Shortcuts: Common patterns (int, slug, uuid, date, etc.)
  • Full Regex Blocks: Complete control over route segments
  • Non-greedy Pattern Matching: Improved regex processing
  • Backward Compatibility: All v1.0.0 routes continue to work
  • PSR-7 Dual Version Support: Full compatibility with both PSR-7 v1.x and v2.x
    • Automatic version detection via Psr7VersionDetector
    • Script to switch between versions: scripts/utils/switch-psr7-version.php
    • Enables ReactPHP integration with PSR-7 v1.x
    • Maintains type safety with PSR-7 v2.x

Changed

  • Refactored RouteCache::compilePattern() into 12 focused helper methods
  • Improved route compilation performance with better regex handling
  • Enhanced parameter extraction logic with shared helper method
  • Updated documentation positioning (ideal for concept validation and studies)
  • Added comprehensive documentation for regex block pattern limitations
  • Created dedicated test suite for regex block validation
  • Updated composer.json to support "psr/http-message": "^1.1|^2.0"

Fixed

  • Route pattern compilation preserving URL-encoded characters
  • Regex anchors being duplicated in full regex blocks
  • Greedy regex pattern spanning multiple blocks
  • PHPStan warnings about type comparisons
  • PSR-12 code style violations

Examples

// Numeric validation
$app->get('/users/:id<\\d+>', handler);

// Using shortcuts
$app->get('/posts/:slug<slug>', handler);
$app->get('/items/:uuid<uuid>', handler);

// Date validation
$app->get('/archive/:year<\\d{4}>/:month<\\d{2}>', handler);

// Full regex blocks
$app->get('/api/{^v(\\d+)$}/users', handler);

[1.0.0] - 2025-07-07

🚀 Initial Stable Release

📖 See complete overview: docs/releases/FRAMEWORK_OVERVIEW_v1.0.0.md

Added

  • High-Performance Framework: Modern PHP microframework with advanced optimizations
  • PSR Compliance: Full PSR-7, PSR-11, PSR-12, PSR-14, PSR-15 compatibility
  • Security Suite: Built-in CORS, CSRF, XSS protection, JWT authentication
  • Middleware System: Flexible PSR-15 middleware pipeline with performance optimizations
  • Dependency Injection: Advanced DI container with service providers
  • Event System: PSR-14 compliant event dispatcher with hooks
  • Extension System: Plugin architecture with auto-discovery
  • Performance Monitoring: Built-in benchmarking and profiling tools
  • Developer Experience: Hot reload, detailed logging, OpenAPI support

Features

  • Authentication: JWT, Basic Auth, Bearer Token, API Key support
  • Rate Limiting: Advanced rate limiting with multiple algorithms
  • Caching: Multi-layer caching system with intelligent invalidation
  • Request/Response: Full PSR-7 HTTP message implementation
  • Routing: High-performance router with middleware support
  • Validation: Data validation with custom rules
  • Error Handling: Comprehensive error handling and debugging
  • Testing: 270+ unit and integration tests

Performance Metrics

  • 2.57M ops/sec: CORS Headers Generation
  • 2.27M ops/sec: Response Creation
  • 757K ops/sec: Route Resolution
  • 1.4K req/sec: End-to-end throughput
  • 1.2 MB: Memory usage
  • 0.71 ms: Average latency

Quality Assurance

  • PHPStan Level 9: Zero static analysis errors
  • PSR-12: 100% code style compliance
  • 270+ Tests: Comprehensive test coverage
  • PHP 8.1+: Modern PHP version support
  • Performance Validated: Optimized for high-performance applications

Technical Stack

  • PHP: 8.1+ with full 8.4 compatibility
  • Standards: PSR-7, PSR-11, PSR-12, PSR-14, PSR-15
  • Testing: PHPUnit with extensive coverage
  • Quality: PHPStan Level 9, PHP_CodeSniffer PSR-12
  • Performance: Optimized for high-concurrency applications

Documentation

  • Complete API documentation
  • Performance benchmarks and analysis
  • Integration guides and examples
  • Security best practices
  • Extension development guide

📋 Release Notes

This is the first stable release of PivotPHP Framework v1.0.0. The framework has been designed from the ground up for modern PHP development with a focus on:

  1. Performance: Optimized for high-throughput applications
  2. Security: Built-in protection against common vulnerabilities
  3. Developer Experience: Modern tooling and comprehensive documentation
  4. Extensibility: Plugin system for custom functionality
  5. Standards Compliance: Following PHP-FIG recommendations

🔄 Future Roadmap

The v1.0.0 release establishes a stable foundation. Future updates will focus on:

  • Additional middleware components
  • Enhanced performance optimizations
  • Extended documentation and examples
  • Community contributions and feedback integration

📞 Support

For questions, issues, or contributions:


Current Version: v1.0.1 Release Date: July 9, 2025 Status: Production-ready with PSR-7 hybrid support Minimum PHP: 8.1