2017 © Pedro Peláez
 

library php-file-cache

Light, simple and standalone PHP in-file caching class

image

wruczek/php-file-cache

Light, simple and standalone PHP in-file caching class

  • Saturday, January 20, 2018
  • by Wruczek
  • Repository
  • 2 Watchers
  • 3 Stars
  • 44 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 5 Versions
  • 19 % Grown

The README.md

Deprecation notice

This project is not in active development. Issues remain with cache files sometimes being saved with invalid data and unable to be read (see: issue #3 and #4). The API is confusing and a rewrite would be necessary (for example renaming "retrive" function to "get", "store" to "set" etc.)., (*1)

A community fork has been created, with authors planning on continuing the devlopment., (*2)

Check out a maintaned community fork: https://github.com/flightphp/PHP-File-Cache

PHP-File-Cache Latest Stable Version Latest Unstable Version License

Light, simple and standalone PHP in-file caching class, (*3)

Advantages

  • Light, standalone and simple
  • All code in one file - no pointless drivers.
  • Secure - every generated cache file have a php header with die, making direct access impossible even if someone knows the path and your server is not configured properly
  • Well documented and tested
  • Handles concurrency correctly via flock
  • Supports PHP 5.4.0 - 7.1+
  • Free under a MIT license

Requirements and Installation

You need PHP 5.4.0+ for usage and PHP 5.6+ for development (PHPUnit), (*4)

Require with composer:
composer require wruczek/php-file-cache, (*5)

Usage

<?php
use Wruczek\PhpFileCache\PhpFileCache;
require_once __DIR__ . "/vendor/autoload.php";

$cache = new PhpFileCache();

$data = $cache->refreshIfExpired("simple-cache-test", function () {
    return date("H:i:s"); // return data to be cached
}, 10);

echo "Latest cache save: $data";

See examples for more, (*6)

The Versions

20/01 2018

dev-master

9999999-dev

Light, simple and standalone PHP in-file caching class

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

20/01 2018

0.0.4

0.0.4.0

Light, simple and standalone PHP in-file caching class

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

18/01 2018

0.0.3

0.0.3.0

Light, simple and standalone PHP in-file caching class

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

30/11 2017

0.0.2

0.0.2.0

Light, simple and standalone PHP in-file caching class

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

26/11 2017

0.0.1

0.0.1.0

Light, simple and standalone PHP in-file caching class

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires