Skip to content
This repository has been archived by the owner on Mar 5, 2023. It is now read-only.

Commit

Permalink
Merge pull request #37 from 8fold/working
Browse files Browse the repository at this point in the history
Update ESGitHubClient.php
  • Loading branch information
joshbruce committed Jul 16, 2020
2 parents 0d48e63 + 929e015 commit 42332d6
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions src/ESGitHubClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,25 @@ public function __construct($main, ...$args)
$this->ghToken = $args[0];
$this->ghUsername = $args[1];
$this->ghRepo = $args[2];

if (isset($args[3]) and strlen($args[3]) > 0) {
$this->useCache = true;
$this->cacheRootPath = $args[3];
$this->cacheFolderName = $args[4];
}
}

public function plus(...$parts)
{
$path = $this->parts()->plus(...$parts)->join("/")->start("/");
return static::fold($path, $this->ghToken, $this->ghUsername, $this->ghRepo);
return static::fold(
$path,
$this->ghToken,
$this->ghUsername,
$this->ghRepo,
$this->cacheRootPath,
$this->cacheFolderName
);
}

public function client()
Expand Down Expand Up @@ -77,7 +90,14 @@ function($result, $cacheRootPath) use ($cacheFolderName) {
}
return "";
});
return $this;
return static::fold(
$this->value(),
$this->ghToken,
$this->ghUsername,
$this->ghRepo,
$this->cacheRootPath,
$this->cacheFolderName
);
}

public function exists()
Expand Down

0 comments on commit 42332d6

Please sign in to comment.