Skip to content

Commit eaf6239

Browse files
feat: Add quick quality check and pre-release validation scripts
- Introduced `quick-quality-check.sh` for rapid validation of PivotPHP Core v1.1.4, including PHPStan analysis, PSR-12 compliance checks, syntax validation for examples, performance testing, and basic loading checks. - Added `simple_pre_release.sh` to streamline the pre-release validation process, ensuring essential files exist, validating example syntax, checking autoloader, and running basic benchmarks. - Created `validate_all_v114.sh` to execute all validation scripts sequentially, providing a comprehensive overview of the project's health and readiness for release. - Enhanced error handling with `ContextualException` for better debugging and context in error messages. - Implemented `CallableResolver` utility to handle various callable types, improving route handler validation in the router. - Updated core application logic to utilize the new `CallableResolver` for improved error handling and route management. - Added intelligent JSON pooling logic in `JsonBufferPool` to optimize JSON encoding based on data characteristics. - Refactored cache classes to improve code readability and maintainability.
1 parent 675be35 commit eaf6239

40 files changed

Lines changed: 8382 additions & 110 deletions

.gitignore

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ dist/
146146
config.local.php
147147

148148
# ==============================================
149-
# Express PHP Specific
149+
# PivotPHP Specific
150150
# ==============================================
151151
# Upload directories
152152
uploads/
@@ -155,7 +155,7 @@ storage/
155155

156156
# Cache directories
157157
cache/
158-
/tmp/express_cache/
158+
/tmp/pivotphp_cache/
159159

160160
# Logs
161161
logs/
@@ -220,12 +220,29 @@ yarn.lock
220220
*.7z
221221

222222
# ==============================================
223-
# Express PHP Examples - Keep tracked but ignore user modifications
223+
# PivotPHP Examples - Keep tracked but ignore user modifications
224224
# ==============================================
225225
# Uncomment the following if you want to ignore user modifications to examples
226226
# examples/user_*
227227
# examples/custom_*
228228

229+
# Test files for v1.1.4+ examples
230+
test_*.php
231+
test_old_examples_*.php
232+
COMPATIBILIDADE_*.md
233+
234+
# Development fixes and improvements
235+
fixes/
236+
237+
# Temporary development files and reports
238+
test_*.php
239+
validate_examples_structure.php
240+
final_example_test.php
241+
*TESTE*
242+
*RELATORIO*
243+
*COMPATIBILITY*
244+
*COMPATIBILIDADE*
245+
229246
# ==============================================
230247
# Issues and Project Management
231248
# ==============================================
@@ -259,5 +276,5 @@ TODO.md
259276
NOTES.md
260277
scratch/
261278
benchmarks/**/*.json
262-
CLAUDE.md
279+
# CLAUDE.md # Comentado para manter CLAUDE.md no repo
263280
proposals/

CHANGELOG.md

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,110 @@ All notable changes to the PivotPHP Framework will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [1.1.4] - 2025-07-13
9+
10+
### 🎯 **Developer Experience & Examples Modernization Edition**
11+
12+
> **Complete Examples Modernization**: Comprehensive update of all examples with v1.1.4+ features including native array callables, intelligent JsonBufferPool threshold system, enhanced error diagnostics with ContextualException, and organized controller architecture while maintaining 100% backward compatibility.
13+
14+
#### 🌟 **New v1.1.4+ Example Suite**
15+
- **8 Modern Examples Created**: Complete demonstration of v1.1.4+ features
16+
- `rest-api-v114.php`: RESTful API with array callables and JsonBufferPool
17+
- `rest-api-modernized-v114.php`: Enhanced API with performance monitoring
18+
- `array-callables-v114.php`: Comprehensive array callable demonstration
19+
- `json-pool-demo-v114.php`: JsonBufferPool optimization showcase
20+
- `enhanced-errors-v114.php`: ContextualException error handling demo
21+
- `route-parameters-v114.php`: Advanced parameter handling with validation
22+
- `custom-middleware-v114.php`: Organized middleware with array callables
23+
- `hello-world.php`: Updated with v1.1.4+ features
24+
25+
#### 🎯 **Array Callables Implementation**
26+
- **Native Controller Support**: Full implementation of `[Controller::class, 'method']` syntax
27+
- **CallableResolver Utility**: Robust validation and resolution of array callables
28+
- **Enhanced Validation**: Automatic detection of public/private method accessibility
29+
- **IDE Support**: Full autocomplete and refactoring capabilities
30+
- **Performance Optimized**: Zero runtime overhead after initial validation
31+
- **Error Diagnostics**: ContextualException integration for invalid callables
32+
33+
#### 🚀 **JsonBufferPool Intelligence**
34+
- **Intelligent Threshold System**: Automatic optimization based on 256-byte threshold
35+
- **Small Data**: Direct `json_encode()` for minimal overhead (< 256 bytes)
36+
- **Large Data**: Buffer pooling for optimization (≥ 256 bytes)
37+
- **Zero Configuration**: Optimal performance out-of-the-box
38+
- **Real-time Monitoring**: `getStatistics()` for performance tracking
39+
- **Production Ready**: Validated threshold for maximum efficiency
40+
41+
#### 🔍 **Enhanced Error Diagnostics**
42+
- **ContextualException System**: Advanced error handling with detailed context
43+
- **Contextual Information**: Rich error context with relevant details
44+
- **Actionable Suggestions**: Built-in resolution guidance for developers
45+
- **Error Categorization**: Automatic classification (ROUTING, PARAMETER, VALIDATION, etc.)
46+
- **Development vs Production**: Environment-aware error detail levels
47+
- **Request Tracking**: Unique error IDs for debugging and monitoring
48+
49+
#### 🏗️ **Organized Architecture**
50+
- **Controller Organization**: Modern controller structure with dependency injection
51+
- **Separated Concerns**: Logical separation of controllers, middleware, and utilities
52+
- **Namespace Organization**: Clean `use` statements and imports
53+
- **Dependency Injection**: Constructor-based DI patterns demonstrated
54+
- **Service Provider Pattern**: Enhanced integration with framework services
55+
56+
#### 🔄 **Backward Compatibility**
57+
- **100% Compatibility Maintained**: All existing examples continue to function
58+
- **Path Corrections**: Fixed autoloader paths in existing examples
59+
- **Zero Breaking Changes**: No functionality removed or modified
60+
- **Gradual Migration**: Optional transition to v1.1.4+ features
61+
- **Parallel Versions**: Old and new examples coexist peacefully
62+
63+
#### 📋 **Composer Scripts Enhancement**
64+
- **8 New Example Scripts**: Easy execution of v1.1.4+ examples
65+
```bash
66+
composer examples:v114:hello-world
67+
composer examples:v114:rest-api
68+
composer examples:v114:array-callables
69+
composer examples:v114:json-optimization
70+
composer examples:v114:enhanced-errors
71+
composer examples:v114:route-parameters
72+
composer examples:v114:middleware
73+
```
74+
75+
#### 🧪 **Comprehensive Testing**
76+
- **100% Example Validation**: All examples tested for syntax and functionality
77+
- **Syntax Testing**: `php -l` validation for all examples
78+
- **Runtime Testing**: Autoloader and dependency validation
79+
- **HTTP Testing**: Server startup and response validation
80+
- **Feature Detection**: v1.1.4+ feature presence verification
81+
- **Compatibility Testing**: Backward compatibility confirmation
82+
83+
#### 📚 **Documentation Updates**
84+
- **Enhanced CLAUDE.md**: Updated project instructions with v1.1.4+ features
85+
- **Migration Guides**: Comprehensive migration documentation
86+
- **Performance Guides**: JsonBufferPool optimization instructions
87+
- **Error Handling Guides**: ContextualException usage patterns
88+
- **Example Documentation**: Detailed example descriptions and usage
89+
90+
#### 🎉 **Developer Experience Improvements**
91+
- **Modern Development Patterns**: Demonstrates current PHP best practices
92+
- **Type Safety**: Enhanced type declarations and validation
93+
- **Error Handling**: Contextual error messages with suggestions
94+
- **Performance Awareness**: Built-in optimization indicators
95+
- **Code Organization**: Modern PSR standards implementation
96+
- **IDE Integration**: Enhanced development environment support
97+
98+
### 🔧 **Technical Improvements**
99+
- **Enhanced Middleware Architecture**: Organized middleware classes with static methods
100+
- **Improved Error Context**: Detailed error information for faster debugging
101+
- **Performance Monitoring**: Real-time performance metrics and optimization status
102+
- **Configuration Examples**: Production-ready configuration patterns
103+
- **Testing Patterns**: Modern testing approaches and utilities
104+
105+
### 📈 **Impact & Benefits**
106+
- **Learning Curve**: Reduced complexity for new developers
107+
- **Development Speed**: Faster development with enhanced IDE support
108+
- **Production Readiness**: Battle-tested patterns and optimizations
109+
- **Migration Path**: Clear upgrade path from older patterns
110+
- **Community**: Enhanced examples for documentation and learning
111+
8112
## [1.1.3] - 2025-07-12
9113

10114
### 🚀 **Performance Optimization & Architectural Excellence Edition**

0 commit comments

Comments
 (0)