Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit d27939f

Browse files
committed
Removed all console-related functionality
zend-mvc-console now provides all console-related integration between zend-mvc, zend-router, and zend-view, allowing it to be removed from this component. Doing this as part of the zend-router removal, as otherwise you cannot actually route to console-related controllers.
1 parent 9d2f1db commit d27939f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+41
-2916
lines changed

composer.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"php": "^5.5 || ^7.0",
1717
"zendframework/zend-eventmanager": "^2.6.2 || ^3.0",
1818
"zendframework/zend-servicemanager": "^2.7.5 || ^3.0.3",
19+
"zendframework/zend-http": "^2.5.4",
1920
"zendframework/zend-hydrator": "^1.1 || ^2.1",
2021
"zendframework/zend-form": "^2.7",
2122
"zendframework/zend-router": "^3.0",
@@ -26,10 +27,8 @@
2627
"require-dev": {
2728
"zendframework/zend-authentication": "^2.5.3",
2829
"zendframework/zend-cache": "^2.6.1",
29-
"zendframework/zend-console": "^2.6",
3030
"zendframework/zend-di": "^2.6",
3131
"zendframework/zend-filter": "^2.6.1",
32-
"zendframework/zend-http": "^2.5.4",
3332
"zendframework/zend-i18n": "^2.6",
3433
"zendframework/zend-inputfilter": "^2.6",
3534
"zendframework/zend-json": "^2.6.1",
@@ -48,7 +47,6 @@
4847
"suggest": {
4948
"zendframework/zend-authentication": "Zend\\Authentication component for Identity plugin",
5049
"zendframework/zend-config": "Zend\\Config component",
51-
"zendframework/zend-console": "Zend\\Console component",
5250
"zendframework/zend-di": "Zend\\Di component",
5351
"zendframework/zend-filter": "Zend\\Filter component",
5452
"zendframework/zend-http": "Zend\\Http component",
@@ -57,6 +55,7 @@
5755
"zendframework/zend-json": "Zend\\Json component",
5856
"zendframework/zend-log": "Zend\\Log component",
5957
"zendframework/zend-modulemanager": "Zend\\ModuleManager component",
58+
"zendframework/zend-mvc-console": "zend-mvc-console provides the ability to expose zend-mvc as a console application",
6059
"zendframework/zend-serializer": "Zend\\Serializer component",
6160
"zendframework/zend-session": "Zend\\Session component for FlashMessenger, PRG, and FPRG plugins",
6261
"zendframework/zend-text": "Zend\\Text component",

composer.lock

Lines changed: 2 additions & 54 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Controller/AbstractActionController.php

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

1010
namespace Zend\Mvc\Controller;
1111

12-
use Zend\Http\Response as HttpResponse;
1312
use Zend\Mvc\Exception;
1413
use Zend\Mvc\MvcEvent;
1514
use Zend\View\Model\ViewModel;
@@ -43,15 +42,12 @@ public function indexAction()
4342
*/
4443
public function notFoundAction()
4544
{
46-
$response = $this->response;
4745
$event = $this->getEvent();
4846
$routeMatch = $event->getRouteMatch();
4947
$routeMatch->setParam('action', 'not-found');
5048

51-
if ($response instanceof HttpResponse) {
52-
return $this->createHttpNotFoundModel($response);
53-
}
54-
return $this->createConsoleNotFoundModel($response);
49+
$helper = $this->plugin('createHttpNotFoundModel');
50+
return $helper($event->getResponse());
5551
}
5652

5753
/**
@@ -85,26 +81,4 @@ public function onDispatch(MvcEvent $e)
8581

8682
return $actionResponse;
8783
}
88-
89-
/**
90-
* @deprecated please use the {@see \Zend\Mvc\Controller\Plugin\CreateHttpNotFoundModel} plugin instead: this
91-
* method will be removed in release 2.5 or later.
92-
*
93-
* {@inheritDoc}
94-
*/
95-
protected function createHttpNotFoundModel(HttpResponse $response)
96-
{
97-
return $this->__call('createHttpNotFoundModel', [$response]);
98-
}
99-
100-
/**
101-
* @deprecated please use the {@see \Zend\Mvc\Controller\Plugin\CreateConsoleNotFoundModel} plugin instead: this
102-
* method will be removed in release 2.5 or later.
103-
*
104-
* {@inheritDoc}
105-
*/
106-
protected function createConsoleNotFoundModel($response)
107-
{
108-
return $this->__call('createConsoleNotFoundModel', [$response]);
109-
}
11084
}

src/Controller/AbstractConsoleController.php

Lines changed: 0 additions & 57 deletions
This file was deleted.

src/Controller/AbstractController.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
* @method \Zend\Http\Response|array postRedirectGet(string $redirect = null, bool $redirectToUrl = false)
4141
* @method \Zend\Mvc\Controller\Plugin\Redirect redirect()
4242
* @method \Zend\Mvc\Controller\Plugin\Url url()
43-
* @method \Zend\View\Model\ConsoleModel createConsoleNotFoundModel()
4443
* @method \Zend\View\Model\ViewModel createHttpNotFoundModel(Response $response)
4544
*/
4645
abstract class AbstractController implements

src/Controller/ControllerManager.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ class ControllerManager extends AbstractPluginManager
5252
public function __construct($configOrContainerInstance, array $v3config = [])
5353
{
5454
$this->addInitializer([$this, 'injectEventManager']);
55-
$this->addInitializer([$this, 'injectConsole']);
5655
$this->addInitializer([$this, 'injectPluginManager']);
5756
parent::__construct($configOrContainerInstance, $v3config);
5857

@@ -137,36 +136,6 @@ public function injectEventManager($first, $second)
137136
}
138137
}
139138

140-
/**
141-
* Initializer: inject Console adapter instance
142-
*
143-
* @param ContainerInterface|DispatchableInterface $first Container when
144-
* using zend-servicemanager v3; controller under v2.
145-
* @param DispatchableInterface|ContainerInterface $second Controller when
146-
* using zend-servicemanager v3; container under v2.
147-
*/
148-
public function injectConsole($first, $second)
149-
{
150-
if ($first instanceof ContainerInterface) {
151-
$container = $first;
152-
$controller = $second;
153-
} else {
154-
$container = $second;
155-
$controller = $first;
156-
}
157-
158-
if (! $controller instanceof AbstractConsoleController) {
159-
return;
160-
}
161-
162-
// For v2, we need to pull the parent service locator
163-
if (! method_exists($container, 'configure')) {
164-
$container = $container->getServiceLocator() ?: $container;
165-
}
166-
167-
$controller->setConsole($container->get('Console'));
168-
}
169-
170139
/**
171140
* Initializer: inject plugin manager
172141
*

src/Controller/Plugin/CreateConsoleNotFoundModel.php

Lines changed: 0 additions & 30 deletions
This file was deleted.

src/Controller/PluginManager.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,6 @@ class PluginManager extends AbstractPluginManager
6363
'CreateHttpNotFoundModel' => Plugin\CreateHttpNotFoundModel::class,
6464
'createHttpNotFoundModel' => Plugin\CreateHttpNotFoundModel::class,
6565
'createhttpnotfoundmodel' => Plugin\CreateHttpNotFoundModel::class,
66-
'CreateConsoleNotFoundModel' => Plugin\CreateConsoleNotFoundModel::class,
67-
'createConsoleNotFoundModel' => Plugin\CreateConsoleNotFoundModel::class,
68-
'createconsolenotfoundmodel' => Plugin\CreateConsoleNotFoundModel::class,
6966
];
7067

7168
/**
@@ -83,7 +80,6 @@ class PluginManager extends AbstractPluginManager
8380
Plugin\Redirect::class => InvokableFactory::class,
8481
Plugin\Url::class => InvokableFactory::class,
8582
Plugin\CreateHttpNotFoundModel::class => InvokableFactory::class,
86-
Plugin\CreateConsoleNotFoundModel::class => InvokableFactory::class,
8783

8884
// v2 normalized names
8985

@@ -98,7 +94,6 @@ class PluginManager extends AbstractPluginManager
9894
'zendmvccontrollerpluginredirect' => InvokableFactory::class,
9995
'zendmvccontrollerpluginurl' => InvokableFactory::class,
10096
'zendmvccontrollerplugincreatehttpnotfoundmodel' => InvokableFactory::class,
101-
'zendmvccontrollerplugincreateconsolenotfoundmodel' => InvokableFactory::class,
10297
];
10398

10499
/**

src/ResponseSender/ConsoleResponseSender.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)