palanik/slim-apc-cache

Cache Middleware for PHP Slim micro framework using APC Cache

0.0.2 2015-02-09 01:57 UTC

This package is auto-updated.

Last update: 2024-10-24 13:11:54 UTC


README

Latest Stable Version License

Cache Middleware for PHP Slim micro framework using APC Cache

How to Install

  1. Update your composer.json to require the palanik/slim-apc-cache package.
  2. Run composer install to add SlimAPCCache your vendor folder.
{
  "require": {
    "palanik/slim-apc-cache": "0.0.2.*"
  }
}

##How to Use this Middleware

<?php
require ('./vendor/autoload.php');

$app = new \Slim\Slim();

use palanik\SlimAPCCache\SlimAPCCache;

$app->add(new SlimAPCCache(array(
			'ttl' => 60,
			'caching_prefix' => 'myapp_',
			)));
			
$app->get('/foo', function () use ($app) {
    echo "Hello Bar";
});

$app->run();
?>