<commit_before><?php

namespace worstinme\zoo;

use Yii;
use yii\helpers\FileHelper;
use worstinme\zoo\models\Applications;

class Zoo extends \yii\base\Component { 

	public $appsConfigPath = '@app/config/zoo';
	public $elementsPath = '@app/components/elements';
	public $renderersPath = '@app/components/renderers';

	private $menu;


	public function getMenu() {

		if ($this->menu === null) {
			$this->menu = new \worstinme\zoo\models\Menu;
		}

		return $this->menu;
	}
}<commit_msg>shortcodes parser & config getter<commit_after><?php

namespace worstinme\zoo;

use Yii;
use yii\helpers\FileHelper;
use worstinme\zoo\models\Applications;
use worstinme\zoo\backend\models\Config;

class Zoo extends \yii\base\Component { 

	public $appsConfigPath = '@app/config/zoo';
	public $elementsPath = '@app/components/elements';
	public $renderersPath = '@app/components/renderers';

	public $widgets = [];

	private $menu;


	public function getMenu() {

		if ($this->menu === null) {
			$this->menu = new \worstinme\zoo\models\Menu;
		}

		return $this->menu;
	}

	public function findWidgets($content) {

		$shortcode = new \worstinme\zoo\helpers\ShortcodeHelper;
		$shortcode->callbacks = array_merge([
			'uk-slideshow'=>['worstinme\uikit\widgets\Slideshow','widget'],
			//'anothershortcode'=>function($attrs, $content, $tag){},
		],$this->widgets);

		return $shortcode->parse($content);
	}

	public function config($name, $default = null) {

		if (($config = Config::find()->where(['name'=>$name])->one()) !== null) {
			return $config->value;
		}

		return $default;
	}

}
{'fraction_non_alphanumeric': 0.1679340937896071, 'fraction_numerical': 0.0, 'mean_word_length': 4.444827586206896, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 18, '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': '3530513', 'n_tokens_mistral': 594, 'n_tokens_neox': 544, 'n_words': 105}