diff --git a/bin/composer b/bin/composer index 4cf1eec23..d6ee9cf51 100755 --- a/bin/composer +++ b/bin/composer @@ -13,9 +13,7 @@ use Composer\Console\Application as ComposerApplication; // initialize repository manager $rm = new Repository\RepositoryManager(); -$rm->setLocalRepository(new Repository\PlatformRepository( - new Repository\FilesystemRepository(new JsonFile('.composer/installed.json')) -)); +$rm->setLocalRepository(new Repository\FilesystemRepository(new JsonFile('.composer/installed.json'))); $rm->setRepository('Packagist', new Repository\ComposerRepository('http://packagist.org')); // initialize download manager @@ -33,7 +31,6 @@ $im->setInstaller('symfony-bundle', new Installer\LibraryInstaller('vendor/bundl $loader = new Package\Loader\JsonLoader(); $package = $loader->load(new JsonFile('composer.json')); - // init locker $locker = new Package\Locker(new JsonFile('composer.lock'), $rm); diff --git a/src/Composer/Command/InstallCommand.php b/src/Composer/Command/InstallCommand.php index b8718c50a..c9578a48b 100644 --- a/src/Composer/Command/InstallCommand.php +++ b/src/Composer/Command/InstallCommand.php @@ -74,8 +74,9 @@ EOT // prepare solver $installationManager = $composer->getInstallationManager(); $localRepo = $composer->getRepositoryManager()->getLocalRepository(); + $installedRepo = new Repository\PlatformRepository($localRepo); $policy = new DependencyResolver\DefaultPolicy(); - $solver = new DependencyResolver\Solver($policy, $pool, $localRepo); + $solver = new DependencyResolver\Solver($policy, $pool, $installedRepo); // solve dependencies $operations = $solver->solve($request); @@ -111,8 +112,6 @@ EOT $localRepo->write(); $output->writeln('> Generating autoload.php'); - $localRepo = new \Composer\Repository\FilesystemRepository( - new \Composer\Json\JsonFile('.composer/installed.json')); $generator = new AutoloadGenerator($localRepo, $composer->getPackage(), $installationManager); $generator->dump('.composer/autoload.php'); diff --git a/src/Composer/Package/Locker.php b/src/Composer/Package/Locker.php index 9e9631589..3d069af80 100644 --- a/src/Composer/Package/Locker.php +++ b/src/Composer/Package/Locker.php @@ -88,10 +88,6 @@ class Locker $name = $package->getName(); $version = $package->getVersion(); - if ('php' === $name || preg_match('{^ext-[a-z0-9_-]+$}', $name)) { - continue; - } - if (!$name || !$version) { throw new \LogicException(sprintf( 'Package "%s" has no version or name and can not be locked', $package diff --git a/src/Composer/Repository/PlatformRepository.php b/src/Composer/Repository/PlatformRepository.php index dd3b4bcce..cc51a6061 100644 --- a/src/Composer/Repository/PlatformRepository.php +++ b/src/Composer/Repository/PlatformRepository.php @@ -20,11 +20,11 @@ use Composer\Package\Version\VersionParser; /** * @author Jordi Boggiano */ -class PlatformRepository extends ArrayRepository implements WritableRepositoryInterface +class PlatformRepository extends ArrayRepository { private $localRepository; - public function __construct(WritableRepositoryInterface $localRepository) + public function __construct(RepositoryInterface $localRepository) { $this->localRepository = $localRepository; } @@ -65,28 +65,4 @@ class PlatformRepository extends ArrayRepository implements WritableRepositoryIn { return array_merge(parent::getPackages(), $this->localRepository->getPackages()); } - - /** - * {@inheritDoc} - */ - public function addPackage(PackageInterface $package) - { - $this->localRepository->addPackage($package); - } - - /** - * {@inheritDoc} - */ - public function removePackage(PackageInterface $package) - { - $this->localRepository->removePackage($package); - } - - /** - * {@inheritDoc} - */ - public function write() - { - $this->localRepository->write(); - } }