<commit_before><?php
namespace Concrete\Core\Cache\Level;

use Concrete\Core\Cache\Cache;
use Config;
use Stash\Driver\BlackHole;
use Stash\Pool;

/**
 * Class ExpensiveCache
 * This cache stores data about where files are located in concrete5.
 *
 * \@package Concrete\Core\Cache\Level
 */
class OverridesCache extends Cache
{
    protected function init()
    {
        if (Config::get('concrete.cache.overrides') == true) {
            $driver = $this->loadConfig('overrides');
            $this->pool = new Pool($driver);
        } else {
            $this->pool = new Pool(new BlackHole());
        }
        $this->enable();
    }
}
<commit_msg>getting rid of blank screen when cache wasn't writable<commit_after><?php
namespace Concrete\Core\Cache\Level;

use Concrete\Core\Cache\Cache;
use Config;
use Stash\Driver\BlackHole;
use Stash\Exception\InvalidArgumentException;
use Stash\Pool;

/**
 * Class ExpensiveCache
 * This cache stores data about where files are located in concrete5.
 *
 * \@package Concrete\Core\Cache\Level
 */
class OverridesCache extends Cache
{
    protected function init()
    {
        try {
            if (Config::get('concrete.cache.overrides') == true) {
                $driver = $this->loadConfig('overrides');
                $this->pool = new Pool($driver);
            } else {
                $this->pool = new Pool(new BlackHole());
            }
        } catch(InvalidArgumentException $e) {
            $this->pool = new Pool(new BlackHole());
        }
        $this->enable();
    }
}

{'fraction_non_alphanumeric': 0.12882238126219908, 'fraction_numerical': 0.0013012361743656475, 'mean_word_length': 2.543778801843318, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 12, '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': '3422888', 'n_tokens_mistral': 451, 'n_tokens_neox': 451, 'n_words': 111}