承接 00f100/fcphp-cache 相关项目开发

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

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

00f100/fcphp-cache

Composer 安装命令:

composer require 00f100/fcphp-cache

包简介

Cache Index for FcPhp

README 文档

README

Package to manage Cache Index and crypto content using Sodium PHP (optional)

Build Status codecov Total Downloads

How to install

Composer:

$ composer require 00f100/fcphp-cache

or add in composer.json

{
    "require": {
        "00f100/fcphp-cache": "*"
    }
}

How to use

<?php

use FcPhp\Cache\Facades\CacheFacade;
use FcPhp\Crypto\Crypto;

/**
 * Method to create new instance of Cache
 *
 * @param string|array $cacheRepository Configuration of redis or path to save files cache
 * @param string $nonce Nonce to use crypto into content of cache. To generate: \FcPhp\Crypto\Crypto::getNonce()
 * @param string $pathKeys Path to save keys crypto
 * @return FcPhp\Cache\Interfaces\ICache
 */
$cache = CacheFacade::getInstance(string|array $cacheRepository, string $nonce = null, string $pathKeys = null);

/*
    To use with Redis
    =========================
*/
$redis = [
    'host' => '127.0.0.1',
    'port' => '6379',
    'password' => null,
    'timeout' => 100,
];
$cache = CacheFacade::getInstance($redis);
/*
    To use with Redis and crypto
    =========================
*/
$redis = [
    'host' => '127.0.0.1',
    'port' => '6379',
    'password' => null,
    'timeout' => 100,
];
$cache = CacheFacade::getInstance($redis, Crypto::getNonce(), 'path/to/keys');

/*
    To use with file
    =========================
*/
$cache = CacheFacade::getInstance('path/to/cache');

/*
    To use with file and crypto
    =========================
*/
$cache = CacheFacade::getInstance('path/to/cache', Crypto::getNonce(), 'path/to/keys');

/**
 * Method to create new cache
 *
 * @param string $key Key to name cache
 * @param mixed $content Content to cache
 * @param int $ttl time to live cache
 * @return FcPhp\Cache\Interfaces\ICache
 */
$cache->set(string $key, $content, int $ttl) :ICache

/**
 * Method to verify if cache exists
 *
 * @param string $key Key to name cache
 * @return bool
 */
$cache->has(string $key) :bool

/**
 * Method to verify/read cache
 *
 * @param string $key Key to name cache
 * @return mixed
 */
$cache->get(string $key)

/**
 * Method to delete cache
 *
 * @param string $key Key to name cache
 * @return void
 */
$cache->delete(string $key) :void

/**
 * Method to clean old caches
 *
 * @return FcPhp\Cache\Interfaces\ICache
 */
$cache->clean() :ICache

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2018-06-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固