/** * Initializes or retrieves the cache object * @return Cache object */ public static function open() { if (null == self::$instance) { self::$instance = new self(); } return self::$instance; }
/** * Retrieves a commit by sha from the GitHub API * * @param string $sha * * @return mixed */ public function get_commit($sha) { if (!$this->oauth_token() || !$this->repository()) { return false; } if ($cache = Cache::open()->get('commits', $sha)) { return $cache; } return Cache::open()->save('commits', $sha, $this->call('GET', $this->commit_endpoint() . '/' . $sha)); }