1. Go to this page and download the library: Download manychois/composery library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
manychois / composery example snippets
use Manychois\Composery\Composer;
use Manychois\Composery\Environment;
$env = new Environment(workingDir: '/path/to/your/project');
$composer = new Composer($env);
// Blocking — waits until the command finishes
$result = $composer->install();
if ($result->successful()) {
echo "Installed in {$result->duration()}s\n";
} else {
echo "Failed (exit {$result->exitCode()}):\n{$result->output()}";
}
use Manychois\Composery\Composer;
use Manychois\Composery\Command\UpdateOptions;
use Manychois\Composery\Environment;
use Manychois\Composery\Runner\OutputSource;
$env = new Environment(workingDir: '/path/to/your/project');
$composer = new Composer($env);
$options = new UpdateOptions();
$options->noDev = true;
$gen = $composer->updateStreaming(options: $options);
foreach ($gen as $line) {
$prefix = $line->source === OutputSource::Stderr ? '[err] ' : '';
echo $prefix . $line->content . "\n";
}
$result = $gen->getReturn();
echo "Exit code: {$result->exitCode()}\n";