Releases: devsimsek/project-sdf
Releases · devsimsek/project-sdf
Release list
v2.1.0
Release v2.1.0
Summary
- Replace abrupt process termination (die/exit) in core with structured exceptions and centralized handling.
- Added HttpResponseException and HeadersSendException for HTTP error semantics.
- Added top-level ExceptionHandler to log uncaught exceptions and produce safe minimal 5xx responses.
- Response::sendHeaders() now logs errors and throws exceptions instead of exiting; added a headersAlreadySent() hook for testability.
- Replaced exit/die in core loader and Spark::connect with logging + exceptions (class load/instantiation failures now map to 503 Service Unavailable).
- Added and updated tests covering the new error paths; guarded Reflection usage for PHP 8.1+.
Migration notes
- The framework no longer terminates the process on certain fatal errors; code that relied on immediate exit should catch the new exceptions where appropriate. Class load/instantiation failures now throw an HttpResponseException with HTTP 503.
- Ensure any custom global error handlers are compatible with exceptions. The project registers a default exception handler that logs and returns a minimal 5xx response.
Testing
- Unit test suite passes locally (48 tests, 104 assertions). Please run CI to validate in your environment.
Files changed (high level)
- sdf/core/Exceptions.php (new)
- sdf/core/ExceptionHandler.php (new)
- sdf/core/Response.php (updated)
- sdf/core/Core.php (updated)
- sdf/core/Spark.php (updated)
- tests/ResponseExceptionTest.php (new)
- tests/* (updated for Reflection compatibility)