<commit_before><?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');
/**
 * ResourceRegistry3
 * 
 * @package     RR3
 * @author      Middleware Team HEAnet 
 * @copyright   Copyright (c) 2013, HEAnet Limited (http://www.heanet.ie)
 * @license     MIT http://www.opensource.org/licenses/mit-license.php
 *  
 */

/**
 * Msigner Class
 * 
 * @package     RR3
 * @author      <NAME> <<EMAIL>>
 */
class Msigner extends MY_Controller {

   function __construct()
   {
        parent::__construct();
        $loggedin = $this->j_auth->logged_in();
        if (!$loggedin)
        {
            show_error('access denied',403);
            return;
        }
        $this->tmp_providers = new models\Providers;
        $this->load->library('zacl');
   }
  
   function signer()
   {
       if(!$this->input->is_ajax_request())
       {
          show_error('access denied',403);
          return;
       }
       $type =  $this->uri->segment(3);
       $id = $this->uri->segment(4);
       if(empty($type) || empty($id))
       {
           show_error('empty tyle or id: '.lang('error404').'',404);
       }
       $gearmanenabled = $this->config->item('gearman')
       if(empty($gearmanenabled))
       {
           show_error('gearman is not enabled '.lang('error404').'',404);
       }       
       $client = new GearmanClient();
       $jobservers = array();
       $j = $this->config->item('gearmanconf');
       foreach($j['jobserver'] as $v)
       {
          $jobservers[] = ''.$v['ip'].':'.$v['port'].'';
       }
       try{
            $client->addServers(''.implode(",",$jobservers).'');
       }
       catch (Exception $e)
       {
              log_message('error', 'GeamanClient couldnt add job-server');
              echo "GeamanClient couldnt add job-server";
              return false;
       }


       $options = array();
       if($type === 'federation' && is_numeric($id))
       {
           $fed = $this->em->getRepository("models\Federation")->findOneBy(array('id'=>''.$id.''));
           if(empty($fed))
           {
                echo lang('error_fednotfound');
                return;<commit_msg>syntax fix<commit_after><?php
if (!defined('BASEPATH'))
    exit('No direct script access allowed');
/**
 * ResourceRegistry3
 * 
 * @package     RR3
 * @author      Middleware Team HEAnet 
 * @copyright   Copyright (c) 2013, HEAnet Limited (http://www.heanet.ie)
 * @license     MIT http://www.opensource.org/licenses/mit-license.php
 *  
 */

/**
 * Msigner Class
 * 
 * @package     RR3
 * @author      <NAME> <<EMAIL>>
 */
class Msigner extends MY_Controller {

   function __construct()
   {
        parent::__construct();
        $loggedin = $this->j_auth->logged_in();
        if (!$loggedin)
        {
            show_error('access denied',403);
            return;
        }
        $this->tmp_providers = new models\Providers;
        $this->load->library('zacl');
   }
  
   function signer()
   {
       if(!$this->input->is_ajax_request())
       {
          show_error('access denied',403);
          return;
       }
       $type =  $this->uri->segment(3);
       $id = $this->uri->segment(4);
       if(empty($type) || empty($id))
       {
           show_error('empty tyle or id: '.lang('error404').'',404);
       }
       $gearmanenabled = $this->config->item('gearman');
       if(empty($gearmanenabled))
       {
           show_error('gearman is not enabled '.lang('error404').'',404);
       }       
       $client = new GearmanClient();
       $jobservers = array();
       $j = $this->config->item('gearmanconf');
       foreach($j['jobserver'] as $v)
       {
          $jobservers[] = ''.$v['ip'].':'.$v['port'].'';
       }
       try{
            $client->addServers(''.implode(",",$jobservers).'');
       }
       catch (Exception $e)
       {
              log_message('error', 'GeamanClient couldnt add job-server');
              echo "GeamanClient couldnt add job-server";
              return false;
       }


       $options = array();
       if($type === 'federation' && is_numeric($id))
       {
           $fed = $this->em->getRepository("models\Federation")->findOneBy(array('id'=>''.$id.''));
           if(empty($fed))
           {
                echo lang('error_fednotfound');
                return;
{'fraction_non_alphanumeric': 0.17604651162790697, 'fraction_numerical': 0.012558139534883722, 'mean_word_length': 1.9744121715076073, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 49, 'https://': 0, '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': '4314015', 'n_tokens_mistral': 1379, 'n_tokens_neox': 1324, 'n_words': 230}