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