Skip to content

Commit

Permalink
Migrate Zend to Laminas, Expressive to Mezzio
Browse files Browse the repository at this point in the history
  • Loading branch information
costin committed Jan 30, 2020
1 parent d3cc9b3 commit f7d05db
Show file tree
Hide file tree
Showing 9 changed files with 91 additions and 39 deletions.
33 changes: 33 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,34 @@
# Created by .ignore support plugin (hsz.mobi)
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

# User-specific stuff:
.idea

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
/out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
### Composer template
composer.phar
/vendor/

# Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
composer.lock
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
## 2.0.0 - 2020-01-30

### Changed
* Laminas and Mezzio migration.

### Added
* Nothing

### Deprecated
* Nothing

### Removed
* Support

### Fixed
* Nothing


## 1.0.1 - 2018-11-27

Corrected factory and config provider.
Expand Down
47 changes: 24 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
{
"name": "dotkernel/dot-errorhandler",
"description": "Logging Error Handler for Middleware Applications",
"type": "library",
"require": {
"zendframework/zend-expressive": "^3.0",
"zendframework/zend-log": "^2.10",
"dotkernel/dot-log": "^1.0",
"psr/http-message": "^1.0",
"psr/container": "^1.0"
},
"license": "MIT",
"authors": [
{
"name": "DotKernel Team",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"Dot\\ErrorHandler\\": "src/"
}
},
"minimum-stability": "stable"
"name": "dotkernel/dot-errorhandler",
"description": "Logging Error Handler for Middleware Applications",
"type": "library",
"require": {
"mezzio/mezzio": "^3.0",
"laminas/laminas-log": "^2.10",
"dotkernel/dot-log": "^2.0",
"psr/http-message": "^1.0",
"psr/container": "^1.0",
"laminas/laminas-dependency-plugin": "^1.0"
},
"license": "MIT",
"authors": [
{
"name": "DotKernel Team",
"email": "[email protected]"
}
],
"autoload": {
"psr-4": {
"Dot\\ErrorHandler\\": "src/"
}
},
"minimum-stability": "stable"
}
6 changes: 3 additions & 3 deletions config/log.global.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ return [
'writers' => [
'FileWriter' => [
'name' => 'stream',
'priority' => \Zend\Log\Logger::ALERT,
'priority' => \Laminas\Log\Logger::ALERT,
'options' => [
'stream' => __DIR__.'/../../data/logs/dk-'.date('Y-m-d').'.log',
// explicitly log all messages
Expand All @@ -16,12 +16,12 @@ return [
'name' => 'priority',
'options' => [
'operator' => '>=',
'priority' => \Zend\Log\Logger::EMERG,
'priority' => \Laminas\Log\Logger::EMERG,
],
],
],
'formatter' => [
'name' => \Zend\Log\Formatter\Json::class,
'name' => \Laminas\Log\Formatter\Json::class,
],
],
],
Expand Down
4 changes: 2 additions & 2 deletions src/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Throwable;
use Zend\Stratigility\Exception\MissingResponseException;
use Laminas\Stratigility\Exception\MissingResponseException;

use function error_reporting;
use function in_array;
Expand Down Expand Up @@ -43,7 +43,7 @@
* itself, and can be used as the basis for returning an error response.
*
* An error response generator must be provided as a constructor argument;
* if not provided, an instance of Zend\Stratigility\Middleware\ErrorResponseGenerator
* if not provided, an instance of Laminas\Stratigility\Middleware\ErrorResponseGenerator
* will be used.
*
* Listeners use the following signature:
Expand Down
6 changes: 3 additions & 3 deletions src/ErrorHandlerFactory.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php
/**
* @see https://github.com/zendframework/zend-expressive for the canonical source repository
* @see https://github.com/mezzio/mezzio for the canonical source repository
* @copyright Copyright (c) 2016-2017 Zend Technologies USA Inc. (https://www.zend.com)
* @license https://github.com/zendframework/zend-expressive/blob/master/LICENSE.md New BSD License
* @license https://github.com/mezzio/mezzio/blob/master/LICENSE.md New BSD License
*/

declare(strict_types=1);
Expand All @@ -11,7 +11,7 @@

use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Zend\Expressive\Middleware\ErrorResponseGenerator;
use Mezzio\Middleware\ErrorResponseGenerator;
// use Dot\ErrorHandler\ErrorHandler;

class ErrorHandlerFactory
Expand Down
4 changes: 2 additions & 2 deletions src/ErrorHandlerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Throwable;
use Zend\Stratigility\Exception\MissingResponseException;
use Laminas\Stratigility\Exception\MissingResponseException;

use function error_reporting;
use function in_array;
Expand Down Expand Up @@ -43,7 +43,7 @@
* itself, and can be used as the basis for returning an error response.
*
* An error response generator must be provided as a constructor argument;
* if not provided, an instance of Zend\Stratigility\Middleware\ErrorResponseGenerator
* if not provided, an instance of Laminas\Stratigility\Middleware\ErrorResponseGenerator
* will be used.
*
* Listeners use the following signature:
Expand Down
8 changes: 4 additions & 4 deletions src/LogErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
use Psr\Http\Server\MiddlewareInterface;
use Psr\Http\Server\RequestHandlerInterface;
use Throwable;
use Zend\Log\Logger;
use Zend\Log\LoggerInterface;
use Zend\Stratigility\Exception\MissingResponseException;
use Laminas\Log\Logger;
use Laminas\Log\LoggerInterface;
use Laminas\Stratigility\Exception\MissingResponseException;

use function error_reporting;
use function in_array;
Expand Down Expand Up @@ -45,7 +45,7 @@
* itself, and can be used as the basis for returning an error response.
*
* An error response generator must be provided as a constructor argument;
* if not provided, an instance of Zend\Stratigility\Middleware\ErrorResponseGenerator
* if not provided, an instance of Laminas\Stratigility\Middleware\ErrorResponseGenerator
* will be used.
*
* Listeners use the following signature:
Expand Down
4 changes: 2 additions & 2 deletions src/LogErrorHandlerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Server\MiddlewareInterface;
use Zend\Expressive\Middleware\ErrorResponseGenerator;
use Zend\Log\LoggerInterface;
use Mezzio\Middleware\ErrorResponseGenerator;
use Laminas\Log\LoggerInterface;

class LogErrorHandlerFactory
{
Expand Down

0 comments on commit f7d05db

Please sign in to comment.