Skip to content

Remove Abandoned Laminas Packages and Suggest Alternatives #105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ coverage.json
bin
.php_cs.cache
.vscode/
build/logs/*
build/logs/*
.idea/
24 changes: 13 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,12 @@
}
],
"require": {
"php": "^8.2",
"laminas/laminas-db": "^2.20.0",
"laminas/laminas-diactoros": "^2.26",
"laminas/laminas-log": "^2.17.1",
"laminas/laminas-mail": "^2.25.1",
"laminas/laminas-psr7bridge": "^1.11",
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
"laminas/laminas-diactoros": "^2.26 || ^3.5.0",
"laminas/laminas-psr7bridge": "^1.12",
"laminas/laminas-uri": "^2.13",
"psr/container": "^1.1.2 || 2.0",
"psr/log": "^1.1 || ^2.0",
"samsonasik/array-lookup": "^2.0",
"seld/jsonlint": "^1.11",
"webmozart/assert": "^1.11"
Expand All @@ -57,26 +55,30 @@
},
"require-dev": {
"doctrine/dbal": "^3.9.3",
"doctrine/doctrine-orm-module": "^4.2.1 || ^5.3",
"doctrine/doctrine-orm-module": "^4.2.1 || ^5.3 || ^6.0",
"kahlan/kahlan": "^5.2.8",
"laminas/laminas-cli": "^1.11",
"laminas/laminas-coding-standard": "^2.5",
"laminas/laminas-coding-standard": "^3.0",
"laminas/laminas-form": "^2.16 || ^3.21",
"laminas/laminas-mvc": "^3.8",
"laminas/laminas-servicemanager": "^3.23",
"laminas/laminas-servicemanager": "^3.23 || ^4.0",
"mezzio/mezzio": "^3.20.1",
"mezzio/mezzio-laminasviewrenderer": "^2.16",
"monolog/monolog": "^3.9",
"php-coveralls/php-coveralls": "^2.7.0",
"phpstan/phpstan": "^2.0.4",
"phpstan/phpstan-webmozart-assert": "^2.0",
"pimple/pimple": "^3.5",
"rector/rector": "dev-main",
"symfony/dependency-injection": "^5.4.48"
"symfony/dependency-injection": "^5.4.48",
"symfony/mailer": "^7.2"
},
"suggest": {
"mezzio/mezzio-laminasviewrenderer": "^2.0 to be able to use laminas-view template engine in mezzio ^3.0",
"mezzio/mezzio-platesrenderer": "^2.0 to be able to use plates template engine in mezzio ^3.0",
"mezzio/mezzio-twigrenderer": "^2.0 to be able to use twig template engine in mezzio ^3.0"
"mezzio/mezzio-twigrenderer": "^2.0 to be able to use twig template engine in mezzio ^3.0",
"monolog/monolog": "Sends your logs to files, sockets, inboxes, databases and various web services",
"symfony/mailer": "Symfony's Mailer & Mime components form a powerful system for creating and sending emails"
},
"config": {
"bin-dir": "bin",
Expand Down
43 changes: 2 additions & 41 deletions config/error-hero-module.local.php.dist
Original file line number Diff line number Diff line change
@@ -1,45 +1,9 @@
<?php

use App\Exception\MyException;
use Laminas\Db\Adapter\AdapterInterface;

return [

'log' => [
'ErrorHeroModuleLogger' => [
'writers' => [

[
'name' => 'db',
'options' => [
'db' => AdapterInterface::class,
'table' => 'log',
'column' => [
'timestamp' => 'date',
'priority' => 'type',
'message' => 'event',
'extra' => [
'url' => 'url',
'file' => 'file',
'line' => 'line',
'error_type' => 'error_type',
'trace' => 'trace',
'request_data' => 'request_data',
],
],
'formatter' => [
'name' => 'db',
'options' => [
'dateTimeFormat' => 'Y-m-d H:i:s',
],
],
],
],

],
],
],

'error-hero-module' => [
// it's for the enable/disable the logger functionality
'enable' => true,
Expand Down Expand Up @@ -116,11 +80,8 @@ json
// set to true to activate email notification on log error
'enable' => false,

// Laminas\Mail\Message instance registered at service manager
'mail-message' => 'YourMailMessageService',

// Laminas\Mail\Transport\TransportInterface instance registered at service manager
'mail-transport' => 'YourMailTransportService',
// DSN for mailer
'mail-dsn' => 'smtp://localhost:25',

// email sender
'email-from' => 'Sender Name <[email protected]>',
Expand Down
58 changes: 10 additions & 48 deletions config/mezzio-error-hero-module.local.php.dist
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,19 @@
namespace ErrorHeroModule;

use App\Exception\MyException;
use Psr\Log\LoggerInterface;
use RuntimeException;
use Error;
use ErrorHeroModule\Command\BaseLoggingCommandInitializer;
use ErrorHeroModule\Compat\LoggerAbstractServiceFactory;
use ErrorHeroModule\Middleware\Mezzio;
use ErrorHeroModule\Middleware\MezzioFactory;
use ErrorHeroModule\ErrorHeroModule\Middleware\Routed\Preview\ErrorPreviewAction;
use ErrorHeroModule\Handler\Logging;
use ErrorHeroModule\Handler\LoggingFactory;
use ErrorHeroModule\Command\BaseLoggingCommand;
use ErrorHeroModule\Command\Preview\ErrorPreviewConsoleCommand;
use Laminas\Db\Adapter\AdapterInterface;
use Laminas\Log;
use Laminas\ServiceManager\Factory\InvokableFactory;

return [

'log' => [
'ErrorHeroModuleLogger' => [
'writers' => [

[
'name' => 'db',
'options' => [
'db' => AdapterInterface::class,
'table' => 'log',
'column' => [
'timestamp' => 'date',
'priority' => 'type',
'message' => 'event',
'extra' => [
'url' => 'url',
'file' => 'file',
'line' => 'line',
'error_type' => 'error_type',
'trace' => 'trace',
'request_data' => 'request_data',
],
],
'formatter' => [
'name' => 'db',
'options' => [
'dateTimeFormat' => 'Y-m-d H:i:s',
],
],
],
],

],
],
],

'error-hero-module' => [
// it's for the enable/disable the logger functionality
'enable' => true,
Expand Down Expand Up @@ -96,6 +57,11 @@ return [
'view' => 'error-hero-module::error-default'
],

// if enable and display_errors = 0, and on console env, the console will bring message for laminas-mvc
'console' => [
'message' => 'We have encountered a problem and we can not fulfill your request. An error report has been generated and sent to the support team and someone will attend to this problem urgently. Please try again later. Thank you for your patience.',
],

// for Mezzio, when container doesn't has \Mezzio\Template\TemplateRendererInterface service
// if enable, and display_errors = 0, then show a message under no_template config
'no_template' => [
Expand Down Expand Up @@ -132,11 +98,8 @@ json
// set to true to activate email notification on log error
'enable' => false,

// Laminas\Mail\Message instance registered at service manager
'mail-message' => 'YourMailMessageService',

// Laminas\Mail\Transport\TransportInterface instance registered at service manager
'mail-transport' => 'YourMailTransportService',
// DSN for mailer
'mail-dsn' => 'smtp://localhost:25',

// email sender
'email-from' => 'Sender Name <[email protected]>',
Expand All @@ -152,16 +115,15 @@ json
],

'dependencies' => [
'abstract_factories' => [
LoggerAbstractServiceFactory::class,
],
'factories' => [
Mezzio::class => MezzioFactory::class,
ErrorPreviewAction::class => InvokableFactory::class,

Logging::class => LoggingFactory::class,

ErrorPreviewConsoleCommand::class => InvokableFactory::class,

'ErrorHeroModuleLogger' => fn (): LoggerInterface => new \Monolog\Logger('error-hero-module'),
],
'initializers' => [
BaseLoggingCommandInitializer::class,
Expand Down
5 changes: 3 additions & 2 deletions config/module.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@

use ErrorHeroModule\Command\BaseLoggingCommandInitializer;
use ErrorHeroModule\Command\Preview\ErrorPreviewConsoleCommand;
use ErrorHeroModule\Compat\LoggerAbstractServiceFactory;
use ErrorHeroModule\Controller\ErrorPreviewController;
use ErrorHeroModule\Listener\Mvc;
use ErrorHeroModule\Listener\MvcFactory;
use ErrorHeroModule\Handler\Logging;
use ErrorHeroModule\Handler\LoggingFactory;
use Laminas\ServiceManager\Factory\InvokableFactory;
use Psr\Container\ContainerInterface;
use Psr\Log\LoggerInterface;

return [

Expand Down Expand Up @@ -39,12 +40,12 @@

'service_manager' => [
'abstract_factories' => [
LoggerAbstractServiceFactory::class,
],
'factories' => [
Mvc::class => MvcFactory::class,
Logging::class => LoggingFactory::class,
ErrorPreviewConsoleCommand::class => InvokableFactory::class,
'ErrorHeroModuleLogger' => fn (): LoggerInterface => new \Monolog\Logger('error-hero-module'),
],
'initializers' => [
BaseLoggingCommandInitializer::class,
Expand Down
Loading