Releases: brokencube/circuit
Service Containers
Some clean up of the internals of circuit to reduce number of attributes added to the Request. All modifiable information about the controller (class, method, args) now sit in a simple value object in the request attributes - $request->attributes->get('controller')
.
Also, instead of passing arbitrary controller arguments, have standardised on PSR-11 containers and there for have changed the $router->setControllerArguments([$arg, $arg2, ...])
function to $router->setServiceContainer($container)
ErrorLogger bugfix
Changing getTrace to getTraceAsString for better compatibility.
ErrorLogger middleware
Added a new ErrorLogger middleware for pushing exceptions into a given log
Minor update to Exception Handling
With the remove of the $context
from exception handling, I've moved the catch block much further down the stack to the $router->run()
function. This allows middleware based exception handlers (e.g. Whoops) to work as expected, and Circuit's error handling to be used as a backup.
Minor fix to allow exceptions without messages
1.2.2 Default blank exception message
Some minor code cleanup - no functional changes
1.2.1 New CacheWrapper object to merge PSr6/16 cache routes
Added Logging support
Minor breaking change:
$router->setPrerouteMiddleware
is now $router->addPrerouteMiddleware
Minor bugfix release
1.1.1 Minor style cleanup and minor bug fix from CodeClimate
Major updates
New features in release:
- Expanded Middleware variable access - Middleware now has access to the following via
$request->attributes
:- Controller name/method
- Controller constructor arguments
- Matched route arguments
- Pre-routing middleware
- Ability to register middleware by name (allowing middleware to be constructed per request, instead of having to be serialised into the cache)
- Exception handlers to allow custom pages/responses to generated HTTP code responses
- Various Bugfixes
- Better PHPDocs on main classes
Controller __construct($parameters)
Added ability to pass parameters to the Controller constructors.