Skip to content

v0.6

Compare
Choose a tag to compare
@Articus Articus released this 04 Oct 22:21
· 21 commits to master since this release

New features

  • rename of consumer annotation property (media type -> media range)
  • migration from Zend to Laminas packages due to global brand change:
    • zendframework/zend-expressive -> mezzio/mezzio
    • zendframework/zend-servicemanager -> laminas/laminas-servicemanager
    • zendframework/zend-stdlib -> laminas/laminas-stdlib
  • library no longer depends from zendframework/zend-http
  • metadata and default router caching mechanism overhaul:
    • library no longer relies directly on zendframework/zend-cache, you may use any implementation of psr/simple-cache you like
    • simple partial PSR-16 implementation optimized for metadata storage and default router cache is provided out-of-the-box
  • it is now possible to specify custom object instanciator in Transfer attribute options

Migration notes

Sadly migration might be a bit cumbersome because you have to apply quite a lot small technical changes.

Update your consumer annotations

You need to rename mediaType parameter to mediaRange wherever you use Articus\PathHandler\Annotation\Consumer annotation.

Migrate to Laminas

More or less it is just a namespace change both in your code and in your configuration. Check official guide for useful tips.

Check metadata cache configuration for production environment

Previously simple file caching for metadata required two extra dependencies ( zendframework/zend-cache and zendframework/zend-serializer) and quite lengthy configuration:

Articus\PathHandler\RouteInjection\Factory:
  metadata:
    cache:
      adapter: filesystem
      options:
        cache_dir: data/PathHandler
        namespace: ph-metadata
      plugins:
        serializer:
          serializer: phpserialize

Articus\PathHandler\RouteInjection\Factory:
  router:
    cache:
      adapter: filesystem
      options:
        cache_dir: data/PathHandler
        namespace: ph-router
      plugins:
        serializer:
          serializer: phpserialize

Now it requires only one extra dependency psr/simple-cache and tiny configuration:

Articus\PathHandler\RouteInjection\Factory:
  metadata:
    cache:
      directory: data/PathHandler

Articus\PathHandler\RouteInjection\Factory:
  router:
    cache:
      directory: data/PathHandler

If you use separate caching service no configuration changes should be needed.