Skip to content

Commit 20cbb89

Browse files
author
Ivan Gavryshko
committed
MAGETWO-38838: Create composer management library and reuse it in both updater and setup wizard
- fixes and changes according CR
1 parent 827ba1e commit 20cbb89

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Magento composer lib
1+
Magento composer library helps to instantiate Composer application and run composer commands.

app/code/Magento/Composer/MagentoComposerApplication.php

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,17 @@
1111
use Composer\Factory as ComposerFactory;
1212
use Symfony\Component\Console\Output\BufferedOutput;
1313

14+
/**
15+
* Class MagentoComposerApplication
16+
*
17+
* This class provides ability to set composer application settings and run any composer command.
18+
* Also provides method to get Composer instance so you can have access to composer properties lie Locker
19+
*/
1420
class MagentoComposerApplication
1521
{
22+
23+
const COMPOSER_WORKING_DIR = '--working-dir';
24+
1625
/**
1726
* Trigger checks config
1827
*
@@ -41,6 +50,11 @@ class MagentoComposerApplication
4150
*/
4251
private $consoleOutput;
4352

53+
/**
54+
* @var ConsoleArrayInputFactory
55+
*/
56+
private $consoleArrayInputFactory;
57+
4458
/**
4559
* Constructs class
4660
*
@@ -109,7 +123,7 @@ public function runComposerCommand(array $commandParams)
109123

110124
$this->consoleApplication->resetComposer();
111125

112-
$commandParams['--working-dir'] = dirname($this->composerJson);
126+
$commandParams[self::COMPOSER_WORKING_DIR] = dirname($this->composerJson);
113127

114128
$input = $this->consoleArrayInputFactory->create($commandParams);
115129

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "magento/composer",
3-
"description": "Magento composer library helps to instantiate Composer application and run Symfony commands.",
3+
"description": "Magento composer library helps to instantiate Composer application and run composer commands.",
44
"type": "library",
55
"version": "0.74.0-beta8",
66
"license": [

0 commit comments

Comments
 (0)