Skip to content

Commit 4be06ee

Browse files
committed
Merge remote-tracking branch 'ogresCE/MAGETWO-37507-Magento-Web-Installer-fails-on-HipHop-Virtual-Machine' into PR_Branch
2 parents 9ded5cd + f11ac9b commit 4be06ee

File tree

8 files changed

+21
-56
lines changed

8 files changed

+21
-56
lines changed

bin/magento

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
try {
99
require __DIR__ . '/../app/bootstrap.php';
1010
if (PHP_SAPI == 'cli') {
11+
// For Cli we are using our customized error handler
12+
$handler = new \Magento\Framework\App\ErrorHandler();
13+
set_error_handler([$handler, 'handler']);
14+
1115
$application = new Magento\Framework\Console\Cli('Magento CLI');
1216
$application->run();
1317
}

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,14 @@ public function handler($errorNo, $errorStr, $errorFile, $errorLine)
5050
// there's no way to distinguish between caught system exceptions and warnings
5151
return false;
5252
}
53+
54+
if (strpos($errorStr, 'Automatically populating $HTTP_RAW_POST_DATA is deprecated') !== false) {
55+
// this warning should be suppressed as it is a known bug in php 5.6.0 https://bugs.php.net/bug.php?id=66763
56+
// and workaround suggested here (http://php.net/manual/en/ini.core.php#ini.always-populate-raw-post-data)
57+
// is not compatible with HHVM
58+
return false;
59+
}
60+
5361
$errorNo = $errorNo & error_reporting();
5462
if ($errorNo == 0) {
5563
return false;

setup/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@
2323
HTML;
2424
exit(1);
2525
}
26+
27+
// For Setup Wizard we are using our customized error handler
28+
$handler = new \Magento\Framework\App\ErrorHandler();
29+
set_error_handler([$handler, 'handler']);
30+
2631
\Zend\Mvc\Application::init(require __DIR__ . '/config/application.config.php')->run();

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

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,13 @@
55
*/
66
namespace Magento\Setup\Controller;
77

8-
use Magento\Setup\Model\InstallerFactory;
9-
use Magento\Setup\Model\WebLogger;
108
use Zend\Json\Json;
119
use Zend\Mvc\Controller\AbstractActionController;
1210
use Zend\View\Model\JsonModel;
1311
use Magento\Setup\Validator\DbValidator;
1412

1513
class DatabaseCheck extends AbstractActionController
1614
{
17-
/**
18-
* WebLogger to access log
19-
*
20-
* @var WebLogger
21-
*/
22-
private $webLogger;
23-
2415
/**
2516
* @var DbValidator
2617
*/
@@ -30,12 +21,10 @@ class DatabaseCheck extends AbstractActionController
3021
/**
3122
* Constructor
3223
*
33-
* @param WebLogger $webLogger
3424
* @param DbValidator $dbValidator
3525
*/
36-
public function __construct(WebLogger $webLogger, DbValidator $dbValidator)
26+
public function __construct(DbValidator $dbValidator)
3727
{
38-
$this->webLogger = $webLogger;
3928
$this->dbValidator = $dbValidator;
4029
}
4130

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

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ public function phpSettingsAction()
9797
$responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS;
9898

9999
$settings = array_merge(
100-
$this->checkRawPost(),
101100
$this->checkXDebugNestedLevel()
102101
);
103102

@@ -176,40 +175,6 @@ public function filePermissionsAction()
176175
return new JsonModel($data);
177176
}
178177

179-
/**
180-
* Checks if PHP version >= 5.6.0 and always_populate_raw_post_data is set
181-
*
182-
* @return array
183-
*/
184-
private function checkRawPost()
185-
{
186-
$data = [];
187-
$error = false;
188-
$iniSetting = ini_get('always_populate_raw_post_data');
189-
190-
if (version_compare(PHP_VERSION, '5.6.0') >= 0 && (int)$iniSetting > -1) {
191-
$error = true;
192-
}
193-
194-
$message = sprintf(
195-
'Your PHP Version is %s, but always_populate_raw_post_data = %d.
196-
$HTTP_RAW_POST_DATA is deprecated from PHP 5.6 onwards and will stop the installer from running.
197-
Please open your php.ini file and set always_populate_raw_post_data to -1.
198-
If you need more help please call your hosting provider.
199-
',
200-
PHP_VERSION,
201-
ini_get('always_populate_raw_post_data')
202-
);
203-
204-
$data['rawpost'] = [
205-
'message' => $message,
206-
'helpUrl' => 'http://php.net/manual/en/ini.core.php#ini.always-populate-settings-data',
207-
'error' => $error
208-
];
209-
210-
return $data;
211-
}
212-
213178
/**
214179
* Checks if xdebug.max_nesting_level is set 200 or more
215180
* @return array
@@ -218,7 +183,7 @@ private function checkXDebugNestedLevel()
218183
{
219184
$data = [];
220185
$error = false;
221-
186+
222187
$currentExtensions = $this->phpInformation->getCurrent();
223188
if (in_array('xdebug', $currentExtensions)) {
224189

setup/src/Magento/Setup/Model/InstallerFactory.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88

99
use Zend\ServiceManager\ServiceLocatorInterface;
1010
use Magento\Setup\Module\ResourceFactory;
11-
use Magento\Framework\App\ErrorHandler;
12-
use Magento\Framework\App\State\CleanupFiles;
1311

1412
class InstallerFactory
1513
{
@@ -35,9 +33,6 @@ public function __construct(ServiceLocatorInterface $serviceLocator, ResourceFac
3533
{
3634
$this->serviceLocator = $serviceLocator;
3735
$this->resourceFactory = $resourceFactory;
38-
// For Setup Wizard we are using our customized error handler
39-
$handler = new ErrorHandler();
40-
set_error_handler([$handler, 'handler']);
4136
}
4237

4338
/**

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,8 @@ class DatabaseCheckTest extends \PHPUnit_Framework_TestCase
2525

2626
public function setUp()
2727
{
28-
$webLogger = $this->getMock('\Magento\Setup\Model\WebLogger', [], [], '', false);
2928
$this->dbValidator = $this->getMock('Magento\Setup\Validator\DbValidator', [], [], '', false);
30-
$this->controller = new DatabaseCheck($webLogger, $this->dbValidator);
29+
$this->controller = new DatabaseCheck($this->dbValidator);
3130
}
3231

3332
public function testIndexAction()

setup/view/magento/setup/readiness-check/progress.phtml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<div class="readiness-check-content">
102102
<h3 class="readiness-check-title">PHP Settings Check</h3>
103103
<p>
104-
Your PHP setting is correct.
104+
Your PHP settings are correct.
105105
</p>
106106
</div>
107107

0 commit comments

Comments
 (0)