<commit_before><?php

namespace Constructs;


use A;
use Data;


class Construct
{
	protected $settings;

	public function __construct($path)
	{
		$this->settings = Data::read($path . DS . 'settings.yml', 'yaml');
		$this->settings['path'] = $path;
	}

	public function name()
	{
		return A::get($this->settings, 'name');
	}

	public function path()
	{
		return A::get($this->settings, 'path');
	}

	public function rootNamespace()
	{
		return A::get($this->settings, 'rootNamespace', '');<commit_msg>Allowing construct settings overrides through Kirby config<commit_after><?php

namespace Constructs;


use A;
use C;
use Data;


class Construct
{
	protected $settings;

	public function __construct($path)
	{
		$this->settings = Data::read($path . DS . 'settings.yml', 'yaml');
		$name = $this->name();

		// allow overrides of construct settings through Kirby config with naming convention
		foreach ($this->settings as $key => $value) {
			$confKey = implode('.', ['constructs', $name, $key]);
			if (C::get($confKey)) {
				$this->settings[$key] = C::get($confKey);
			}
		}

		$this->settings['path'] = $path;
	}

	public function name()
	{
		return A::get($this->settings, 'name');
	}

	public function path()
	{
		return A::get($this->settings, 'path');
	}

	public function rootNamespace()
	{
		return A::get($this->settings, 'rootNamespace', '');
{'fraction_non_alphanumeric': 0.1793357933579336, 'fraction_numerical': 0.0, 'mean_word_length': 4.338582677165355, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '1022306', 'n_tokens_mistral': 482, 'n_tokens_neox': 441, 'n_words': 113}