定制 cleardevice/slim-middleware-apc-cache 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

cleardevice/slim-middleware-apc-cache

Composer 安装命令:

composer require cleardevice/slim-middleware-apc-cache

包简介

Cache Middleware for PHP Slim 2.* micro framework using APCu Cache with response ttl setup

README 文档

README

Latest Stable Version License

Cache Middleware for PHP Slim 2.* micro framework using APCu Cache

Main idea from https://github.com/palanik/SlimAPCCache

How to Install

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

##How to Use this Middleware

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

$app = new \Slim\Slim();

use cleardevice\SlimMiddlewareAPCCache\SlimMiddlewareAPCCache;

$app->add(new SlimMiddlewareAPCCache(60, 'myapp_prefix_');

$app->get('/foo_1', function () use ($app) {
    echo "Hello Bar, default ttl";
});

$app->get('/foo_2', function () use ($app) {
    echo "Hello Bar, custom cache ttl";
    $this->app->container->set(SlimMiddlewareAPCCache::TTL_KEY, 3600);
});

$app->get('/foo_3', function () use ($app) {
    echo "Hello Bar, no cache";
    $this->app->container->set(SlimMiddlewareAPCCache::TTL_KEY, SlimMiddlewareAPCCache::TTL_NO_CACHE);
});

$app->get('/foo_4', function () use ($app) {
    echo "Hello Bar, permanent cache";
    $this->app->container->set(SlimMiddlewareAPCCache::TTL_KEY, SlimMiddlewareAPCCache::TTL_PERMANENT_CACHE);
});

$app->run();
?>

统计信息

  • 总下载量: 47
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-04-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固