Skip to content

Commit 737cc3b

Browse files
author
costin
committed
Migrate Zend to Laminas, Expressive to Mezzio
1 parent 5a67877 commit 737cc3b

12 files changed

Lines changed: 69 additions & 52 deletions

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
## 2.0.0 - 2020-01-30
2+
3+
### Changed
4+
* Laminas and Mezzio migration.
5+
6+
### Added
7+
* Nothing
8+
9+
### Deprecated
10+
* Nothing
11+
12+
### Removed
13+
* Support
14+
15+
### Fixed
16+
* Nothing
17+
18+
119
## 1.0.0 - 2018-04-11
220
* [BC break] replaced delegate with handler
321

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Then register this controller as a routed middleware in file `routes.php` just l
4747

4848
Use case: You have defined a controller inside some package, with default actions. You want to add actions that fall into the same controller name(or route name more exactly). You want to do this without extending the controller provided by the package. In this case you can do the following
4949
- create your own controller, independent of the package's controller which adds more actions
50-
- Zend Expressive lets you define an array of middleware for a route, so you can register this controller before the package's controller
50+
- Mezzio lets you define an array of middleware for a route, so you can register this controller before the package's controller
5151

5252
Now when a request for this route comes in, your controller will run first. DotKernel controllers are designed to ignore requests that cannot be matched to one of its methods, so if no action matches, it will call the next middleware, in our case, the second controller.
5353
If this is the last controller, and action does not match here, it will go to the default 404 Not found page(handled by NotFoundDelegate)

composer.json

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,41 @@
11
{
2-
"name": "dotkernel/dot-controller",
3-
"type": "library",
4-
"description": "DotKernel controller like middleware component with plugin support",
5-
"license": "MIT",
6-
"authors": [
7-
{
8-
"name": "dotkernel",
9-
"email": "team@dotkernel.com"
2+
"name": "dotkernel/dot-controller",
3+
"type": "library",
4+
"description": "DotKernel controller like middleware component with plugin support",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "dotkernel",
9+
"email": "team@dotkernel.com"
10+
}
11+
],
12+
"require": {
13+
"php": "^7.2",
14+
"psr/http-message": "^1.0",
15+
"laminas/laminas-servicemanager": "^3.3.0",
16+
"dotkernel/dot-event": "^2.0",
17+
"laminas/laminas-dependency-plugin": "^1.0"
18+
},
19+
"require-dev": {
20+
"mezzio/mezzio-template": "^1.0",
21+
"mezzio/mezzio-helpers": "^4.0",
22+
"phpunit/phpunit": "^4.8",
23+
"squizlabs/php_codesniffer": "^2.3"
24+
},
25+
"autoload": {
26+
"psr-4": {
27+
"Dot\\Controller\\": "src/"
28+
}
29+
},
30+
"autoload-dev": {
31+
"psr-4": {
32+
"DotTest\\Controller\\": "test/"
33+
}
34+
},
35+
"extra": {
36+
"branch-alias": {
37+
"dev-master": "2.0-dev",
38+
"dev-develop": "2.1-dev"
39+
}
1040
}
11-
],
12-
"require": {
13-
"php": "^7.1",
14-
"psr/http-message": "^1.0",
15-
"zendframework/zend-servicemanager": "^3.3.0",
16-
17-
"dotkernel/dot-event": "^0.2"
18-
},
19-
"require-dev": {
20-
"zendframework/zend-expressive-template": "^1.0",
21-
"zendframework/zend-expressive-helpers": "^4.0",
22-
23-
"phpunit/phpunit": "^4.8",
24-
"squizlabs/php_codesniffer": "^2.3"
25-
},
26-
"autoload": {
27-
"psr-4": {
28-
"Dot\\Controller\\": "src/"
29-
}
30-
},
31-
"autoload-dev": {
32-
"psr-4": {
33-
"DotTest\\Controller\\": "test/"
34-
}
35-
},
36-
"extra": {
37-
"branch-alias": {
38-
"dev-master": "1.0-dev",
39-
"dev-develop": "1.1-dev"
40-
}
41-
}
4241
}

src/AbstractController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
use Psr\Http\Message\ServerRequestInterface;
1818
use Psr\Http\Server\MiddlewareInterface;
1919
use Psr\Http\Server\RequestHandlerInterface;
20-
use Zend\EventManager\EventManagerAwareInterface;
20+
use Laminas\EventManager\EventManagerAwareInterface;
2121

2222

2323
/**

src/Event/AbstractControllerEventListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace Dot\Controller\Event;
1111

12-
use Zend\EventManager\AbstractListenerAggregate;
12+
use Laminas\EventManager\AbstractListenerAggregate;
1313

1414
/**
1515
* Class AbstractControllerEventListener

src/Event/ControllerEventListenerInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace Dot\Controller\Event;
1111

12-
use Zend\EventManager\ListenerAggregateInterface;
12+
use Laminas\EventManager\ListenerAggregateInterface;
1313

1414
/**
1515
* Interface ActionControllerEventListenerInterface

src/Event/ControllerEventListenerTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99

1010
namespace Dot\Controller\Event;
1111

12-
use Zend\EventManager\EventManagerInterface;
13-
use Zend\EventManager\ListenerAggregateTrait;
12+
use Laminas\EventManager\EventManagerInterface;
13+
use Laminas\EventManager\ListenerAggregateTrait;
1414

1515
/**
1616
* Class ControllerEventListenerTrait

src/Event/DispatchControllerEventsTrait.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
use Dot\Controller\AbstractController;
1313
use Dot\Controller\Exception\RuntimeException;
1414
use Psr\Http\Message\ResponseInterface;
15-
use Zend\EventManager\EventManagerAwareTrait;
16-
use Zend\EventManager\ResponseCollection;
15+
use Laminas\EventManager\EventManagerAwareTrait;
16+
use Laminas\EventManager\ResponseCollection;
1717

1818
/**
1919
* Class DispatchControllerEventsTrait

src/Factory/PluginManagerFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
use Dot\Controller\Plugin\TemplatePlugin;
1414
use Dot\Controller\Plugin\UrlHelperPlugin;
1515
use Psr\Container\ContainerInterface;
16-
use Zend\Expressive\Helper\UrlHelper;
17-
use Zend\Expressive\Template\TemplateRendererInterface;
16+
use Mezzio\Helper\UrlHelper;
17+
use Mezzio\Template\TemplateRendererInterface;
1818

1919
/**
2020
* Class PluginManagerFactory

src/Plugin/PluginManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
namespace Dot\Controller\Plugin;
1111

12-
use Zend\ServiceManager\AbstractPluginManager;
12+
use Laminas\ServiceManager\AbstractPluginManager;
1313

1414
/**
1515
* Class PluginManager

0 commit comments

Comments
 (0)