承接 vitrexphp/cache 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

vitrexphp/cache

Composer 安装命令:

composer require vitrexphp/cache

包简介

Multiple Cache Component for PHP

关键字:

README 文档

README

Version License Donate to this project using PayPal

OVERVIEW

This is a simple PHP Cache Abstraction Layer for PHP 7.4 that provides a simple interaction with several cache mechanism.

Vitrex PHP Cache provides the ability to cache frequently accessed content via several different adapters. Depending on the server environment and what's available, an application can use one of the following cache adapters:

  • File (directory on disk)
  • Memcache (cache service)
  • Session (short-term caching in session)

INSTALL

Download the latest version from here.

Install Vitrex PHP Cache using Composer.

composer require vitrexphp/cache

BASIC USAGE

Setting up the different cache object adapters

<?php

use Vitrex\Cache\Cache;
use Vitrex\Cache\Adapter;

$File = new Adapter\File(__DIR__);
$Session = new Adapter\Session();
$MemCached = new Adapter\Memcached();

/* Then inject one of the adapters into the main cache object */
$Cache = new Cache($File);

Save and load data from cache

Once a cache object is created, you can simply save and load data from it like below:

<?php
if (($cacheData = $Cache->load('Foo')) === false) {
	$cacheData = [
		'Name'     => 'Vitrex PHP Cache',
		'Class'    => Cache::class,
		'LifeTime' => Adapter\Adapter::LIFE_TIME_1_WEEK,
		'Foo'      => 'Bar'
	];
	$Cache->save('Foo', $cacheData, '1 WEEK');
}
var_dump($cacheData);
?>

Deleting cache file

$Cache->delete('Foo');

Clear all cache files

$Cache->clearAll();

SUPPORT

For support please visit: Github | Issues For donations please visit: PayPal For professional support please contact by e-mail.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-20

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固