Skip to content

primo 0.3.0

Compare
Choose a tag to compare
@gsteel gsteel released this 17 Jun 15:11
· 471 commits to 1.6.x since this release
0.3.0
8f851ba

Added

  • Added middleware that sets a Cache-Control header in the response to 'no-cache' when preview mode is active.
  • Added middleware that will expire the preview cookie when the request has an attribute for \Prismic\Exception\PreviewTokenExpired. This optional middleware should be placed after the preview handler to kill dead cookies and redirect when a preview token has expired.
  • Added \Primo\Exception\RoutingError to describe errors specific to routing configuration
  • Methods to the RouteMatcher to find routes that are specific to a particular tag.

Changed

  • The document resolver middleware now adds a Last-Modified header to the response using the resolved document's last publication date.
  • Renamed the PrismicTemplateHandler to PrismicTemplate. It is now middleware rather than a request handler and only returns a response when a document has been successfully resolved, otherwise, it delegates to the next handler. This is a better way of dealing with CMS 404's whilst preserving the default behaviour of the Mezzio NotFoundHandler.
  • Removed automatic registration of routes and renamed the PipelineAndRoutesDelegator to RouteProvider. Now, consumers will need to add (new RouteProvider())($application, $container); to their route configuration file.
  • Improved handling of invalid preview tokens so that junk is ignored, passing through to the next middleware (Likely a 404)
  • Improved handling of expired preview tokens so that these pass through with a modified request with an attribute containing the expiry exception from the api.
  • Improved error message for a mapped type when the target class does not exist
  • The document resolver helper will throw exceptions when route configuration breaks certain rules
  • You can now route on type alone, i.e. Prismic singletons.
  • You can now write more specific routes with the same document type in multiple routes by specifying a tag.
  • Removed LIFO parameter to RouteMatcher constructor that was unused and poorly conceived.

Deprecated

  • Nothing.

Removed

  • Nothing.

Fixed

  • Nothing.