Add InstalledArrayRepository to make sure the root package is not purged by the Pool because of a lower stability
parent
ef28f3b067
commit
fabf5c2f6d
|
@ -29,6 +29,7 @@ use Composer\Package\Locker;
|
||||||
use Composer\Package\PackageInterface;
|
use Composer\Package\PackageInterface;
|
||||||
use Composer\Repository\ArrayRepository;
|
use Composer\Repository\ArrayRepository;
|
||||||
use Composer\Repository\CompositeRepository;
|
use Composer\Repository\CompositeRepository;
|
||||||
|
use Composer\Repository\InstalledArrayRepository;
|
||||||
use Composer\Repository\PlatformRepository;
|
use Composer\Repository\PlatformRepository;
|
||||||
use Composer\Repository\RepositoryInterface;
|
use Composer\Repository\RepositoryInterface;
|
||||||
use Composer\Repository\RepositoryManager;
|
use Composer\Repository\RepositoryManager;
|
||||||
|
@ -139,7 +140,7 @@ class Installer
|
||||||
$repos = array_merge(
|
$repos = array_merge(
|
||||||
$this->repositoryManager->getLocalRepositories(),
|
$this->repositoryManager->getLocalRepositories(),
|
||||||
array(
|
array(
|
||||||
new ArrayRepository(array($this->package)),
|
new InstalledArrayRepository(array($this->package)),
|
||||||
new PlatformRepository(),
|
new PlatformRepository(),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
/*
|
||||||
|
* This file is part of Composer.
|
||||||
|
*
|
||||||
|
* (c) Nils Adermann <naderman@naderman.de>
|
||||||
|
* Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
*
|
||||||
|
* For the full copyright and license information, please view the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Composer\Repository;
|
||||||
|
|
||||||
|
use Composer\Json\JsonFile;
|
||||||
|
use Composer\Package\PackageInterface;
|
||||||
|
use Composer\Package\Loader\ArrayLoader;
|
||||||
|
use Composer\Package\Dumper\ArrayDumper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Installed array repository.
|
||||||
|
*
|
||||||
|
* This is used for serving the RootPackage inside an in-memory InstalledRepository
|
||||||
|
*
|
||||||
|
* @author Jordi Boggiano <j.boggiano@seld.be>
|
||||||
|
*/
|
||||||
|
class InstalledArrayRepository extends ArrayRepository implements InstalledRepositoryInterface
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
public function write()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
public function reload()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue