Skip to content

Commit 6d4b966

Browse files
committed
Remove usage of laminas\mvc from Setup Wizard page
1 parent 867f3e3 commit 6d4b966

File tree

7 files changed

+64
-165
lines changed

7 files changed

+64
-165
lines changed

setup/config/module.config.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,5 @@
1212
'template_path_stack' => [
1313
'setup' => __DIR__ . '/../view',
1414
],
15-
],
16-
'controllers' => [
17-
'factories' => [
18-
\Magento\Setup\Controller\Index::class => \Laminas\ServiceManager\AbstractFactory\ReflectionBasedAbstractFactory::class,
19-
],
20-
],
15+
]
2116
];

setup/config/router.config.php

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

setup/index.php

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6-
use Magento\Setup\Application;
7-
use Magento\Setup\Model\ObjectManagerProvider;
6+
7+
use Laminas\Http\PhpEnvironment\Request;
8+
use Magento\Framework\App\Bootstrap;
9+
use Magento\Framework\App\ProductMetadata;
10+
use Magento\Setup\Model\License;
811

912
if (PHP_SAPI == 'cli') {
1013
echo "You cannot run this from the command line." . PHP_EOL .
@@ -30,10 +33,20 @@
3033
$handler = new \Magento\Framework\App\ErrorHandler();
3134
set_error_handler([$handler, 'handler']);
3235

33-
$configuration = require __DIR__ . '/config/application.config.php';
34-
$bootstrap = new Application();
35-
$application = $bootstrap->bootstrap($configuration);
36-
$application->getServiceManager()
37-
->get(ObjectManagerProvider::class)
38-
->setObjectManager(\Magento\Framework\App\Bootstrap::create(BP, $_SERVER)->getObjectManager());
39-
$application->run();
36+
// Render Setup Wizard landing page
37+
$objectManager = Bootstrap::create(BP, $_SERVER)->getObjectManager();
38+
39+
$licenseClass = $objectManager->create(License::class);
40+
$metaClass = $objectManager->create(ProductMetadata::class);
41+
/** @var License $license */
42+
$license = $licenseClass->getContents();
43+
/** @var ProductMetadata $version */
44+
$version = $metaClass->getVersion();
45+
46+
$request = new Request();
47+
$basePath = $request->getBasePath();
48+
49+
ob_start();
50+
require_once __DIR__ . '/view/magento/setup/index.phtml';
51+
$html = ob_get_clean();
52+
echo $html;

setup/src/Magento/Setup/Controller/Index.php

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

setup/src/Magento/Setup/Module.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ public function getConfig()
7575
// phpcs:disable
7676
$result = array_merge_recursive(
7777
include __DIR__ . '/../../../config/module.config.php',
78-
include __DIR__ . '/../../../config/router.config.php',
7978
include __DIR__ . '/../../../config/di.config.php',
8079
);
8180
// phpcs:enable

setup/src/Magento/Setup/Test/Unit/Controller/IndexTest.php

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

setup/view/magento/setup/index.phtml

Lines changed: 41 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,47 @@
66

77
// phpcs:disable Magento2.Templates.ThisInTemplate
88
?>
9+
<!--[if !IE]><!-->
10+
<html lang="en">
11+
<!--<![endif]-->
12+
<head>
13+
<meta charset="utf-8">
14+
<meta name="viewport" content="width=device-width, initial-scale=1">
15+
<title>Magento</title>
16+
<link href="<?= $basePath ?>/pub/styles/setup.css" media="screen" rel="stylesheet" type="text/css" />
17+
<script src="<?= $basePath ?>/pub/scripts/main.js"></script>
18+
<link
19+
rel="icon"
20+
type="image/x-icon"
21+
href="<?= $basePath ?>/pub/images/favicon/favicon.ico"
22+
sizes="16x16">
23+
<link
24+
rel="icon"
25+
type="image/png"
26+
href="<?= $basePath ?>/pub/images/favicon/favicon-96x96.png"
27+
sizes="96x96">
28+
<link
29+
rel="icon"
30+
type="image/png"
31+
href="<?= $basePath ?>/pub/images/favicon/favicon-32x32.png"
32+
sizes="32x32">
33+
<link
34+
rel="icon"
35+
type="image/png"
36+
href="<?= $basePath ?>/pub/images/favicon/favicon-16x16.png"
37+
sizes="16x16">
38+
<style>
39+
a.white-space-pre-line {
40+
white-space: pre-line;
41+
}
42+
</style>
43+
</head>
44+
<body>
945
<div class="container">
1046
<main class="page-content">
1147
<section data-section="landing" class="page-landing">
12-
<img class="logo" src="<?= $this->basePath() ?>/pub/images/magento-logo.svg" alt="Magento"/>
13-
<p class="text-version">Version <?= htmlspecialchars($this->version, ENT_COMPAT) ?></p>
48+
<img class="logo" src="<?= $basePath ?>/pub/images/magento-logo.svg" alt="Magento"/>
49+
<p class="text-version">Version <?= htmlspecialchars($version, ENT_COMPAT) ?></p>
1450
<p class="text-welcome">
1551
Welcome to Magento Admin, your online store headquarters.
1652
<br>
@@ -22,7 +58,7 @@
2258
<section data-section="license" class="row page-license" style="display: none">
2359
<div class="col-m-offset-2 col-m-8 col-xs-12">
2460
<div class="license-text">
25-
<?= nl2br(htmlspecialchars($this->license, ENT_COMPAT)) ?>
61+
<?= nl2br(htmlspecialchars($license, ENT_COMPAT)) ?>
2662
</div>
2763
<div class="page-license-footer">
2864
<div class="btn-wrap-triangle-left">
@@ -33,3 +69,5 @@
3369
</section>
3470
</main>
3571
</div>
72+
</body>
73+
</html>

0 commit comments

Comments
 (0)