Skip to content

Releases: flusio/Minz

Minz 2.3.2

09 Mar 10:22
2.3.2
26784b0

Choose a tag to compare

Maintenance

  • Update the dependencies (70180ce)
  • Update the copyright year in file headers (2930e92)

Minz 2.3.1

21 Jan 16:16
2.3.1
b72cb16

Choose a tag to compare

Features

  • Make sure to not add Twig extensions multiple times (0b4dd3a)

Bug fixes

  • Reset Twig instance during tests (fe0f648)
  • Handle wrong parameter type in Resource methods (4011e92)

Maintenance

Minz 2.3.0

25 Nov 17:06
2.3.0
9eef26f

Choose a tag to compare

Tests

  • Don't reset database in InitializerHelper (a9c3ae2)

Minz 2.2.1

14 Nov 16:52
2.2.1
cd0c2f6

Choose a tag to compare

Bug fixes

  • Support query and fragment parts in Router::isRedirectable (a72d2ec)

Minz 2.2.0

11 Nov 15:53
2.2.0
0ce62ca

Choose a tag to compare

Features

  • Allow Minz File as part of Forms (d090bf4)
  • Add a Validable\File class to validate File attributes (bacb6dc)
  • Add more methods to the File class (10f9533)
  • Add a Recordable::requireBy method (d5717b2)

Minz 2.1.0

31 Oct 16:49
2.1.0
f5f3344

Choose a tag to compare

Features

  • Add a Database\Resource trait (5cc1b36)
  • Add a Recordable::require method (3fb2c4e)
  • Add a Router::isRedirectable method (5e49da2)
  • Add a Response::forbidden method (c333f97)
  • Allow to pass options to Forms (a666245)

Improvements

  • Always return a router in Engine::router (8f603bc)

Technical

  • Upgrade to PHPMailer 7.0 (eafda35)
  • Update the dependencies (f535a5f)

2.0.3

15 Oct 14:14
2.0.3
1d50585

Choose a tag to compare

Technical

  • Update the dependencies (83cc9a5, d135073)
  • Ignore exporting some folders/files on git archive (4d9967d)
  • Adapt assertEmailContainsReplyTo for PHPMailer 6.11 (8d71917)

Minz 2.0.2

23 Aug 14:02
2.0.2
b2154dc

Choose a tag to compare

Improvements

  • Allow to pass parameters via the appRun URI (6d48add)

Technical

Minz 2.0.1

29 May 16:17
2.0.1
3eb6db5

Choose a tag to compare

Improvements

  • Set default Origin in ApplicationHelper::appRun (5e8f60c)
  • Provide a CsrfHelper to generate CSRF tokens during tests (31f5489)
  • Change the visibility of Csrf methods to public (31bad4a)

Bug fixes

  • Allow to declare cookies and server information in ApplicationHelper::appRun (3f7345a)

Minz 2.0.0

28 May 18:56
2.0.0
a7ce04a

Choose a tag to compare

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 in Request::initFromGlobals(). For instance, HTTP_CONTENT_TYPE must now be fetched using the Content-Type key.

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_pointer parameter.
  • incidentally, Request no longer has an _action_pointer parameter. It has been replaced by the route() 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 $errors property is added and can be queried with the new isInvalid(), errors(), error() and addError() methods (meaning that if you were using one of them in a Validable model, things will break);
  • the $errors codes changed to remove the \Minz\Validable\ namespace and to change the case to snake_case.

Changes of the Check attributes:

  • the old Validable\Check trait has been renamed to Validable\PropertyCheck
  • the new Validable\Check corresponds to the old Form\Check trait
  • the PropertyCheck methods changed: getValue() to value(), getMessage() to message() and a new code() method appears

Changes of the Form class:

  • the methods changed: hasError() to isInvalid(), getError() to error() and getModel() to model()
  • the @global error namespace has been changed to @base.

Changes of the Field attribute:

  • a transform argument has been added to the constructor, taking a callable string
  • the trim argument has been removed, you must change it by transform: 'trim'
  • the bind_model argument has been renamed to bind

The CSRF protections have also largely step up:

  • the Csrf class have been rewritten and moved to Form\CsrfToken, it is discouraged to use it alone
  • the Form\Csrf trait now checks for the Origin (or Referer) of the request
  • the Form\Csrf trait provides more methods: rememberCsrfOrigin, csrfToken, csrfSessionId and csrfTokenName
  • the Form\Csrf trait error namespace is now @base instead of @global, and code is csrf instead 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\View class has been renamed to Output\Template and the code related to the templating system has been extracted into Template\Simple
  • The ViewHelpers class has been renamed to Template\SimpleTemplateHelpers
  • The view_helpers.php file has been moved to Template\simple_template_helpers.php
  • The ResponseAsserts::assertResponsePointer assertion has been renamed to assertResponseTemplateName
  • The parameters refering to pointer and variables have been renamed to name and context
  • The Engine options not_found_view_pointer and internal_server_error_view_pointer have been renamed to not_found_template and internal_server_error_template
  • The ViewPointer and ViewVariables PHPStan types have been moved to Template\TemplateInterface and renamed to ViewName and ViewContext
  • 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 BeforeAction and AfterAction controller handlers (541aeef)
  • Allow OPTIONS as Request method (31b4fac)

Bug fixes

  • Fix the default Form\Field datetime format (24532aa)

Improvements

Technical