<commit_before><?php
namespace app\controllers;
use yii\web\Controller;
use yii\web\cache;

class CacheController extends Controller{
	protected $cache;
	protected $value = null;
	protected $key = null;
	public function _init(){
		$this->cache = \YII::$app->cache;

		$this->value = isset($_GET['value'])?$_GET['value']:'hello';
		$this->key = isset($_GET['key'])?$_GET['key']:'key';
	}
	//添加缓存
	public function actionAdd(){
		$this->cache->add($this->key,$this->value);
	}
	//修改缓存，如果缓存已存在则忽略
	public function actionSet(){
		$this->cache->set($this->key,$this->value);
	}
	//获取缓存
	public function actionGet(){
		$data = $this->cache->get($this->key);
		var_dump($data);
	}
	//删除缓存
	public function actionDel(){
		$this->cache->delete($this->key);
	}
	//清空缓存
	public function actionFlush(){
		$this->cache->flush();
	}
}<commit_msg>cache<commit_after><?php
namespace app\controllers;
use yii\web\Controller;
use yii\web\cache;

class CacheController extends Controller{
	protected $cache;
	protected $value = null;
	protected $key = null;
	public function _init(){
		$this->cache = \YII::$app->cache;

		$this->value = isset($_GET['value'])?$_GET['value']:'hello';
		$this->key = isset($_GET['key'])?$_GET['key']:'key';
	}
	//添加缓存，如果缓存已存在则覆盖
	public function actionAdd(){
		$this->cache->add($this->key,$this->value);
	}
	//修改或添加缓存，如果缓存已存在则忽略
	public function actionSet(){
		$this->cache->set($this->key,$this->value);
	}
	//获取缓存
	public function actionGet(){
		$data = $this->cache->get($this->key);
		var_dump($data);
	}
	//删除缓存
	public function actionDel(){
		$this->cache->delete($this->key);
	}
	//清空缓存
	public function actionFlush(){
		$this->cache->flush();
	}
}
{'fraction_non_alphanumeric': 0.21282973621103118, 'fraction_numerical': 0.0, 'mean_word_length': 4.815331010452962, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '339458', 'n_tokens_mistral': 657, 'n_tokens_neox': 679, 'n_words': 110}