PivotPHP v2.0.0 - Legacy Cleanup Edition
Release Date: January 2025
Theme: "Simplicity through Elimination"
Status:
π― Overview
Version 2.0.0 represents a major architectural cleanup, removing 18% of the codebase (11,871 lines) while maintaining 100% test coverage. This release eliminates technical debt accumulated since v1.1.x, providing a cleaner foundation for future development.
Key Achievements
- β 18% Code Reduction - Removed 11,871 lines of legacy code
- β 110 Aliases Eliminated - Cleaner namespace structure
- β Zero Deprecated Code - All legacy v1.1.x aliases removed
- β 100% Test Coverage - All 5,548 tests passing
- β 59% Faster Autoload - Removed alias mapping overhead
- β
Routing Externalized - Moved to
pivotphp/core-routingpackage
π₯ Breaking Changes
1. PSR-15 Middleware Namespaces
Old (v1.x):
use PivotPHP\Core\Http\Psr15\Middleware\AuthMiddleware;
use PivotPHP\Core\Http\Psr15\Middleware\CorsMiddleware;
use PivotPHP\Core\Http\Psr15\Middleware\SecurityMiddleware;New (v2.0.0):
use PivotPHP\Core\Middleware\Security\AuthMiddleware;
use PivotPHP\Core\Middleware\Http\CorsMiddleware;
use PivotPHP\Core\Middleware\Security\SecurityMiddleware;2. Simple* Prefix Removal
Old (v1.x):
use PivotPHP\Core\Middleware\SimpleRateLimitMiddleware;
use PivotPHP\Core\Security\SimpleCsrfMiddleware;New (v2.0.0):
use PivotPHP\Core\Middleware\Performance\RateLimitMiddleware;
use PivotPHP\Core\Middleware\Security\CsrfMiddleware;3. OpenAPI System
Old (v1.x):
use PivotPHP\Core\OpenApi\OpenApiExporter;
$exporter = new OpenApiExporter($router);
$schema = $exporter->export();New (v2.0.0):
use PivotPHP\Core\Middleware\Http\ApiDocumentationMiddleware;
$app->use(new ApiDocumentationMiddleware([
'title' => 'My API',
'version' => '1.0.0'
]));4. Removed Components
- β DynamicPoolManager - Use
ObjectPoolinstead - β SimpleTrafficClassifier - Removed (over-engineered for POC use cases)
- β 110 Legacy Aliases - All v1.1.x backward compatibility removed
π Migration Guide
Quick Migration (15-30 minutes)
# 1. Update composer.json
composer require pivotphp/core:^2.0
# 2. Automated namespace updates
find src/ -type f -name "*.php" -exec sed -i \
's/use PivotPHP\\Core\\Http\\Psr15\\Middleware\\/use PivotPHP\\Core\\Middleware\\/g' {} \;
# 3. Remove Simple* prefixes
find src/ -type f -name "*.php" -exec sed -i \
's/Simple\(RateLimitMiddleware\|CsrfMiddleware\)/\1/g' {} \;
# 4. Run tests
composer testDetailed Migration Steps
-
Update Middleware Imports
- Replace
Http\Psr15\Middleware\*with appropriate namespaces - Security middleware β
Middleware\Security\* - HTTP middleware β
Middleware\Http\* - Performance middleware β
Middleware\Performance\*
- Replace
-
Remove Simple Prefixes*
- All "Simple" prefixed classes renamed
- Update imports and class references
-
Update API Documentation
- Replace
OpenApiExporterwithApiDocumentationMiddleware - Use PSR-15 middleware approach
- Replace
-
Test Thoroughly
- Run full test suite after each module update
- Validate API endpoints
π Modular Routing Foundation
Phase 1: Complete (v2.0.0)
Routing system extracted to external package:
// Routing now from pivotphp/core-routing
use PivotPHP\Core\Routing\Router;
$app = new Application();
$app->get('/users', function($req, $res) {
// Router from external package
});Backward Compatibility:
- β All existing code works unchanged
- β Aliases provide seamless transition
- β Zero breaking changes in routing API
Phase 2: Planned (v2.1.0)
Pluggable router injection coming soon:
// Future: Custom router adapters
$app = new Application([
'router' => new SymfonyRoutingAdapter()
]);Planned Features:
- π§ RouterInterface contract
- π§ Multiple adapter implementations (Symfony, Attribute-based)
- π§ Router injection via Application constructor
π Performance Impact
Autoload Performance
| Metric | v1.2.0 | v2.0.0 | Improvement |
|---|---|---|---|
| Alias Count | 110 | 0 | 100% reduction |
| Bootstrap Time | ~15ms | ~6ms | 59% faster |
| Memory Footprint | 1.61MB | 1.45MB | 10% reduction |
| PSR-4 Resolution | Slow | Fast | Optimized |
HTTP Throughput
- β No Regression - Maintained 44,092 ops/sec
- β Same Performance - Cleanup didn't impact runtime
- β Better Autoload - Faster application bootstrap
π Design Philosophy
"Simplicity through Elimination"
This release embodies our commitment to maintainability over backward compatibility:
- Reduced Cognitive Load - 110 fewer aliases to understand
- Clearer Intent - Modern namespaces reflect component purposes
- Better Navigation - Simpler directory structure
- Clean Foundation - Ready for v2.x feature development
Why Breaking Changes?
- SemVer Compliant - Major versions permit breaking changes
- Long-term Health - Better to break once than accumulate debt
- Educational Focus - Simpler codebase easier to learn
- Future-Ready - Clean slate for PHP 8.4 features
π§ Troubleshooting
Common Issues
Issue 1: Class Not Found
// Error: Class 'PivotPHP\Core\Http\Psr15\Middleware\AuthMiddleware' not found
// Solution: Update namespace
use PivotPHP\Core\Middleware\Security\AuthMiddleware;Issue 2: Simple Prefix Missing*
// Error: Class 'SimpleRateLimitMiddleware' not found
// Solution: Remove 'Simple' prefix
use PivotPHP\Core\Middleware\Performance\RateLimitMiddleware;Issue 3: OpenApiExporter Removed
// Error: Class 'OpenApiExporter' not found
// Solution: Use ApiDocumentationMiddleware
$app->use(new ApiDocumentationMiddleware([
'title' => 'My API',
'version' => '1.0.0'
]));π Documentation
- Migration Guide: Complete migration instructions
- Framework Overview: Technical deep dive
- Release Notes: Detailed changelog
- Changelog: Full version history
π What's Next?
v2.1.0 Roadmap (Q2 2025)
- Pluggable Routing - Router injection via Application constructor
- Enhanced Validation - Built-in request validation
- Advanced Middleware - Response caching, compression
- Route Groups - Improved group handling
- Performance - Further optimizations
v2.x Vision
- Modern PHP 8.4 features
- Better developer tooling
- Interactive documentation
- Expanded ecosystem
- Community packages
π¬ Support
- Issues: GitHub Issues
- Discussions: Community Forum
PivotPHP v2.0.0 - Built with Simplicity in Mind π
"Simplicity through Elimination"