Merge branch '1.8'
commit
ba1e5c213c
|
@ -43,6 +43,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
private $driver;
|
||||
/** @var VersionCacheInterface */
|
||||
private $versionCache;
|
||||
private $emptyReferences = array();
|
||||
|
||||
public function __construct(array $repoConfig, IOInterface $io, Config $config, EventDispatcher $dispatcher = null, array $drivers = null, VersionCacheInterface $versionCache = null)
|
||||
{
|
||||
|
@ -117,6 +118,11 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
return $this->branchErrorOccurred;
|
||||
}
|
||||
|
||||
public function getEmptyReferences()
|
||||
{
|
||||
return $this->emptyReferences;
|
||||
}
|
||||
|
||||
protected function initialize()
|
||||
{
|
||||
parent::initialize();
|
||||
|
@ -159,6 +165,10 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
if ($cachedPackage) {
|
||||
$this->addPackage($cachedPackage);
|
||||
|
||||
continue;
|
||||
} elseif ($cachedPackage === false) {
|
||||
$this->emptyReferences[] = $identifier;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -174,6 +184,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
if ($verbose) {
|
||||
$this->io->writeError('<warning>Skipped tag '.$tag.', no composer file</warning>');
|
||||
}
|
||||
$this->emptyReferences[] = $identifier;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -212,6 +223,9 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
|
||||
$this->addPackage($this->loader->load($this->preProcess($driver, $data, $identifier)));
|
||||
} catch (\Exception $e) {
|
||||
if ($e instanceof TransportException) {
|
||||
$this->emptyReferences[] = $identifier;
|
||||
}
|
||||
if ($verbose) {
|
||||
$this->io->writeError('<warning>Skipped tag '.$tag.', '.($e instanceof TransportException ? 'no composer file was found' : $e->getMessage()).'</warning>');
|
||||
}
|
||||
|
@ -258,6 +272,10 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
if ($cachedPackage) {
|
||||
$this->addPackage($cachedPackage);
|
||||
|
||||
continue;
|
||||
} elseif ($cachedPackage === false) {
|
||||
$this->emptyReferences[] = $identifier;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -266,6 +284,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
if ($verbose) {
|
||||
$this->io->writeError('<warning>Skipped branch '.$branch.', no composer file</warning>');
|
||||
}
|
||||
$this->emptyReferences[] = $identifier;
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -284,6 +303,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
}
|
||||
$this->addPackage($package);
|
||||
} catch (TransportException $e) {
|
||||
$this->emptyReferences[] = $identifier;
|
||||
if ($verbose) {
|
||||
$this->io->writeError('<warning>Skipped branch '.$branch.', no composer file was found</warning>');
|
||||
}
|
||||
|
@ -352,6 +372,14 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|||
}
|
||||
|
||||
$cachedPackage = $this->versionCache->getVersionPackage($version, $identifier);
|
||||
if ($cachedPackage === false) {
|
||||
if ($verbose) {
|
||||
$this->io->writeError('<warning>Skipped '.$version.', no composer file (cached from ref '.$identifier.')</warning>');
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($cachedPackage) {
|
||||
$msg = 'Found cached composer.json of <info>' . ($this->packageName ?: $this->url) . '</info> (<comment>' . $version . '</comment>)';
|
||||
if ($verbose) {
|
||||
|
|
|
@ -17,7 +17,7 @@ interface VersionCacheInterface
|
|||
/**
|
||||
* @param string $version
|
||||
* @param string $identifier
|
||||
* @return array Package version data
|
||||
* @return array|null|false Package version data if found, false to indicate the identifier is known but has no package, null for an unknown identifier
|
||||
*/
|
||||
public function getVersionPackage($version, $identifier);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue