<commit_before><?php
/*
 * File: Processors.php
 * Holds: Processors are views, all the processors classes are extended from this view
 * Created: 11.09.2014
 * Project: Youkok2
 * 
*/

namespace Youkok2\Views;

use Youkok2\Models\Element;
use Youkok2\Models\Me;
use Youkok2\Models\Controllers\Cache\MeDownloadsController;
use Youkok2\Utilities\CacheManager;
use Youkok2\Utilities\Loader;

class Processors extends BaseView
{
    
    /*
     * Always run the constructor
     */
    
    public function __construct($app) {
        parent::__construct($app);
    }
    
    /*
     * Run the view
     */

    public function run() {
        // Check if we should return as json
        if ($this->getSetting('application') and php_sapi_name() != 'cli' and !isset($_GET['format'])) {
            $this->application->setHeader('Content-Type', 'application/json');
        }
    }
    
    /*<commit_msg>Fixed content type for all processors<commit_after><?php
/*
 * File: Processors.php
 * Holds: Processors are views, all the processors classes are extended from this view
 * Created: 11.09.2014
 * Project: Youkok2
 * 
*/

namespace Youkok2\Views;

use Youkok2\Models\Element;
use Youkok2\Models\Me;
use Youkok2\Models\Controllers\Cache\MeDownloadsController;
use Youkok2\Utilities\CacheManager;
use Youkok2\Utilities\Loader;

class Processors extends BaseView
{
    
    /*
     * Always run the constructor
     */
    
    public function __construct($app) {
        parent::__construct($app);
    }
    
    /*
     * Run the view
     */

    public function run() {
        // Check if we should return as json
        if (($this->getSetting('application') or php_sapi_name() != 'cli') and !isset($_GET['format'])) {
            $this->application->setHeader('Content-Type', 'application/json');
        }
    }
    
    /*
{'fraction_non_alphanumeric': 0.1223375204806117, 'fraction_numerical': 0.016384489350081924, 'mean_word_length': 2.769547325102881, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6866115', 'n_tokens_mistral': 580, 'n_tokens_neox': 554, 'n_words': 137}