Skip to content

Commit da80ad0

Browse files
author
Bohdan Korablov
committed
MAGETWO-54716: Unable to setup Magento via web installer
1 parent dd820a2 commit da80ad0

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

app/code/Magento/SampleData/Console/Command/SampleDataDeployCommand.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
/**
2323
* Command for deployment of Sample Data
24-
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
2524
*/
2625
class SampleDataDeployCommand extends Command
2726
{
@@ -35,12 +34,6 @@ class SampleDataDeployCommand extends Command
3534
*/
3635
private $sampleDataDependency;
3736

38-
/**
39-
* @var ArrayInputFactory
40-
* @deprecated
41-
*/
42-
private $arrayInputFactory;
43-
4437
/**
4538
* @var ApplicationFactory
4639
*/
@@ -51,6 +44,7 @@ class SampleDataDeployCommand extends Command
5144
* @param Dependency $sampleDataDependency
5245
* @param ArrayInputFactory $arrayInputFactory
5346
* @param ApplicationFactory $applicationFactory
47+
* @SuppressWarnings(PHPMD.UnusedLocalVariable)
5448
*/
5549
public function __construct(
5650
Filesystem $filesystem,
@@ -60,7 +54,6 @@ public function __construct(
6054
) {
6155
$this->filesystem = $filesystem;
6256
$this->sampleDataDependency = $sampleDataDependency;
63-
$this->arrayInputFactory = $arrayInputFactory;
6457
$this->applicationFactory = $applicationFactory;
6558
parent::__construct();
6659
}
@@ -113,6 +106,8 @@ protected function execute(InputInterface $input, OutputInterface $output)
113106
/**
114107
* Create new auth.json file if it doesn't exist.
115108
*
109+
* We create auth.json with correct permissions instead of relying on Composer.
110+
*
116111
* @return void
117112
* @throws \Exception
118113
*/
@@ -124,7 +119,10 @@ private function createAuthFile()
124119
try {
125120
$directory->writeFile(PackagesAuth::PATH_TO_AUTH_FILE, '{}');
126121
} catch (\Exception $e) {
127-
throw new \Exception('Error in writing Auth file. Please check permissions for writing.');
122+
$message = 'Error in writing Auth file '
123+
. $directory->getAbsolutePath(PackagesAuth::PATH_TO_AUTH_FILE)
124+
. '. Please check permissions for writing.';
125+
throw new \Exception($message);
128126
}
129127
}
130128
}

0 commit comments

Comments
 (0)