hal-platform / hal

:shipit: Hal Deployment Platform - Web UI/API
MIT License
18 stars 4 forks source link

Update to knplabs github api 2.0 #4

Closed skluck closed 7 years ago

skluck commented 7 years ago

Github API package updated to 2.0 which supports newer versions of guzzle - https://github.com/KnpLabs/php-github-api

nagibyro commented 7 years ago

knplabs github 2.0 uses HTTP Plug -- The caching for the github client is now a PSR-6 cache object as it just uses the cache plugin under the hood. The good news is that the cache key is created off the http method and the PSR7 UriInterface -- which will include the query parameters. So we won't need to extend the client with our own caching. However since MCP-Cache is not PSR6 compatible we would need to pull in a different cache library.

For cache we can either pull in another caching library that uses predis and PSR6 interfaces this one seems like a good candidate -- or we write our own HTTP Plugin that uses MCP cache. We'd have to add the cache plugin manually to the client and would not be able to use the addCache() or removeCache() methods on the github client.

skluck commented 7 years ago

Maybe writing our own PSR-12 cache plugin for http plug is the way to go. I say give that a shot first. It's just a few hundred lines of code and we would just need to change cache item usage to the simpler PSR-12 interface.

https://github.com/php-http/cache-plugin

nagibyro commented 7 years ago

PR's opened for the Agent and UI

skluck commented 7 years ago

Merged into master