Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Caffe1neAdd1ct authored Apr 2, 2019
2 parents 37c8ddf + bd6a129 commit 841d3ef
Showing 1 changed file with 2 additions and 17 deletions.
19 changes: 2 additions & 17 deletions src/Netresearch/Composer/Patches/Downloader/Composer.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@ class Composer implements DownloaderInterface {
*/
protected $remoteFileSystem;

/**
* Very simple cache system
* @var array
*/
protected $cache = array();

/**
* Construct the RFS
*
Expand Down Expand Up @@ -69,13 +63,8 @@ protected function resolveVendorPath($url) {
* @return string Contents of the URL
*/
public function getContents($url) {
if (array_key_exists($url, $this->cache)) {
return $this->cache[$url];
}

$path = $this->resolveVendorPath($url);

return $this->cache[$url] = $this->remoteFileSystem->getContents($this->getOriginUrl($url), $path, false);
return $this->cache[$url] = $this->remoteFileSystem->getContents($this->getOriginUrl($url), $path, false);
}

/**
Expand All @@ -85,12 +74,8 @@ public function getContents($url) {
* @return stdClass
*/
public function getJson($url) {
$key = 'json://' . $url;
if (array_key_exists($key, $this->cache)) {
return $this->cache[$key];
}
$json = new \Composer\Json\JsonFile($url, $this->remoteFileSystem);
return $this->cache[$key] = $json->read();
return $json->read();
}
}
?>

0 comments on commit 841d3ef

Please sign in to comment.