<commit_before><?php

namespace Yadup;

class YadupExtension extends \Nette\DI\CompilerExtension {

	public $defaults = array(
		"dbUpdateTable" => "_db_update",
		"dbConnection" => "@nette.database.default",
		"definerUser" => "", // to change definer it must be previously definened in query
		"definerHost" => "",
		"sqlDir" => "%appDir%/sql", // directory with sql script files
		"sqlExt" => ".sql", // extension of sql files; with "dot"
		"jushScriptFileName" => "jush.js",
		"yadupScriptFileName" => "yadup.js",
		"jushStyleFileName" => "jush_important.css", // there is no other way to disable #tracy-debug * {color:inherit;}
		"yadupStyleFileName" => "yadup.css",
	);

	public function loadConfiguration() {
		parent::loadConfiguration();
		$config = $this->getConfig($this->defaults);
		$builder = $this->getContainerBuilder();

		$builder->addDefinition($this->prefix('Panel'))
			->setClass('Yadup\Panel', array($config))
			->addSetup('Tracy\Debugger::getBar()->addPanel(?)', array('@self'))
			->addTag("run");
		
		$builder->addDefinition($this->prefix("UpdatorService"))
			->setClass("Yadup\UpdatorService", array(
				$config["sqlDir"],
				$config["sqlExt"],
				$config["dbUpdateTable"],
				$config["dbConnection"],
				$config["definerUser"],
				$config["definerHost"],
			));
		
		$builder->addDefinition($this->prefix("UpdatorRenderService"))
			->setClass("Yadup\UpdatorRenderService", array(
				$config["sqlDir"],
				$config["sqlExt"],
				$config["dbUpdateTable"],
				$config["dbConnection"],
			));
	}

	public function beforeCompile() {
		parent::beforeCompile();
		$builder = $this->getContainerBuilder();
		$builder->getDefinition('nette.presenterFactory')
			->addSetup('setMapping', array(
				array('Yadup' => 'Yadup\\*Module\\*Presenter')
		));
	}

	public function afterCompile(\Nette\PhpGenerator\ClassType $class) {
		parent::afterCompile($class);
	}

}
<commit_msg>clarified definer comment<commit_after><?php

namespace Yadup;

class YadupExtension extends \Nette\DI\CompilerExtension {

	public $defaults = array(
		"dbUpdateTable" => "_db_update",
		"dbConnection" => "@nette.database.default",
		"definerUser" => "", // definer can be changed only in queries that already have one defined
		"definerHost" => "",
		"sqlDir" => "%appDir%/sql", // directory with sql script files
		"sqlExt" => ".sql", // extension of sql files; with "dot"
		"jushScriptFileName" => "jush.js",
		"yadupScriptFileName" => "yadup.js",
		"jushStyleFileName" => "jush_important.css", // there is no other way to disable #tracy-debug * {color:inherit;}
		"yadupStyleFileName" => "yadup.css",
	);

	public function loadConfiguration() {
		parent::loadConfiguration();
		$config = $this->getConfig($this->defaults);
		$builder = $this->getContainerBuilder();

		$builder->addDefinition($this->prefix('Panel'))
			->setClass('Yadup\Panel', array($config))
			->addSetup('Tracy\Debugger::getBar()->addPanel(?)', array('@self'))
			->addTag("run");
		
		$builder->addDefinition($this->prefix("UpdatorService"))
			->setClass("Yadup\UpdatorService", array(
				$config["sqlDir"],
				$config["sqlExt"],
				$config["dbUpdateTable"],
				$config["dbConnection"],
				$config["definerUser"],
				$config["definerHost"],
			));
		
		$builder->addDefinition($this->prefix("UpdatorRenderService"))
			->setClass("Yadup\UpdatorRenderService", array(
				$config["sqlDir"],
				$config["sqlExt"],
				$config["dbUpdateTable"],
				$config["dbConnection"],
			));
	}

	public function beforeCompile() {
		parent::beforeCompile();
		$builder = $this->getContainerBuilder();
		$builder->getDefinition('nette.presenterFactory')
			->addSetup('setMapping', array(
				array('Yadup' => 'Yadup\\*Module\\*Presenter')
		));
	}

	public function afterCompile(\Nette\PhpGenerator\ClassType $class) {
		parent::afterCompile($class);
	}

}

{'fraction_non_alphanumeric': 0.1897810218978102, 'fraction_numerical': 0.0, 'mean_word_length': 4.948837209302326, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 61, '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': '7424204', 'n_tokens_mistral': 1399, 'n_tokens_neox': 1232, 'n_words': 212}