定制 validus/cache 二次开发

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

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

validus/cache

Composer 安装命令:

composer require validus/cache

包简介

Provides cache for your Expressive project.

README 文档

README

Provides caching implementations for zend expressive projects.

Packagist GitHub license Build Status Scrutinizer Code Quality Code Intelligence Status Coverage Status

PSR-6 and PSR-16 Cache factories for PSR-11 with Zend configuration provider.

Installation

The easiest way to install this package is through composer:

$ composer require validus/cache

Configuration

A complete example configuration can be found in example/full-config.php. Please note that the values in there are the defaults, and don't have to be supplied when you are not changing them. Keep your own configuration as minimal as possible. A minimal configuration can be found in example/simple-config.php

If your application uses the zend-component-installer Composer plugin, your configuration is complete; the shipped Validus\Cache\ConfigProvider registers the cache service.

Accessing the cache adapter

you can access the cache implementation via the container :

use Psr\Cache\CacheItemPoolInterface;
use Psr\SimpleCache\CacheInterface;

// $pool instanceof CacheItemPoolInterface
$pool = $container->get(CacheItemPoolInterface::class);

// $cache instanceof CacheInterface
$cache = $container->get(CacheInterface::class);

Middleware

Validus cache package comes with a CacheResetMiddleware, allowing you to reset the cache pool to its initial status after every request.

you can add the middleware to your config/pipeline.php file like this :

    $app->pipe(\Validus\Cache\Middleware\CacheResetMiddleware::class);

a factory for the middleware is already provided in the config provider so you don't have to worry about that as long as you are using zend-component-installer composer plugin.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-10-06

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固