<commit_before><?php
/**
 * Definition of AbstractSystemEnvironment
 *
 * @copyright  2014-today Justso GmbH
 * @author     <EMAIL>
 * @package    justso
 */

namespace justso\justapi;

require_once(__DIR__ . "/SystemEnvironmentInterface.php");
require_once(__DIR__ . "/DependencyContainerInterface.php");
require_once(__DIR__ . "/Bootstrap.php");

/**
 * Implements methods which are common for SystemEnvironment and TestEnvironment
 *
 * @package     justso
 */
abstract class AbstractSystemEnvironment implements SystemEnvironmentInterface, DependencyContainerInterface
{
    /**
     * Dependency Injection Container
     * @var DependencyContainerInterface
     */
    protected $dic;

    protected $bootstrap;

    public function __construct()
    {
        $this->bootstrap = new Bootstrap();

        $vendorPath = dirname(dirname(__DIR__));
        if (file_exists($vendorPath . '/autoload.php')) {
            require_once($vendorPath . '/autoload.php');
        }
        $config = $this->bootstrap->getConfiguration();
        $packages = array_merge(array('justso'), !empty($config['packages']) ? $config['packages'] : []);
        foreach ($packages as $package) {
            $autoloader = new Autoloader($package, $vendorPath);
            $autoloader->register();
        }

        $this->dic = new DependencyContainer($this);
    }

    /**
     * Sends a standard HTTP response.
     *
     * @param string $code    Code and Code-text
     * @param string $mime    MIME-Type
     * @param string $message Response text
     */<commit_msg>Set locale<commit_after><?php
/**
 * Definition of AbstractSystemEnvironment
 *
 * @copyright  2014-today Justso GmbH
 * @author     <EMAIL>
 * @package    justso
 */

namespace justso\justapi;

require_once(__DIR__ . "/SystemEnvironmentInterface.php");
require_once(__DIR__ . "/DependencyContainerInterface.php");
require_once(__DIR__ . "/Bootstrap.php");

/**
 * Implements methods which are common for SystemEnvironment and TestEnvironment
 *
 * @package     justso
 */
abstract class AbstractSystemEnvironment implements SystemEnvironmentInterface, DependencyContainerInterface
{
    /**
     * Dependency Injection Container
     * @var DependencyContainerInterface
     */
    protected $dic;

    protected $bootstrap;

    public function __construct()
    {
        $this->bootstrap = new Bootstrap();

        $vendorPath = dirname(dirname(__DIR__));
        if (file_exists($vendorPath . '/autoload.php')) {
            require_once($vendorPath . '/autoload.php');
        }
        $config = $this->bootstrap->getConfiguration();
        $packages = array_merge(array('justso'), !empty($config['packages']) ? $config['packages'] : []);
        foreach ($packages as $package) {
            $autoloader = new Autoloader($package, $vendorPath);
            $autoloader->register();
        }

        $this->dic = new DependencyContainer($this);
        setlocale(LC_ALL, empty($config['locale']) ? 'de_DE.UTF-8' : $config['locale']);
    }

    /**
     * Sends a standard HTTP response.
     *
     * @param string $code    Code and Code-text
     * @param string $mime    MIME-Type
     * @param string $message Response text
     */
{'fraction_non_alphanumeric': 0.1272613849033063, 'fraction_numerical': 0.0028072364316905803, 'mean_word_length': 3.018796992481203, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, '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': '1756070', 'n_tokens_mistral': 899, 'n_tokens_neox': 866, 'n_words': 199}