public function processTplFile()

in lib/php/libsdk/SDK/Build/PGO/Config.php [278:294]


	public function processTplFile(string $tpl_fn, string $dst_fn, array $additional_vars = array()) : void
	{
		if (!file_exists($tpl_fn)) {
			throw new Exception("Template file '$tpl_fn' doesn't exist.");
		}

		$s = file_get_contents($tpl_fn);	
		if (false === $s) {
			throw new Exception("Couldn't read '$tpl_fn'.");
		}

		$s = $this->processTpl($s, $additional_vars);

		if (false === file_put_contents($dst_fn, $s)) {
			throw new Exception("Failed to write '$dst_fn'.");
		}
	}