#!/usr/bin/env php setLocalRepository(new Repository\PlatformRepository( new Repository\FilesystemRepository(new JsonFile('.composer/installed.json')) )); $rm->setRepository('Packagist', new Repository\ComposerRepository('http://packagist.org')); // initialize download manager $dm = new Downloader\DownloadManager($preferSource = false); $dm->setDownloader('git', new Downloader\GitDownloader()); $dm->setDownloader('pear', new Downloader\PearDownloader()); $dm->setDownloader('zip', new Downloader\ZipDownloader()); // initialize installation manager $im = new Installer\InstallationManager(); $im->setInstaller('library', new Installer\LibraryInstaller('vendor', $dm, $rm->getLocalRepository())); $im->setInstaller('symfony-bundle', new Installer\LibraryInstaller('vendor/bundles', $dm, $rm->getLocalRepository())); // load package $loader = new Package\Loader\JsonLoader(); $package = $loader->load(new JsonFile('composer.json')); // init locker $locker = new Package\Locker(new JsonFile('composer.lock'), $rm); // initialize composer $composer = new Composer(); $composer->setPackage($package); $composer->setLocker($locker); $composer->setRepositoryManager($rm); $composer->setDownloadManager($dm); $composer->setInstallationManager($im); // run the command application $application = new ComposerApplication($composer); $application->run();