-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from Jurj-Bogdan/3.0
Added Documentation
- Loading branch information
Showing
14 changed files
with
195 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name: "Continuous Integration" | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
tags: | ||
|
||
jobs: | ||
ci: | ||
uses: laminas/workflow-continuous-integration/.github/workflows/continuous-integration.yml@1.x |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: docs-build | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-deploy: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Build Docs | ||
uses: dotkernel/documentation-theme/github-actions/docs@main | ||
env: | ||
DEPLOY_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Security Policy | ||
|
||
## Supported Versions | ||
|
||
|
||
| Version | Supported | PHP Version | | ||
|---------|--------------------|-----------------------------------------------------------------------------------------------------------------------| | ||
| 3.x | :white_check_mark: | ![PHP from Packagist (specify version)](https://img.shields.io/packagist/php-v/dotkernel/dot-errorhandler/3.3.2) | | ||
| <= 2.x | :x: | | | ||
|
||
|
||
## Reporting Potential Security Issues | ||
|
||
If you have encountered a potential security vulnerability in this project, | ||
please report it to us at <security@dotkernel.com>. We will work with you to | ||
verify the vulnerability and patch it. | ||
|
||
When reporting issues, please provide the following information: | ||
|
||
- Component(s) affected | ||
- A description indicating how to reproduce the issue | ||
- A summary of the security vulnerability and impact | ||
|
||
We request that you contact us via the email address above and give the | ||
project contributors a chance to resolve the vulnerability and issue a new | ||
release prior to any public exposure; this helps protect the project's | ||
users, and provides them with a chance to upgrade and/or update in order to | ||
protect their applications. | ||
|
||
|
||
## Policy | ||
|
||
If we verify a reported security vulnerability, our policy is: | ||
|
||
- We will patch the current release branch, as well as the immediate prior minor | ||
release branch. | ||
|
||
- After patching the release branches, we will immediately issue new security | ||
fix releases for each patched release branch. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../README.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Configuration | ||
|
||
Register `dot-errorhandler` in you project by adding `Dot\ErrorHandler\ConfigProvider::class` to your configuration aggregator (to `config/config.php` for example), | ||
and add `\Dot\ErrorHandler\ErrorHandlerInterface::class` (to `config/pipeline.php` for example) **as the outermost layer of the middleware** to catch all Exceptions | ||
|
||
- Configure the error handler as shown below | ||
|
||
config/autoload/error-handling.global.php | ||
|
||
```php | ||
<?php | ||
|
||
use Dot\ErrorHandler\ErrorHandlerInterface; | ||
use Dot\ErrorHandler\LogErrorHandler; | ||
use Dot\ErrorHandler\ErrorHandler; | ||
|
||
return [ | ||
'dependencies' => [ | ||
'aliases' => [ | ||
ErrorHandlerInterface::class => LogErrorHandler::class, | ||
] | ||
|
||
], | ||
'dot-errorhandler' => [ | ||
'loggerEnabled' => true, | ||
'logger' => 'dot-log.default_logger' | ||
] | ||
]; | ||
``` | ||
|
||
A configuration example for the default logger can be found in `config/log.global.php.dist`. | ||
|
||
When declaring the `ErrorHandlerInterface` alias you can choose whether to log or not: | ||
|
||
- for the simple Zend Expressive handler user `ErrorHandler` | ||
- for logging use `LogErrorHandler` | ||
|
||
The class `Dot\ErrorHandler\ErrorHandler` is the same as the Zend Expressive error handling class | ||
the only difference being the removal of the `final` statement for making extension possible. | ||
|
||
The class `Dot\ErrorHandler\LogErrorHandler` is `Dot\ErrorHandler\ErrorHandler` with | ||
added logging support. | ||
|
||
As a note: both `LogErrorHandler` and `ErrorHandler` have factories declared in the | ||
package's `ConfigProvider`. If you need a custom ErrorHandler it must have a factory | ||
declared in the config, as in the example. | ||
|
||
Example: | ||
|
||
```php | ||
<?php | ||
|
||
use Dot\ErrorHandler\ErrorHandlerInterface; | ||
use Custom\MyErrorHandler; | ||
use Custom\MyErrorHandlerFactory; | ||
|
||
|
||
return [ | ||
'dependencies' => [ | ||
'factories' => [ | ||
MyErrorHandler::class => MyCustomHandlerFactory::class, | ||
], | ||
|
||
'aliases' => [ | ||
ErrorHandlerInterface::class => MyErrorHandler::class, | ||
] | ||
|
||
], | ||
'dot-errorhandler' => [ | ||
'loggerEnabled' => true, | ||
'logger' => 'dot-log.default_logger' | ||
] | ||
]; | ||
``` | ||
|
||
Config examples can be found in this project's `config` directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Installation | ||
|
||
Install `dotkernel/dot-errorhandler` by executing the following Composer command: | ||
|
||
composer require dotkernel/dot-errorhandler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Overview | ||
|
||
`dot-errorhandler` is DotKernel's logging error handler, providing two options: | ||
|
||
- `Dot\ErrorHandler\ErrorHandler`, same as the Zend Expressive error handling class with the only difference being the removal of the `final` statement for making extension possible | ||
- `Dot\ErrorHandler\LogErrorHandler` adds logging support to the default `ErrorHandler` class |
Oops, something went wrong.