|
|
|
@ -47,6 +47,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, HttpDownloader $httpDownloader, EventDispatcher $dispatcher = null, array $drivers = null, VersionCacheInterface $versionCache = null)
|
|
|
|
|
{
|
|
|
|
@ -123,6 +124,11 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|
|
|
|
return $this->branchErrorOccurred;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getEmptyReferences()
|
|
|
|
|
{
|
|
|
|
|
return $this->emptyReferences;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected function initialize()
|
|
|
|
|
{
|
|
|
|
|
parent::initialize();
|
|
|
|
@ -165,6 +171,10 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|
|
|
|
if ($cachedPackage) {
|
|
|
|
|
$this->addPackage($cachedPackage);
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
} elseif ($cachedPackage === false) {
|
|
|
|
|
$this->emptyReferences[] = $identifier;
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -180,6 +190,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|
|
|
|
if ($verbose) {
|
|
|
|
|
$this->io->writeError('<warning>Skipped tag '.$tag.', no composer file</warning>');
|
|
|
|
|
}
|
|
|
|
|
$this->emptyReferences[] = $identifier;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -218,6 +229,9 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|
|
|
|
|
|
|
|
|
$this->addPackage($this->loader->load($this->preProcess($driver, $data, $identifier)));
|
|
|
|
|
} catch (\Exception $e) {
|
|
|
|
|
if ($e instanceof TransportException && $e->getCode() === 404) {
|
|
|
|
|
$this->emptyReferences[] = $identifier;
|
|
|
|
|
}
|
|
|
|
|
if ($verbose) {
|
|
|
|
|
$this->io->writeError('<warning>Skipped tag '.$tag.', '.($e instanceof TransportException ? 'no composer file was found' : $e->getMessage()).'</warning>');
|
|
|
|
|
}
|
|
|
|
@ -264,6 +278,10 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|
|
|
|
if ($cachedPackage) {
|
|
|
|
|
$this->addPackage($cachedPackage);
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
} elseif ($cachedPackage === false) {
|
|
|
|
|
$this->emptyReferences[] = $identifier;
|
|
|
|
|
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -272,6 +290,7 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|
|
|
|
if ($verbose) {
|
|
|
|
|
$this->io->writeError('<warning>Skipped branch '.$branch.', no composer file</warning>');
|
|
|
|
|
}
|
|
|
|
|
$this->emptyReferences[] = $identifier;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -290,6 +309,9 @@ class VcsRepository extends ArrayRepository implements ConfigurableRepositoryInt
|
|
|
|
|
}
|
|
|
|
|
$this->addPackage($package);
|
|
|
|
|
} catch (TransportException $e) {
|
|
|
|
|
if ($e->getCode() === 404) {
|
|
|
|
|
$this->emptyReferences[] = $identifier;
|
|
|
|
|
}
|
|
|
|
|
if ($verbose) {
|
|
|
|
|
$this->io->writeError('<warning>Skipped branch '.$branch.', no composer file was found</warning>');
|
|
|
|
|
}
|
|
|
|
@ -358,6 +380,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) {
|
|
|
|
|