Skip to content
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

Remove abandoned laminas-console and laminas-mvc-console dependencies #32432

2 changes: 0 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"guzzlehttp/guzzle": "^6.3.3",
"laminas/laminas-captcha": "^2.7.1",
"laminas/laminas-code": "^3.5.1",
"laminas/laminas-console": "^2.6.0",
"laminas/laminas-crypt": "^3.4.0",
"laminas/laminas-db": "^2.12.0",
"laminas/laminas-dependency-plugin": "^2.1.0",
Expand All @@ -53,7 +52,6 @@
"laminas/laminas-mime": "^2.8.0",
"laminas/laminas-modulemanager": "^2.7",
"laminas/laminas-mvc": "^3.2.0",
"laminas/laminas-mvc-console": "^1.3.0",
"laminas/laminas-serializer": "^2.7.2",
"laminas/laminas-server": "^2.6.1",
"laminas/laminas-servicemanager": "^3.6.0",
Expand Down
149 changes: 6 additions & 143 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions setup/config/modules.config.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,5 @@
'Laminas\Router',
'Laminas\Serializer',
'Laminas\Session',
'Laminas\Validator',
'Laminas\Mvc\Console'
'Laminas\Validator'
];
19 changes: 9 additions & 10 deletions setup/src/Magento/Setup/Mvc/Bootstrap/InitParamListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,12 @@
use Magento\Framework\App\State;
use Magento\Framework\Filesystem;
use Magento\Framework\Shell\ComplexParameter;
use Laminas\Console\Request;
use Laminas\EventManager\EventManagerInterface;
use Laminas\EventManager\ListenerAggregateInterface;
use Laminas\Mvc\Application;
use Laminas\Mvc\MvcEvent;
use Laminas\ServiceManager\Factory\FactoryInterface;
use Laminas\ServiceManager\ServiceLocatorInterface;
use Laminas\Stdlib\RequestInterface;

/**
* A listener that injects relevant Magento initialization parameters and initializes filesystem
Expand Down Expand Up @@ -138,25 +136,26 @@ private function extractInitParameters(Application $application)
$result[$initKey] = $_SERVER[$initKey];
}
}
$result = array_replace_recursive($result, $this->extractFromCli($application->getRequest()));
return $result;

if (!isset($result['argv']) || !is_array($result['argv'])) {
return $result;
}

return array_replace_recursive($result, $this->extractFromCli($result['argv']));
}

/**
* Extracts the directory paths from a CLI request
*
* Uses format of a URL query
*
* @param RequestInterface $request
* @param array $argv
* @return array
*/
private function extractFromCli(RequestInterface $request)
private function extractFromCli(array $argv): array
{
if (!($request instanceof Request)) {
return [];
}
$bootstrapParam = new ComplexParameter(self::BOOTSTRAP_PARAM);
foreach ($request->getContent() as $paramStr) {
foreach ($argv as $paramStr) {
$result = $bootstrapParam->getFromString($paramStr);
if (!empty($result)) {
return $result;
Expand Down
Loading