<commit_before><?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * @package   Jagger
 * @author    <NAME> <<EMAIL>>
 * @author    Middleware Team HEAnet <<EMAIL>>
 * @copyright 2015 HEAnet Limited (http://www.heanet.ie)
 * @license   MIT http://www.opensource.org/licenses/mit-license.php
 * @link      https://github.com/Edugate/Jagger
 */

class J_ncache
{

    protected $ci;
    protected $keyprefix;

    public function __construct()
    {
        $this->ci = &get_instance();
        $this->keyprefix = getCachePrefix();
        $this->ci->load->driver('cache', array('adapter' => 'memcached', 'key_prefix' => $this->keyprefix));
    }

    /**
     * @param $type
     * @return bool
     */
    public function cleanProvidersList($type)
    {
        $guilangs = MY_Controller::guiLangs();
        $langs = array_keys($guilangs);
        $cachePrefix = $type . '_l_';
        foreach ($langs as $v) {
            $this->ci->cache->delete($cachePrefix . $v);
        }
        return true;
    }

    /**
     * @param $fedId
     * @return bool
     */
    public function cleanFederationMembers($fedId)
    {
        $guilangs = MY_Controller::guiLangs();
        $langs = array_keys($guilangs);
        $cachePrefix = 'fedmbrs_' . $fedId . '_';
        foreach ($langs as $v) {
            $this->ci->cache->delete($cachePrefix . $v);
        }
        return true;
    }

    /**
     * @param $fedId
     * @param $lang
     * @return mixed
     */
    public function getFederationMembers($fedId, $lang)
    {
        $cachedid = 'fedmbrs_' . $fedId . '_' . $lang;<commit_msg>minor fix<commit_after><?php
if (!defined('BASEPATH')) {
    exit('No direct script access allowed');
}

/**
 * @package   Jagger
 * @author    <NAME> <<EMAIL>>
 * @author    Middleware Team HEAnet <<EMAIL>>
 * @copyright 2015 HEAnet Limited (http://www.heanet.ie)
 * @license   MIT http://www.opensource.org/licenses/mit-license.php
 * @link      https://github.com/Edugate/Jagger
 */

class J_ncache
{

    protected $ci;
    protected $keyprefix;

    public function __construct()
    {
        $this->ci = &get_instance();
        $this->keyprefix = getCachePrefix();
        $this->ci->load->driver('cache', array('adapter' => 'memcached', 'key_prefix' => $this->keyprefix));
    }

    /**
     * @param $type
     * @return bool
     */
    public function cleanProvidersList($type)
    {
        $guilangs = (array) MY_Controller::guiLangs();
        $langs = array_keys($guilangs);
        $cachePrefix = $type . '_l_';
        foreach ($langs as $v) {
            $this->ci->cache->delete($cachePrefix . $v);
        }
        return true;
    }

    /**
     * @param $fedId
     * @return bool
     */
    public function cleanFederationMembers($fedId)
    {
        $guilangs = (array) MY_Controller::guiLangs();
        $langs = array_keys($guilangs);
        $cachePrefix = 'fedmbrs_' . $fedId . '_';
        foreach ($langs as $v) {
            $this->ci->cache->delete($cachePrefix . $v);
        }
        return true;
    }

    /**
     * @param $fedId
     * @param $lang
     * @return mixed
     */
    public function getFederationMembers($fedId, $lang)
    {
        $cachedid = 'fedmbrs_' . $fedId . '_' . $lang;
{'fraction_non_alphanumeric': 0.16350275566442132, 'fraction_numerical': 0.002449479485609308, 'mean_word_length': 2.234653465346535, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 41, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, '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': '5696211', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1062, 'n_words': 210}