定制 mactronique/phpcache-bundle 二次开发

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

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

mactronique/phpcache-bundle

最新稳定版本:1.0.1

Composer 安装命令:

composer require mactronique/phpcache-bundle

包简介

Bundle wrapper for phpcache library

README 文档

README

Dependency Status Latest Stable Version Latest Unstable Version License

Install

php composer.phar require mactronique/phpcache-bundle "~1.0"

Configuration

Register Bundle

Add in your app/AppKernel.php :

new Mactronique\Bundle\PhpCacheBundle\MactroniquePhpCacheBundle(),

Write sementic configuration

Add in you app/config/config.yml

mactronique_php_cache:
    drivers:
        -
            name: xcache
        -
            name: redis
            options:
                    host: 127.0.0.1
                    port: 6379
                    password: ''
                    database: 1
                    timeout: 1
		-
			name: memcached
			options:
				-
					server: 127.0.0.1
					port: 11211
					sharing: 100
        -
            name: "null"

Use

In controller :

// Set value into key for 30 seconds
$this->get('mactronique_cache.phpcache')->set('key', 'value', 30);

// Set value into key
$this->get('mactronique_cache.phpcache')->set('key', 'value');

//get key
$this->get('mactronique_cache.phpcache')->get('key');

//check if key exists
$this->get('mactronique_cache.phpcache')->exists('key');

//remove key
$this->get('mactronique_cache.phpcache')->remove('key');

Contributing

Please fork main repo and send a pull request with your change.

Thanks your in advance !

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-07-22