src/Composer/Repository/Vcs/GitHubDriver.php
public function getComposerInformation($identifier)
    {
        if ($this->gitDriver) {
            return $this->gitDriver->getComposerInformation($identifier);
        }

        if (!isset($this->infoCache[$identifier])) {
            if ($this->shouldCache($identifier) && $res = $this->cache->read($identifier)) {
                return $this->infoCache[$identifier] = JsonFile::parseJson($res);
            }

            $composer = $this->getBaseComposerInformation($identifier);

            if ($composer) {
                // specials for github
                if (!isset($composer['support']['source'])) {
                    $label = array_search($identifier, $this->getTags()) ?: array_search($identifier, $this->getBranches()) ?: $identifier;
                    $composer['support']['source'] = sprintf('https://%s/%s/%s/tree/%s', $this->originUrl, $this->owner, $this->repository, $label);
                }
                if (!isset($composer['support']['issues']) && $this->hasIssues) {
                    $composer['support']['issues'] = sprintf('https://%s/%s/%s/issues', $this->originUrl, $this->owner, $this->repository);
                }
            }

            if ($this->shouldCache($identifier)) {
                $this->cache->write($identifier, json_encode($composer));
            }

            $this->infoCache[$identifier] = $composer;
        }

        return $this->infoCache[$identifier];
    }
public function getComposerInformation($identifier)
    {
        if ($this->gitDriver) {
            return $this->gitDriver->getComposerInformation($identifier);
        }

        if (!isset($this->infoCache[$identifier])) {
            if ($this->shouldCache($identifier) && $res = $this->cache->read($identifier)) {
                return $this->infoCache[$identifier] = JsonFile::parseJson($res);
            }

            $composer = $this->getBaseComposerInformation($identifier);

            if ($composer) {
                // specials for github
                if (!isset($composer['support']['source'])) {
                    $label = array_search($identifier, $this->getTags()) ?: array_search($identifier, $this->getBranches()) ?: $identifier;
                    $composer['support']['source'] = sprintf('https://%s/%s/%s/tree/%s', $this->originUrl, $this->owner, $this->repository, $label);
                }
                if (!isset($composer['support']['issues']) && $this->hasIssues) {
                    $composer['support']['issues'] = sprintf('https://%s/%s/%s/issues', $this->originUrl, $this->owner, $this->repository);
                }
            }

            if ($this->shouldCache($identifier)) {
                $this->cache->write($identifier, json_encode($composer));
            }

            $this->infoCache[$identifier] = $composer;
        }

        return $this->infoCache[$identifier];
    }
public function getComposerInformation ( $ identifier ) { if ( $ this -> gitDriver ) { return $ this -> gitDriver -> getComposerInformation ( $ identifier ) ; } if ( ! isset ( $ this -> infoCache [ $ identifier ] ) ) { if ( $ this -> shouldCache ( $ identifier ) && $ res = $ this -> cache -> read ( $ identifier ) ) { return $ this -> infoCache [ $ identifier ] = JsonFile :: parseJson ( $ res ) ; } $ composer = $ this -> getBaseComposerInformation ( $ identifier ) ; if ( $ composer ) { // specials for github if ( ! isset ( $ composer [ 'support' ] [ 'source' ] ) ) { $ label = array_search ( $ identifier , $ this -> getTags ( ) ) ? : array_search ( $ identifier , $ this -> getBranches ( ) ) ? : $ identifier ; $ composer [ 'support' ] [ 'source' ] = sprintf ( 'https://%s/%s/%s/tree/%s' , $ this -> originUrl , $ this -> owner , $ this -> repository , $ label ) ; } if ( ! isset ( $ composer [ 'support' ] [ 'issues' ] ) && $ this -> hasIssues ) { $ composer [ 'support' ] [ 'issues' ] = sprintf ( 'https://%s/%s/%s/issues' , $ this -> originUrl , $ this -> owner , $ this -> repository ) ; } } if ( $ this -> shouldCache ( $ identifier ) ) { $ this -> cache -> write ( $ identifier , json_encode ( $ composer ) ) ; } $ this -> infoCache [ $ identifier ] = $ composer ; } return $ this -> infoCache [ $ identifier ] ; }
{@inheritDoc}
{