2017 © Pedro Peláez
 

library php-simplecache

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

image

gilbitron/php-simplecache

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

  • Monday, January 15, 2018
  • by gilbitron
  • Repository
  • 28 Watchers
  • 227 Stars
  • 9,332 Installations
  • PHP
  • 6 Dependents
  • 0 Suggesters
  • 48 Forks
  • 0 Open issues
  • 5 Versions
  • 17 % Grown

The README.md

PHP SimpleCache

The PHP SimpleCache Class is an easy way to cache 3rd party API calls., (*1)

Install

Install via composer:, (*2)

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

Run composer install then use as normal:, (*3)

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

Usage

A very basic usage example:, (*4)

$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:, (*5)

$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., (*6)

The Versions

15/01 2018

dev-master

9999999-dev https://github.com/gilbitron/PHP-SimpleCache

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cache simplecache

17/01 2017

1.4.2

1.4.2.0 https://github.com/gilbitron/PHP-SimpleCache

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cache simplecache

15/07 2014

1.4.1

1.4.1.0 https://github.com/gilbitron/PHP-SimpleCache

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cache simplecache

15/07 2014

1.4.0

1.4.0.0 https://github.com/gilbitron/PHP-SimpleCache

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cache simplecache

25/03 2014

1.3.0

1.3.0.0 https://github.com/gilbitron/PHP-SimpleCache

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

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

cache simplecache