Releases: brick/app
0.3.2
New feature
After compile()
has been run, AnnotationRouteCompiler::getRoutes()
returns an array of arrays containing:
- path :
string
- HTTP methods :
string[]
- controller class :
string
- controller method :
string
This can be used to print a human-readable list of routes.
0.3.1
0.3.0
New features
- Support for HTTP methods in
@Route
annotations - Support for custom regexp patterns in
@Route
annotations
Breaking changes
- The structure of the arrays returned by
AnnotationRouteCompiler
, and used byAnnotationRoute
, has changed;AnnotationRouteCompiler::compile()
must be run again - The "options" attribute in
@QueryParam
and@PostParam
annotations has been removed - Annotations are now final and use a new, stricter validation method; they now throw a
LogicException
instead of aRuntimeException
on error
0.2.2
New methods
RouteMatch::withClassParameters()
RouteMatch::withFunctionParameters()
These methods allow to create a copy of a RouteMatch
, with additional class/function parameters.
New annotation-based routing
Workflow:
- Add
@Route
annotations to controllers - Compile routes using
AnnotationRouteCompiler
- Cache the compiled routes and use them as input to
AnnotationRoute
Controllers support @Route
annotations on both classes & methods. @Route
annotations on classes are used as a prefix for @Route
annotations on methods.
Controllers support parameters, such as @Route("/book/{id}")
.
Parameters from @Route
on the controller class will be passed as parameters to the class constructor, and parameters from @Route
on the controller method will be passed as parameters to the method itself.
0.2.1
0.2.0
New feature: support for IP sessions.
Breaking changes:
Session
is nowCookieSession
Session::setGcProbability()
now returnsvoid
Session::setLifetime()
now returnsvoid
Session::clear()
now returnsvoid
CookieSession::setCookieParams()
now returnsvoid
CookieSession::setIdLength()
now returnsvoid
CookieSession::regenerateId()
now returnsbool
: whether or not the storage supports ID regeneration