Releases: flusio/Minz
Releases · flusio/Minz
Minz 2.3.2
Minz 2.3.1
Minz 2.3.0
Tests
- Don't reset database in InitializerHelper (a9c3ae2)
Minz 2.2.1
Bug fixes
- Support query and fragment parts in
Router::isRedirectable(a72d2ec)
Minz 2.2.0
Minz 2.1.0
2.0.3
Minz 2.0.2
Minz 2.0.1
Minz 2.0.0
Breaking changes
This is a big release.
Here are listed all the changes in a comprehensive way.
Take your time to upgrade!
The Request class has been refactored:
- Parameters must be retrieved with the
$request->parameters->get*()methods. - Headers must be retrieved with the
$request->headers->get*()methods. - Cookies must be retrieved with the
$request->cookied->get*()methods. - The server information must be retrieved with the
$request->server->get*()methods. - The headers are now set using the
getallheaders()PHP function inRequest::initFromGlobals(). For instance,HTTP_CONTENT_TYPEmust now be fetched using theContent-Typekey.
The Router class has been refactored:
- routes all have a name. If it's not specified, the name defaults to the action value.
- incidentally, the
uriByPointer()has been removed since it's now useless. - the
routes()method returns the list of Routes with all the information (name, method, pattern and action) match()now returns a Route and no longer returns an_action_pointerparameter.- incidentally,
Requestno longer has an_action_pointerparameter. It has been replaced by theroute()method which returns more information.
The Form and Validable classes have been extensively redesigned so they work better together.
Form now uses the Validable trait so the validate method is provided by the latter.
However, this broke how the Validable trait worked previously.
Changes of the Validable trait:
validate()now returns a boolean telling if the object is valid or not;- an
$errorsproperty is added and can be queried with the newisInvalid(),errors(),error()andaddError()methods (meaning that if you were using one of them in aValidablemodel, things will break); - the
$errorscodes changed to remove the\Minz\Validable\namespace and to change the case to snake_case.
Changes of the Check attributes:
- the old
Validable\Checktrait has been renamed toValidable\PropertyCheck - the new
Validable\Checkcorresponds to the oldForm\Checktrait - the PropertyCheck methods changed:
getValue()tovalue(),getMessage()tomessage()and a newcode()method appears
Changes of the Form class:
- the methods changed:
hasError()toisInvalid(),getError()toerror()andgetModel()tomodel() - the
@globalerror namespace has been changed to@base.
Changes of the Field attribute:
- a
transformargument has been added to the constructor, taking a callable string - the
trimargument has been removed, you must change it bytransform: 'trim' - the
bind_modelargument has been renamed tobind
The CSRF protections have also largely step up:
- the
Csrfclass have been rewritten and moved toForm\CsrfToken, it is discouraged to use it alone - the
Form\Csrftrait now checks for theOrigin(orReferer) of the request - the
Form\Csrftrait provides more methods:rememberCsrfOrigin,csrfToken,csrfSessionIdandcsrfTokenName - the
Form\Csrftrait error namespace is now@baseinstead of@global, and code iscsrfinstead of the full class name
The View templating system has also been reworked in order to allow to use Twig templates.
There are several consequences to this:
- The
Output\Viewclass has been renamed toOutput\Templateand the code related to the templating system has been extracted intoTemplate\Simple - The
ViewHelpersclass has been renamed toTemplate\SimpleTemplateHelpers - The
view_helpers.phpfile has been moved toTemplate\simple_template_helpers.php - The
ResponseAsserts::assertResponsePointerassertion has been renamed toassertResponseTemplateName - The parameters refering to
pointerandvariableshave been renamed tonameandcontext - The Engine options
not_found_view_pointerandinternal_server_error_view_pointerhave been renamed tonot_found_templateandinternal_server_error_template - The
ViewPointerandViewVariablesPHPStan types have been moved toTemplate\TemplateInterfaceand renamed toViewNameandViewContext - If the template name ends with
.twig, the output will use Twig templating system to render the view.
New
- Add Twig as a new template system (ce1f441)
- Add
BeforeActionandAfterActioncontroller handlers (541aeef) - Allow
OPTIONSas Request method (31b4fac)
Bug fixes
- Fix the default
Form\Fielddatetime format (24532aa)
Improvements
- Redesign Request parameters, headers and cookies (78e43fb)
- Redesign the Form and the Validable classes (d076330, 7634289, 1b093ff, 27f78cf, 306711d)
- Redesign the CSRF protections (4925599)
- Redesign the Router class (d0cc0b6, 4e03104)
- Initialize Request headers with
getallheaders()(99aefb8)