承接 bnomei/kirby3-mysql-cachedriver 相关项目开发

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

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

bnomei/kirby3-mysql-cachedriver

最新稳定版本:1.3.2

Composer 安装命令:

composer require bnomei/kirby3-mysql-cachedriver

包简介

MySQL based Cache-Driver

README 文档

README

Release Discord Buymecoffee

Dolphin - a MySQL Cache Driver for Kirby

Installation

  • unzip master.zip as folder site/plugins/kirby3-mysql-cachedriver or
  • git submodule add https://github.com/bnomei/kirby3-mysql-cachedriver.git site/plugins/kirby3-mysql-cachedriver or
  • composer require bnomei/kirby3-mysql-cachedriver

Usage

Cache methods

$cache = \Bnomei\MySQLCache::singleton(); // or
$cache = dolphin();

$cache->set('key', 'value', $expireInMinutes);
$value = dolphin()->get('key', $default);

dolphin()->remove('key');
dolphin()->flush();

Benchmark

dolphin()->benchmark(1000);
mysql : 0.03287492121384
file : 0.11837792396545

ATTENTION: This will create and remove a lot of cache files and SQLite entries

No cache when debugging

When Kirbys global debug config is set to true the complete plugin cache will be flushed and no caches will be read. But entries will be created.

How to use MySQL Cache with Lapse or Boost

You need to set the cache driver for the lapse plugin to mysql.

site/config/config.php

<?php
return [
    'bnomei.lapse.cache' => ['type' => 'mysql'],
    'bnomei.boost.cache' => ['type' => 'mysql'],
    //... other options
];

Setup Content-File Cache

Use Kirby Boost to setup a cache for content files.

Settings

You can set the host, dbname, username, password,... in the config.

site/config/config.php

return [
    // other config settings ...
    'bnomei.mysql-cachedriver.dbname' => 'YOUR-DBNAME-HERE',
    'bnomei.mysql-cachedriver.username' => 'YOUR-USERNAME-HERE',
    'bnomei.mysql-cachedriver.password' => 'YOUR-PASSWORD-HERE',
];

You can also set a callback if you use the dotenv Plugin.

site/config/config.php

return [
    // other config settings ...
    'bnomei.mysql-cachedriver.dbname' => function() { return env('MYSQL_DBNAME'); },
    'bnomei.mysql-cachedriver.username' => function() { return env('MYSQL_USERNAME'); },
    'bnomei.mysql-cachedriver.password' => function() { return env('MYSQL_PASSWORD'); },
];
bnomei.mysql-cachedriver. Default Description
store true keep accessed cache items stored in PHP memory for faster recurring access
store-ignore `` if key contains that string then ignore
transaction.limit 4096 exec transaction after n SET operations
host 127.0.0.1 string or callback
unix_socket null string or callback
dbname kirby3-mysql-cachedriver string or callback (will be created if it does not exists)
tablename kirby3-mysql-cachedriver string or callback (will be created if it does not exists)
username root string or callback
password `` string or callback
port 3306 int or callback

Dependencies

  • PHP MySQL extension

Disclaimer

This plugin is provided "as is" with no guarantee. Use it at your own risk and always test it yourself before using it in a production environment. If you find any issues, please create a new issue.

License

MIT

It is discouraged to use this plugin in any project that promotes racism, sexism, homophobia, animal abuse, violence or any other form of hate speech.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2021-12-28

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固