<commit_before><?php
/**
 * Created by PhpStorm.
 * User: sjoder
 * Date: 24.10.2015
 * Time: 12:23
 */

namespace PM\Bundle\ToolBundle\Framework;


use Symfony\Component\HttpFoundation\Request;
use LogicException;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;

/**
 * Class PMKernel
 *
 *  - Fixes the "scope" error for route voter.
 *  - Get different cache and log dir to improve
 *    speed when using a SMB share.
 *
 * @package PM\Bundle\ToolBundle\Framework
 */
class PMKernel extends Kernel
{
    /**
     * @inheritDoc
     */
    public function registerBundles()
    {
        throw new LogicException("No bundles registered");
    }

    /**
     * @inheritDoc
     */
    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        throw new LogicException("Missing container configuration");
    }


    /**
     * Init
     */
    protected function initializeContainer()
    {
        parent::initializeContainer();
        if (PHP_SAPI === 'cli') {
            $request = new Request();
            $request->create('/');
            $this->getContainer()->enterScope('request');
            $this->getContainer()->set('request', $request, 'request');
        }
    }

    /**
     * @inheritDoc
     */
    public function getCacheDir()
    {
        if ('dev' !== $this->getEnvironment()) {
            return sprintf("%s/../var/cache/%s", $this->getRootDir(), $this->getEnvironment());
        }

        return implode(DIRECTORY_SEPARATOR, array(
            $this->getBaseTmpDir(),
            "cache"
        ));
    }

    /**
     * @inheritDoc<commit_msg>Symfony 3.0<commit_after><?php
/**
 * Created by PhpStorm.
 * User: sjoder
 * Date: 24.10.2015
 * Time: 12:23
 */

namespace PM\Bundle\ToolBundle\Framework;


use Symfony\Component\HttpFoundation\Request;
use LogicException;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Component\HttpKernel\Kernel;

/**
 * Class PMKernel
 *
 *  - Fixes the "scope" error for route voter.
 *  - Get different cache and log dir to improve
 *    speed when using a SMB share.
 *
 * @package PM\Bundle\ToolBundle\Framework
 */
class PMKernel extends Kernel
{
    /**
     * @inheritDoc
     */
    public function registerBundles()
    {
        throw new LogicException("No bundles registered");
    }

    /**
     * @inheritDoc
     */
    public function registerContainerConfiguration(LoaderInterface $loader)
    {
        throw new LogicException("Missing container configuration");
    }

    /**
     * @inheritDoc
     */
    public function getCacheDir()
    {
        if ('dev' !== $this->getEnvironment()) {
            return sprintf("%s/../var/cache/%s", $this->getRootDir(), $this->getEnvironment());
        }

        return implode(DIRECTORY_SEPARATOR, array(
            $this->getBaseTmpDir(),
            "cache"
        ));
    }

    /**
     * @inheritDoc
{'fraction_non_alphanumeric': 0.13492333901192505, 'fraction_numerical': 0.008858603066439524, 'mean_word_length': 2.3981481481481484, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 16, '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': '198589', 'n_tokens_mistral': 871, 'n_tokens_neox': 831, 'n_words': 186}