<commit_before><?php
/**
 * @package vsc_application
 * @subpackage processors
 * @author <NAME> <<EMAIL>>
 * @date 09.08.31
 */
import ('presentation/views');
abstract class vscProcessorA extends vscObject implements vscProcessorI {
	private $oCurrentMap;
	protected $aLocalVars = array();

	/**
	 * @return vscProcessorMap
	 */
	public function getMap () {
		if (vscMappingA::isValid ($this->oCurrentMap)) {
			return $this->oCurrentMap;
		} else {
			return new vscProcessorMap ('', '.*');
		}
	}

	/**
	 * @param vscMappingA $oMap
	 */
	public function setMap (vscMappingA $oMap) {
		$this->oCurrentMap = $oMap;
		$aTainted = $oMap->getTaintedVars();
		if (is_array($aTainted) && count ($aTainted) >= 1) {
			$this->setLocalVars($aTainted);
		}
	}

	/**
	 *
	 * @param array $aVars
	 * @return void
	 */
	public function setLocalVars ($aVars = array()) {
		foreach ($this->aLocalVars as $sKey => $sValue) {
			$this->aLocalVars[$sKey] = array_shift($aVars);
		}
	}

	/**
	 * @return array
	 */
	public function getLocalVars () {
		return $this->aLocalVars;
	}

	/**
	 * @param string $sVar
	 * @param string $sValue
	 */
	public function setVar ($sVar, $sValue) {
		if (key_exists ($sVar, $this->aLocalVars)) {
			$this->aLocalVars[$sVar] = $sValue;
		}
	}

	/**
	 * @param string $sVar
	 */
	public function getVar ($sVar) {
		if (key_exists ($sVar, $this->aLocalVars)) {
			return $this->aLocalVars[$sVar];
		} else {
			return null;
		}
	}

	/**
	 * @returns array
	 */
	public function getValueNames () {
		return $this->aLocalValueNames;
	}
	
	/**
	 * (non-PHPdoc)
	 * @see vscProcessorI::delegateRequest()
	 */
	public function delegateRequest(vscHttpRequestA $oHttpRequest, vscProcessorA $oNewProcessor, vscHttpResponseA $oResponse = null) {
		$oDispatcher = vsc::getEnv()->getDispatcher();
		$oMap = $oDispatcher->getSiteMap()->findProcessorMap($oNewProcessor);
		
		$oNewProcessor->setMap($oMap);
		$oNewProcessor->init();
		
		/* @var $oDispatcher vscRwDispatcher */
		$oMap->merge ($this->getMap());

		if (vscHttpResponse::isValid($oResponse)) {
			$oMap->setResponse($oResponse);
		}
		
		$this->setMap ($oMap);
		
		$this->setLocalVars($oNewProcessor->getLocalVars());
		
		return $oNewProcessor->handleRequest($oHttpRequest);
	}
}
<commit_msg>Switching addLocalVars<commit_after><?php
/**
 * @package vsc_application
 * @subpackage processors
 * @author <NAME> <<EMAIL>>
 * @date 09.08.31
 */
import ('presentation/views');
abstract class vscProcessorA extends vscObject implements vscProcessorI {
	private $oCurrentMap;
	protected $aLocalVars = array();

	/**
	 * @return vscProcessorMap
	 */
	public function getMap () {
		if (vscMappingA::isValid ($this->oCurrentMap)) {
			return $this->oCurrentMap;
		} else {
			return new vscProcessorMap ('', '.*');
		}
	}

	/**
	 * @param vscMappingA $oMap
	 */
	public function setMap (vscMappingA $oMap) {
		$this->oCurrentMap = $oMap;
		$aTainted = $oMap->getTaintedVars();
		if (is_array($aTainted) && count ($aTainted) >= 1) {
			$this->setLocalVars($aTainted);
		}
	}

	/**
	 *
	 * @param array $aVars
	 * @return void
	 */
	public function setLocalVars ($aVars = array()) {
		foreach ($this->aLocalVars as $sKey => $sValue) {
			$this->aLocalVars[$sKey] = array_shift($aVars);
		}
	}

	/**
	 * @return array
	 */
	public function getLocalVars () {
		return $this->aLocalVars;
	}

	/**
	 * @param string $sVar
	 * @param string $sValue
	 */
	public function setVar ($sVar, $sValue) {
		if (key_exists ($sVar, $this->aLocalVars)) {
			$this->aLocalVars[$sVar] = $sValue;
		}
	}

	/**
	 * @param string $sVar
	 */
	public function getVar ($sVar) {
		if (key_exists ($sVar, $this->aLocalVars)) {
			return $this->aLocalVars[$sVar];
		} else {
			return null;
		}
	}

	/**
	 * @returns array
	 */
	public function getValueNames () {
		return $this->aLocalValueNames;
	}
	
	/**
	 * (non-PHPdoc)
	 * @see vscProcessorI::delegateRequest()
	 */
	public function delegateRequest(vscHttpRequestA $oHttpRequest, vscProcessorA $oNewProcessor, vscHttpResponseA $oResponse = null) {
		$oDispatcher = vsc::getEnv()->getDispatcher();
		$oMap = $oDispatcher->getSiteMap()->findProcessorMap($oNewProcessor);
		
		$oNewProcessor->setMap($oMap);
		$oNewProcessor->init();
		
		/* @var $oDispatcher vscRwDispatcher */
		$oMap->merge ($this->getMap());

		if (vscHttpResponse::isValid($oResponse)) {
			$oMap->setResponse($oResponse);
		}
		
		$this->setMap ($oMap);
		
		$oNewProcessor->setLocalVars($this->getLocalVars());
		
		return $oNewProcessor->handleRequest($oHttpRequest);
	}
}

{'fraction_non_alphanumeric': 0.17207147584381205, 'fraction_numerical': 0.003088462386940216, 'mean_word_length': 3.896328293736501, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 63, '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': '820244', 'n_tokens_mistral': 1779, 'n_tokens_neox': 1619, 'n_words': 303}