2017 © Pedro Peláez
 

library maggott-module

Zend Framework 2 Module that provides exception handling functionality

image

zoopcommerce/maggott-module

Zend Framework 2 Module that provides exception handling functionality

  • Tuesday, December 30, 2014
  • by superdweebie
  • Repository
  • 2 Watchers
  • 0 Stars
  • 1,186 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Zoop maggott-module

Build Status, (*1)

A simple zend framework 2 module to return exceptions as json in accordance with the application/api-problem+json standard., (*2)

Install

Add the following to your composer root:, (*3)

"require": {
    "zoopcommerce/maggott-module" : "~1.1"
}

Add the module to your application config:, (*4)

'modules' => [
    'Zoop\MaggottModule'
],

Configuration

Any exceptions that you want returned as json need to be configured in the exception_map config key., (*5)

Eg:, (*6)

'zoop' => [
    'maggott' => [
        'exception_map' => [
            'Zoop\ShardModule\Exception\AccessControlException' => [
                'described_by' => 'access-control-exception',
                'title' => 'Access denied',
                'status_code' => 403,
                'extra_fields' => ['action'],
                'restricted_extra_fields' => ['documentClass']
            ]
        ]
    ],
]

The exception_map is an array of configured exceptions. The key for each item in the array must be the FQCN of the exception. All fields to configure an exception are optional. They are:, (*7)

described_by

If this field is supplied, the returned exception will have a described_by field which points to a resource where more information about the exception can be found in human readable format., (*8)

If using the described_by field, you should also create a view model template called zoop/maggott/<described_by> that hold the extra human readable inforamtion., (*9)

title

The title of the exception, (*10)

status_code

The http status code should the json response be set to. Defaults to 500, but also observes the status code in the response., (*11)

extra_fields

Other properties of the exception that should always be included in the json response., (*12)

restricted_extra_fields

Other properties of the exception that should only be included in the json response if displayExceptions is set to true., (*13)

The Versions

30/12 2014

dev-master

9999999-dev http://zoopcommerce.github.io/maggott-module

Zend Framework 2 Module that provides exception handling functionality

  Sources   Download

MIT

The Requires

 

The Development Requires

json zf2 doctrine exception shard

30/12 2014

1.1.3

1.1.3.0 http://zoopcommerce.github.io/maggott-module

Zend Framework 2 Module that provides exception handling functionality

  Sources   Download

MIT

The Requires

 

The Development Requires

json zf2 doctrine exception shard

24/12 2014

1.1.2

1.1.2.0 http://zoopcommerce.github.io/maggott-module

Zend Framework 2 Module that provides exception handling functionality

  Sources   Download

MIT

The Requires

 

The Development Requires

json zf2 doctrine exception shard

20/12 2014

1.1.1

1.1.1.0 http://zoopcommerce.github.io/maggott-module

Zend Framework 2 Module that provides exception handling functionality

  Sources   Download

MIT

The Requires

 

The Development Requires

json zf2 doctrine exception shard

28/08 2013

1.1

1.1.0.0 http://zoopcommerce.github.io/maggott-module

Zend Framework 2 Module that provides exception handling functionality

  Sources   Download

MIT

The Requires

 

The Development Requires

json zf2 doctrine exception shard

12/07 2013