35 lines
1.1 KiB
PHP
Executable File
35 lines
1.1 KiB
PHP
Executable File
#!/usr/bin/env php
|
|
<?php
|
|
|
|
require __DIR__.'/../tests/bootstrap.php';
|
|
|
|
use Composer\Composer;
|
|
use Composer\Installer;
|
|
use Composer\Downloader;
|
|
use Composer\Repository;
|
|
use Composer\Package;
|
|
use Composer\Console\Application as ComposerApplication;
|
|
|
|
// initialize installer
|
|
$installer = new Installer\LibraryInstaller('vendor', $preferSource = true);
|
|
$installer->setDownloader('git', new Downloader\GitDownloader());
|
|
$installer->setDownloader('pear', new Downloader\PearDownloader());
|
|
$installer->setDownloader('zip', new Downloader\ZipDownloader());
|
|
|
|
// initialize composer
|
|
$composer = new Composer();
|
|
$composer->setInstaller('library', $installer);
|
|
$composer->setRepository('Platform', new Repository\PlatformRepository());
|
|
$composer->setRepository('Packagist', new Repository\ComposerRepository('http://packagist.org'));
|
|
|
|
// initialize package
|
|
$loader = new Package\Loader\JsonLoader();
|
|
$package = $loader->load('composer.json');
|
|
|
|
// initialize lock
|
|
$packageLock = new Package\PackageLock('composer.lock');
|
|
|
|
// run the command application
|
|
$application = new ComposerApplication($composer, $package, $packageLock);
|
|
$application->run();
|