定制 urbanindo/yii2-s3cache 二次开发

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

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

urbanindo/yii2-s3cache

最新稳定版本:1.1.0

Composer 安装命令:

composer require urbanindo/yii2-s3cache

包简介

Yii2 Component for Caching in S3

README 文档

README

File caching component for Yii2 using AWS Simple Storage Service

Latest Stable Version Total Downloads Latest Unstable Version

This is intended for large and long-lived objects.

Requirement

  • PHP >= 5.5
  • AWS SDK >= 3.28.0

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist urbanindo/yii2-s3cache "*"

or add

"urbanindo/yii2-s3cache": "*"

to the require section of your composer.json file.

Setting Up

Add the component in the configuration.

'components' => [
    's3Cache' => [
        'class' => 'UrbanIndo\Yii2\S3Cache\Cache',
        'bucket' => 'mybucket',
        'cachePrefix' => '123456',
        'config' => [
            'key' => 'AKIA1234567890123456',
            'secret' => '1234567890123456789012345678901234567890',
            'region' => 'ap-southeast-1',
        ],
    ]
]

Usage

This is similar like regular data caching.

$cache = Yii::$app->get('s3Cache');
// try retrieving $data from cache
$data = $cache->get($key);

if ($data === false) {

    // $data is not found in cache, calculate it from scratch

    // store $data in cache so that it can be retrieved next time
    $cache->set($key, $data);
}

// $data is available here

统计信息

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

GitHub 信息

  • Stars: 2
  • Watchers: 5
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-25