<commit_before><?php

namespace Boris\Loader\Provider;

class Symfony2 extends AbstractProvider
{
    public $name = 'symfony';
    
    private $env;
    
    private $debug;
    
    public function __construct($environment = 'dev', $debug = true)
    {
        $this->env = $environment;
        $this->debug = $debug;
    }

    public function assertDir($dir)
    {
        return  (
                    is_file("$dir/app/bootstrap.php.cache") ||
                    is_file("$dir/app/autoload.php")
                )
            && is_file("$dir/app/AppKernel.php");
    }

    public function initialize(\Boris\Boris $boris, $dir)
    {
        parent::initialize($boris, $dir);

        if(is_file("$dir/app/bootstrap.php.cache")) {
            require "$dir/app/bootstrap.php.cache";
        } else {
            require "$dir/app/autoload.php";
        }
        require_once "$dir/app/AppKernel.php";

        $kernel = new \AppKernel($this->env, $debug);
        $kernel->loadClassCache();
        $kernel->boot();

        $boris->onStart(function ($worker, $vars) use ($kernel) {
            $worker->setLocal('kernel', $kernel);
            $worker->setLocal('container', $kernel->getContainer());
        });
    }

}<commit_msg>bug fix<commit_after><?php

namespace Boris\Loader\Provider;

class Symfony2 extends AbstractProvider
{
    public $name = 'symfony';
    
    private $env;
    
    private $debug;
    
    public function __construct($environment = 'dev', $debug = true)
    {
        $this->env = $environment;
        $this->debug = $debug;
    }

    public function assertDir($dir)
    {
        return  (
                    is_file("$dir/app/bootstrap.php.cache") ||
                    is_file("$dir/app/autoload.php")
                )
            && is_file("$dir/app/AppKernel.php");
    }

    public function initialize(\Boris\Boris $boris, $dir)
    {
        parent::initialize($boris, $dir);

        if(is_file("$dir/app/bootstrap.php.cache")) {
            require "$dir/app/bootstrap.php.cache";
        } else {
            require "$dir/app/autoload.php";
        }
        require_once "$dir/app/AppKernel.php";

        $kernel = new \AppKernel($this->env, $this->debug);
        $kernel->loadClassCache();
        $kernel->boot();

        $boris->onStart(function ($worker, $vars) use ($kernel) {
            $worker->setLocal('kernel', $kernel);
            $worker->setLocal('container', $kernel->getContainer());
        });
    }

}
{'fraction_non_alphanumeric': 0.15823293172690764, 'fraction_numerical': 0.0008032128514056225, 'mean_word_length': 1.9975932611311673, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 22, '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': '2542341', 'n_tokens_mistral': 768, 'n_tokens_neox': 746, 'n_words': 123}