public function validateLangFile($sourceFile, $originFile)
	{
		$originFilePath = $this->originPath . '/' . $originFile;
		$sourceFilePath = $this->sourcePath . '/' . $sourceFile;

		if (!$this->safeMode)
		{
			ob_start();

			/** @var $lang */
			include($originFilePath);

			$defined_variables = get_defined_vars();
			if (sizeof($defined_variables) != 5 || !isset($defined_variables['lang']) || gettype($defined_variables['lang']) != 'array')
			{
				$this->output->addMessage(Output::FATAL, 'Must only contain the lang-array', $originFile);
				if (!isset($defined_variables['lang']) || gettype($defined_variables['lang']) != 'array')
				{
					return;
				}
			}

			$output = ob_get_contents();
			ob_end_clean();

			if ($output !== '')
			{
				$this->output->addMessage(Output::FATAL, 'Must not produces output: ' . htmlspecialchars($output), $originFile);
			}
		}

		else
		{
			/** @var $lang */
			$lang = ValidatorRunner::langParser($originFilePath);
			$this->output->addMessage(Output::NOTICE, '<bg=yellow;options=bold>[Safe Mode]</> Manually run the translation validator to check for disallowed output.', $originFile);
		}

		$validate = $lang;
		unset($lang);

		if (!$this->safeMode)
		{
			/** @var $lang */
			include($sourceFilePath);
		}

		else
		{
			/** @var $lang */
			$lang = ValidatorRunner::langParser($sourceFilePath);
		}

		$against = $lang;
		unset($lang);

		foreach ($against as $againstLangKey => $againstLanguage)
		{
			if (!isset($validate[$againstLangKey]))
			{
				$this->output->addMessage(Output::FATAL, 'Must contain key: ' . $againstLangKey, $originFile);
				continue;
			}

			$this->langkeyValidator->validate($originFile, $againstLangKey, $againstLanguage, $validate[$againstLangKey]);
		}

		foreach ($validate as $validateLangKey => $validateLanguage)
		{
			if (!isset($against[$validateLangKey]))
			{
				$this->output->addMessage(Output::FATAL, 'Must not contain key: ' . $validateLangKey, $originFile);
			}
		}

		// Check reCaptcha file
		if ($originFile === $this->originLanguagePath . 'captcha_recaptcha.php')
		{
			$this->validateReCaptchaValue($originFile, $validate);
		}
	}
public function validateLangFile($sourceFile, $originFile)
	{
		$originFilePath = $this->originPath . '/' . $originFile;
		$sourceFilePath = $this->sourcePath . '/' . $sourceFile;

		if (!$this->safeMode)
		{
			ob_start();

			/** @var $lang */
			include($originFilePath);

			$defined_variables = get_defined_vars();
			if (sizeof($defined_variables) != 5 || !isset($defined_variables['lang']) || gettype($defined_variables['lang']) != 'array')
			{
				$this->output->addMessage(Output::FATAL, 'Must only contain the lang-array', $originFile);
				if (!isset($defined_variables['lang']) || gettype($defined_variables['lang']) != 'array')
				{
					return;
				}
			}

			$output = ob_get_contents();
			ob_end_clean();

			if ($output !== '')
			{
				$this->output->addMessage(Output::FATAL, 'Must not produces output: ' . htmlspecialchars($output), $originFile);
			}
		}

		else
		{
			/** @var $lang */
			$lang = ValidatorRunner::langParser($originFilePath);
			$this->output->addMessage(Output::NOTICE, '<bg=yellow;options=bold>[Safe Mode]</> Manually run the translation validator to check for disallowed output.', $originFile);
		}

		$validate = $lang;
		unset($lang);

		if (!$this->safeMode)
		{
			/** @var $lang */
			include($sourceFilePath);
		}

		else
		{
			/** @var $lang */
			$lang = ValidatorRunner::langParser($sourceFilePath);
		}

		$against = $lang;
		unset($lang);

		foreach ($against as $againstLangKey => $againstLanguage)
		{
			if (!isset($validate[$againstLangKey]))
			{
				$this->output->addMessage(Output::FATAL, 'Must contain key: ' . $againstLangKey, $originFile);
				continue;
			}

			$this->langkeyValidator->validate($originFile, $againstLangKey, $againstLanguage, $validate[$againstLangKey]);
		}

		foreach ($validate as $validateLangKey => $validateLanguage)
		{
			if (!isset($against[$validateLangKey]))
			{
				$this->output->addMessage(Output::FATAL, 'Must not contain key: ' . $validateLangKey, $originFile);
			}
		}

		// Check reCaptcha file
		if ($originFile === $this->originLanguagePath . 'captcha_recaptcha.php')
		{
			$this->validateReCaptchaValue($originFile, $validate);
		}
	}
public function validateLangFile ( $ sourceFile , $ originFile ) { $ originFilePath = $ this -> originPath . '/' . $ originFile ; $ sourceFilePath = $ this -> sourcePath . '/' . $ sourceFile ; if ( ! $ this -> safeMode ) { ob_start ( ) ; /** @var $lang */ include ( $ originFilePath ) ; $ defined_variables = get_defined_vars ( ) ; if ( sizeof ( $ defined_variables ) != 5 || ! isset ( $ defined_variables [ 'lang' ] ) || gettype ( $ defined_variables [ 'lang' ] ) != 'array' ) { $ this -> output -> addMessage ( Output :: FATAL , 'Must only contain the lang-array' , $ originFile ) ; if ( ! isset ( $ defined_variables [ 'lang' ] ) || gettype ( $ defined_variables [ 'lang' ] ) != 'array' ) { return ; } } $ output = ob_get_contents ( ) ; ob_end_clean ( ) ; if ( $ output !== '' ) { $ this -> output -> addMessage ( Output :: FATAL , 'Must not produces output: ' . htmlspecialchars ( $ output ) , $ originFile ) ; } } else { /** @var $lang */ $ lang = ValidatorRunner :: langParser ( $ originFilePath ) ; $ this -> output -> addMessage ( Output :: NOTICE , '<bg=yellow;options=bold>[Safe Mode]</> Manually run the translation validator to check for disallowed output.' , $ originFile ) ; } $ validate = $ lang ; unset ( $ lang ) ; if ( ! $ this -> safeMode ) { /** @var $lang */ include ( $ sourceFilePath ) ; } else { /** @var $lang */ $ lang = ValidatorRunner :: langParser ( $ sourceFilePath ) ; } $ against = $ lang ; unset ( $ lang ) ; foreach ( $ against as $ againstLangKey => $ againstLanguage ) { if ( ! isset ( $ validate [ $ againstLangKey ] ) ) { $ this -> output -> addMessage ( Output :: FATAL , 'Must contain key: ' . $ againstLangKey , $ originFile ) ; continue ; } $ this -> langkeyValidator -> validate ( $ originFile , $ againstLangKey , $ againstLanguage , $ validate [ $ againstLangKey ] ) ; } foreach ( $ validate as $ validateLangKey => $ validateLanguage ) { if ( ! isset ( $ against [ $ validateLangKey ] ) ) { $ this -> output -> addMessage ( Output :: FATAL , 'Must not contain key: ' . $ validateLangKey , $ originFile ) ; } } // Check reCaptcha file if ( $ originFile === $ this -> originLanguagePath . 'captcha_recaptcha.php' ) { $ this -> validateReCaptchaValue ( $ originFile , $ validate ) ; } }
Validates a normal language file

Files should not produce any output.
Files should only define the $lang variable.
Files must have all language keys defined in the source file.
Files should not have additional language keys.

@param	string	$sourceFile		Source file for comparison
@param	string	$originFile		File to validate
@return	null
Validates a normal language file