<commit_before><?php

/*
 */

/**
 * Description of FileOut
 *
 * @author topman
 */
class FileOut {

    public function __invoke($filename, array $options = array()) {
        if (isset($options['imgTag']) && !$options['imgTag']) {
            if (isset($options['toScreen']) && $options['toScreen']) {
                header('Content-Type: image/png');
                die($content);
            }

            return $content;
        }

        $attributes = isset($options['attrs']) ? $options['attrs'] : array();
        $attributes = isset($options['attributes']) ? $options['attributes'] : $attributes;

        if (!is_array($attributes)) {
            throw new Exception('Attributes for the filename must be an array');
        }
        if (!isset($attributes['width']))
            $attributes['width'] = '100%';
        if (isset($attributes['title']) && !isset($attributes['alt']))
            $attributes['alt'] = $attributes['title'];
        elseif (isset($attributes['alt']) && !isset($attributes['title']))
            $attributes['title'] = $attributes['alt'];

        if (!is_readable($filename)) {
            $filename = DATA . 'defaults' . DIRECTORY_SEPARATOR . 'headQ.png';
            if (!isset($attributes['width'])) {
                $attributes['style'] = (!isset($attributes['style'])) ?
                        'margin-left:20%;width:60%;' : $attributes['style'] . ';margin-left:20%;width:60%';
            }
        }

        return '<img src="/' . $this->cleanFilename($filename) . '" ' . $this->parseAttributes($attributes) . ' />';
    }<commit_msg>Ensured proper links to images whether on virtual server or not<commit_after><?php

use DScribe\Core\Engine;

/*
 */

/**
 * Description of FileOut
 *
 * @author topman
 */
class FileOut {

    public function __invoke($filename, array $options = array()) {
        if (isset($options['imgTag']) && !$options['imgTag']) {
            if (isset($options['toScreen']) && $options['toScreen']) {
                header('Content-Type: image/png');
                die($content);
            }

            return $content;
        }

        $attributes = isset($options['attrs']) ? $options['attrs'] : array();
        $attributes = isset($options['attributes']) ? $options['attributes'] : $attributes;

        if (!is_array($attributes)) {
            throw new Exception('Attributes for the filename must be an array');
        }
        if (!isset($attributes['width']))
            $attributes['width'] = '100%';
        if (isset($attributes['title']) && !isset($attributes['alt']))
            $attributes['alt'] = $attributes['title'];
        elseif (isset($attributes['alt']) && !isset($attributes['title']))
            $attributes['title'] = $attributes['alt'];

        if (!is_readable($filename)) {
            $filename = DATA . 'defaults' . DIRECTORY_SEPARATOR . 'headQ.png';
            if (!isset($attributes['width'])) {
                $attributes['style'] = (!isset($attributes['style'])) ?
                        'margin-left:20%;width:60%;' : $attributes['style'] . ';margin-left:20%;width:60%';
            }
        }

        return '<img src="' . Engine::getServerPath() . $this->cleanFilename($filename) . '" ' . $this->parseAttributes($attributes) . ' />';
    }
{'fraction_non_alphanumeric': 0.1948764867337603, 'fraction_numerical': 0.006709362610551998, 'mean_word_length': 2.51931330472103, 'pattern_counts': {'":': 0, '<': 7, '<?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': '7275228', 'n_tokens_mistral': 897, 'n_tokens_neox': 866, 'n_words': 169}