Skip to content

Commit 44b7cc1

Browse files
author
Anton Makarenko
committed
MAGETWO-32365: [GITHUB] "web setup wizard is not accessible" error message but the setup wizard is actually accessible #920
- fixed detecting if Setup application is available when DOCUMENT_ROOT has trailing slash
1 parent a437b12 commit 44b7cc1

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

dev/tests/unit/testsuite/Magento/Framework/App/SetupInfoTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,14 @@ public function isAvailableDataProvider()
180180
],
181181
false
182182
],
183+
'root within doc root, existent sub-directory, trailing slash' => [
184+
[
185+
'DOCUMENT_ROOT' => dirname(__DIR__) . DIRECTORY_SEPARATOR,
186+
'SCRIPT_FILENAME' => __FILE__,
187+
SetupInfo::PARAM_NOT_INSTALLED_URL_PATH => '_files'
188+
],
189+
true
190+
],
183191
];
184192
}
185193
}

lib/internal/Magento/Framework/App/SetupInfo.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct($server, $projectRoot = '')
5656
if (empty($server['DOCUMENT_ROOT'])) {
5757
throw new \InvalidArgumentException('DOCUMENT_ROOT variable is unavailable.');
5858
}
59-
$this->docRoot = str_replace('\\', '/', $server['DOCUMENT_ROOT']);
59+
$this->docRoot = rtrim(str_replace('\\', '/', $server['DOCUMENT_ROOT']), '/');
6060
$this->projectRoot = $projectRoot ?: $this->detectProjectRoot();
6161
$this->projectRoot = str_replace('\\', '/', $this->projectRoot);
6262
}

0 commit comments

Comments
 (0)