X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=app%2FGithub%2FAPI.php;h=e56ada1ecb3941079ddf9a176a07130cc08ccabd;hb=8b207c90c6c49876775ab61908f45510baf9981a;hp=1c9ff7834e772a92cc8fb758bb8701bfaae6bf88;hpb=36cfa28cf2dcee3422f0231f91c6692eb28e7824;p=pharext%2Fpharext.org diff --git a/app/Github/API.php b/app/Github/API.php index 1c9ff78..e56ada1 100644 --- a/app/Github/API.php +++ b/app/Github/API.php @@ -49,7 +49,8 @@ class API function __construct(Config $config, LoggerInterface $logger, Storage $tokens = null, Storage $cache = null) { $this->logger = $logger; $this->config = $config; - $this->client = new Client; + $this->client = new Client("curl", "github"); + $this->client->configure($config->http->configure->toArray()); $this->client->attach(new ClientObserver($logger)); $this->tokens = $tokens ?: new Storage\Session; $this->cache = $cache; @@ -223,7 +224,12 @@ class API $call = new API\Releases\CreateRelease($this, compact("repo", "tag")); return $call($callback); } - + + function publishRelease($repo, $id, $tag, callable $callback) { + $call = new API\Releases\PublishRelease($this, compact("repo", "id", "tag")); + return $call($callback); + } + function createReleaseAsset($url, $asset, $type, callable $callback) { $call = new API\Releases\CreateReleaseAsset($this, compact("url", "asset", "type")); return $call($callback);