urbanindo/yii2-elasticmemcache

Yii2 component for elastic memcache without node discovery plugin

1.0.1 2015-08-19 06:56 UTC

This package is auto-updated.

Last update: 2020-07-22 07:21:24 UTC


README

Yii2 component for AWS Elasticache Memcache without node discovery plugin

Latest Stable Version Total Downloads Latest Unstable Version Build Status

Installation

The preferred way to install this extension is through composer.

Either run

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

or add

"urbanindo/yii2-elasticmemcache": "*"

to the require section of your composer.json file.

Usage

'components' => [
    'cache' => [
	    'class' => UrbanIndo\Yii2\ElasticMemcache\Cache::class,
	    'serverConfigs' => [
	        [
	                'host' => 'CacheClusterConfiguration1.cache.amazonaws.com', // modify this
	                'port' => 11211,
	                'weight' => 60,
	        ],
	        [
	                'host' => 'CacheClusterConfiguration2.cache.amazonaws.com', // modify this
	                'port' => 11211,
	                'weight' => 40,
	        ]
	    ],
	    'cache' => [
	    	'class' => yii\caching\FileCache::class
	    ]
    ]
]

Running Test

  • copy test/template-local.php to local.php
  • modify it to your aws elasticache configuration
  • run vendor/bin/phpunit --bootstrap test/bootstrap.php test/CacheTest