<commit_before><?php namespace Illuminate\Cache;

class WinCacheStore extends Store {

	/**
	 * A string that should be prepended to keys.
	 *
	 * @var string
	 */
	protected $prefix;

	/**
	 * Create a new WinCache store.
	 *
	 * @param  string     $prefix
	 * @return void
	 */
	public function __construct($prefix = '')
	{
		$this->prefix = $prefix;
	}

	/**
	 * Retrieve an item from the cache by key.
	 *
	 * @param  string  $key
	 * @return mixed
	 */
	protected function retrieveItem($key)
	{
		$value = wincache_ucache_get($this->prefix.$key);

		if ($value !== false)
		{
			return $value;
		}
	}

	/**
	 * Store an item in the cache for a given number of minutes.
	 *
	 * @param  string  $key
	 * @param  mixed   $value
	 * @param  int     $minutes
	 * @return void
	 */
	protected function storeItem($key, $value, $minutes)
	{
		wincache_ucache_add($this->prefix.$key, value, $minutes * 60);
	}

	/**
	 * Store an item in the cache indefinitely.
	 *<commit_msg>fix bug in wincache driver.<commit_after><?php namespace Illuminate\Cache;

class WinCacheStore extends Store {

	/**
	 * A string that should be prepended to keys.
	 *
	 * @var string
	 */
	protected $prefix;

	/**
	 * Create a new WinCache store.
	 *
	 * @param  string     $prefix
	 * @return void
	 */
	public function __construct($prefix = '')
	{
		$this->prefix = $prefix;
	}

	/**
	 * Retrieve an item from the cache by key.
	 *
	 * @param  string  $key
	 * @return mixed
	 */
	protected function retrieveItem($key)
	{
		$value = wincache_ucache_get($this->prefix.$key);

		if ($value !== false)
		{
			return $value;
		}
	}

	/**
	 * Store an item in the cache for a given number of minutes.
	 *
	 * @param  string  $key
	 * @param  mixed   $value
	 * @param  int     $minutes
	 * @return void
	 */
	protected function storeItem($key, $value, $minutes)
	{
		wincache_ucache_add($this->prefix.$key, $value, $minutes * 60);
	}

	/**
	 * Store an item in the cache indefinitely.
	 *
{'fraction_non_alphanumeric': 0.13476263399693722, 'fraction_numerical': 0.002041858090862685, 'mean_word_length': 2.7547892720306515, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '6256269', 'n_tokens_mistral': 720, 'n_tokens_neox': 635, 'n_words': 196}