• Stars
    star
    263
  • Rank 155,624 (Top 4 %)
  • Language
    PHP
  • Created over 14 years ago
  • Updated about 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A simple script for caching 3rd party API calls in PHP

PHP SimpleCache

The PHP SimpleCache Class is an easy way to cache 3rd party API calls.

Install

Install via composer:

{
    "require": {
        "gilbitron/php-simplecache": "~1.4"
    }
}

Run composer install then use as normal:

require 'vendor/autoload.php';
$cache = new Gilbitron\Util\SimpleCache();

Usage

A very basic usage example:

$cache = new Gilbitron\Util\SimpleCache();
$latest_tweet = $cache->get_data('tweet', 'http://search.twitter.com/search.atom?q=from:gilbitron&rpp=1');
echo $latest_tweet;

A more advanced example:

$cache = new Gilbitron\Util\SimpleCache();
$cache->cache_path = 'cache/';
$cache->cache_time = 3600;

if($data = $cache->get_cache('label')){
	$data = json_decode($data);
} else {
	$data = $cache->do_curl('http://some.api.com/file.json');
	$cache->set_cache('label', $data);
	$data = json_decode($data);
}

print_r($data);

Credits

PHP SimpleCache was created by Gilbert Pellegrom from Dev7studios. Released under the MIT license.

More Repositories

1

laravel-vue-pagination

A Vue.js pagination component for Laravel paginators
JavaScript
748
star
2

flexmasonry

A lightweight masonry (cascading grid layout) library powered by flexbox.
HTML
425
star
3

wp-rest-theme

A WordPress theme powered by the WordPress REST API and Vue.js
Vue
350
star
4

Splashify

Beautiful desktop wallpapers
Vue
287
star
5

Dropit

Dropit is a jQuery plugin for single level dropdown menu's
JavaScript
153
star
6

Arrest-MySQL

A "plug-n-play" RESTful API for your MySQL database.
PHP
131
star
7

Statusboard

A simple statusboard web app for Slack, Helpscout and GitHub powered by Lumen and React
PHP
100
star
8

Lean-Slider

A Lean and Progressive Free jQuery Image Slider
JavaScript
92
star
9

EasyCSRF

A simple, standalone CSRF protection library
PHP
91
star
10

PUF

PHP Utility Framework
PHP
75
star
11

Pico-Editor-Plugin

Provides an online Markdown editor and file manager for Pico.
JavaScript
58
star
12

Cardash

OBD-II dashobard for Raspberry Pi powered by Nodejs
JavaScript
47
star
13

WordPress-Plugin-Boilerplate

A simple boilerplate for your WordPress plugins.
PHP
40
star
14

ui-avatar-svg

Generate SVG avatars with user initials in pure JS
JavaScript
35
star
15

sqsd

A replica of the AWS Elastic Beanstalk worker SQS daemon (sqsd) in PHP
PHP
34
star
16

Handle

A static site generator powered by PHP and the command line
PHP
30
star
17

wordpress-skeleton

Template for using WordPress in a subdirectory managed by Composer
CSS
30
star
18

Nivo-Gallery

The world's most awesome jQuery Image Gallery
JavaScript
29
star
19

formstatic

HTML form processing for static websites.
PHP
27
star
20

Fitimg

A jQuery plugin to make images "fit" to their containers.
JavaScript
25
star
21

WordPress-Setup

Setting up individual WordPress installations has never been easier.
PHP
23
star
22

Raneto-Core

Core module for Raneto
JavaScript
21
star
23

world-cup-2018

Live World Cup 2018 scores in your menu bar
JavaScript
21
star
24

Pico-RSS-Plugin

Provides an RSS Feed for Pico.
PHP
20
star
25

spark-create-stripe-plans

A simple Laravel artisan command to create Spark plans in Stripe
PHP
18
star
26

Pil

A simple Javascript library for progressive image loading
JavaScript
18
star
27

Infiniscroll

A simple, jQuery, infinite-scroll plugin.
JavaScript
16
star
28

Laravel-App-Boilerplate

A Laravel 4 boilerplate package for creating web apps.
PHP
15
star
29

what-the-cron

A lightweight WordPress plugin that seeks to answer the question "is my WordPress cron running?"
PHP
13
star
30

TipTop

Stupidly simple jQuery tooltips. No fuss.
JavaScript
12
star
31

laravel-queue-monitor

A Laravel package to monitor queue jobs
PHP
10
star
32

laravel-migrate-to-branch

A Laravel Artisan command to rollback migrations before switching to a given branch
PHP
9
star
33

staticus

A static site generator in PHP powered by Laravel Blade.
Blade
8
star
34

php5.6-mysql

Docker container for running tests in PHP 5.6
Shell
6
star
35

changeloghub

Generate HTML changelogs from your GitHub commits
CSS
6
star
36

WordPress-to-Pico-Exporter

Exports WordPress posts to Markdown files for http://pico.dev7studios.com
PHP
6
star
37

WordPress-to-Dropplets-Exporter

Exports WordPress posts to Markdown files for http://dropplets.com
PHP
4
star
38

repotrends.dev

Weekly trending repositories on GitHub
Vue
4
star
39

CodeIgniter-Chrome-Logger

A CodeIgniter Chrome Logger helper.
PHP
4
star
40

Stripe-to-Xero

PHP CLI to convert Stripe exports to Xero compatible bank statements
PHP
4
star
41

Hoard

PHP caching done right
PHP
3
star
42

dotfiles

My personal .dotfiles
Shell
3
star
43

php7.0-mysql

Docker container for running tests in PHP 7.0
Shell
2
star
44

laravel-cloud-config

A cloud-config file for local Laravel development. Designed to be used with Ubuntu Multipass.
DIGITAL Command Language
2
star
45

traefik-laravel

This is a simple Traefik proxy setup for running multiple Laravel Sail instances.
1
star
46

photo-stream

A stupidly simple website generator for your photos
PHP
1
star
47

SplashifySite

https://splashify.net
HTML
1
star
48

local-ca

A simple tool to create locally trusted development certificates
PHP
1
star