Skip to content

Instantly share code, notes, and snippets.

View holabene's full-sized avatar

Bene holabene

View GitHub Profile
@holabene
holabene / guzzle-cache-plugin.php
Last active January 23, 2020 15:57
Guzzle cache that actually works..
<?php
/**
* Caching to filesystem using ZendCache
* Cache as much as possible, very convenient for dev (default ttl = 3600)
*/
use Guzzle\Http\Client;
use Guzzle\Plugin\Cache\CachePlugin;
use Guzzle\Plugin\Cache\SkipRevalidation;
use Guzzle\Plugin\Cache\DefaultCacheStorage;
@holabene
holabene / Controller.php
Created October 20, 2017 15:42
Concept controller
<?php
class Controller
{
protected $user;
protected $service;
public function __construct(User $user, Service $service)
{
$this->user = $user;