Last active
October 19, 2021 20:04
-
-
Save dmouse/7532532 to your computer and use it in GitHub Desktop.
Run composer command from php script, controller, web,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "hechoendrupal/composer-ui", | |
"description": "Composer UI", | |
"minimum-stability": "dev", | |
"authors": [ | |
{ | |
"name": "David Flore", | |
"email": "[email protected]" | |
} | |
], | |
"require": { | |
"composer/composer": "1.0.0-alpha7" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Composer\Factory; | |
use Composer\IO\ConsoleIO; | |
use Symfony\Component\Console\Input\ArgvInput; | |
use Symfony\Component\Console\Helper\HelperSet; | |
use Symfony\Component\Console\Output\ConsoleOutput; | |
use Composer\Command\UpdateCommand; | |
include __DIR__ . '/vendor/autoload.php'; | |
$input = new ArgvInput(array()); | |
$output = new ConsoleOutput(); | |
$helper = new HelperSet(); | |
$io = new ConsoleIO($input,$output,$helper); | |
$composer = Factory::create($io); | |
$update = new UpdateCommand(); | |
$update->setComposer($composer); | |
$update->run($input,$output); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment