<commit_before><?php
/**
 * @package plugins.expressionEncoder
 * @subpackage lib
 */
class KOperationEngineExpressionEncoder  extends KSingleOutputOperationEngine
{
	/**
	 * @var string
	 */
//	protected $outDir;
//	protected $configData;
	
	/**
	 * @var string
	 */
	
	/**
	 * @param string $outDir
	 */
	public function __construct($cmd, $outFilePath)
	{
		parent::__construct($cmd,$outFilePath);
		KalturaLog::info(": cmd($cmd), outFilePath($outFilePath)");
	}

	protected function getCmdLine()
	{
		$outDir = realpath(dirname($this->outFilePath));
		$this->outDir = $outDir;
		$this->configFilePath = $this->outFilePath.".xml";
				// The EE3 preset xml allows 'clean' outfile names only (no full path)  
		$this->outFilePath = basename($this->outFilePath);
		$this->inFilePath = realpath(dirname($this->inFilePath))."\\".basename($this->inFilePath);
		KalturaLog::info("outFilePath(dirname($this->outFilePath)),auxPath($outDir)");
//		$xml = str_replace(KDLCmdlinePlaceholders::OutDir, $outPath, $this->operator->config);
		file_put_contents($this->configFilePath, $this->operator->config);
//		$this->operator->command = KDLCmdlinePlaceholders::InFileName . ' ' . KDLCmdlinePlaceholders::ConfigFileName;
		$exeCmd =  parent::getCmdLine();
		KalturaLog::info(print_r($this,true));
		return $exeCmd;
	}

	public function configure(KSchedularTaskConfig $taskConfig, KalturaConvartableJobData $data)
	{
		parent::configure($taskConfig, $data);
		KalturaLog::info("taskConfig-->".print_r($taskConfig,true)."\ndata->".print_r($data,true));
	}
	
	public function operate(kOperator $operator = null, $inFilePath, $configFilePath = null)
	{
		parent::operate($operator, $inFilePath, $configFilePath);
//		KalturaLog::info("operator($operator), inFilePath($inFilePath), configFilePath($configFilePath)");
	}
	
}<commit_msg>fwr:  fix: JSON serialzation failure of config XML file<commit_after><?php
/**
 * @package plugins.expressionEncoder
 * @subpackage lib
 */
class KOperationEngineExpressionEncoder  extends KSingleOutputOperationEngine
{
	/**
	 * @var string
	 */
//	protected $outDir;
//	protected $configData;
	
	/**
	 * @var string
	 */
	
	/**
	 * @param string $outDir
	 */
	public function __construct($cmd, $outFilePath)
	{
		parent::__construct($cmd,$outFilePath);
		KalturaLog::info(": cmd($cmd), outFilePath($outFilePath)");
	}

	protected function getCmdLine()
	{
		$outDir = realpath(dirname($this->outFilePath));
		$this->outDir = $outDir;
		$this->configFilePath = $this->outFilePath.".xml";
				// The EE3 preset xml allows 'clean' outfile names only (no full path)  
		$this->outFilePath = basename($this->outFilePath);
		$this->inFilePath = realpath(dirname($this->inFilePath))."\\".basename($this->inFilePath);
		KalturaLog::info("outFilePath(dirname($this->outFilePath)),auxPath($outDir)");
			// Add slashes to solve JSON serialization issue
		$xmlStr = str_replace ('\"' , '"' ,  $this->operator->config);
		file_put_contents($this->configFilePath, $xmlStr);

		$exeCmd =  parent::getCmdLine();
		KalturaLog::info(print_r($this,true));
		return $exeCmd;
	}

	public function configure(KSchedularTaskConfig $taskConfig, KalturaConvartableJobData $data)
	{
		parent::configure($taskConfig, $data);
		KalturaLog::info("taskConfig-->".print_r($taskConfig,true)."\ndata->".print_r($data,true));
	}
	
	public function operate(kOperator $operator = null, $inFilePath, $configFilePath = null)
	{
		parent::operate($operator, $inFilePath, $configFilePath);
	}
	
}
{'fraction_non_alphanumeric': 0.16944764096662832, 'fraction_numerical': 0.0005753739930955121, 'mean_word_length': 5.486940298507463, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 37, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 7}, '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': '5629579', 'n_tokens_mistral': 1180, 'n_tokens_neox': 1108, 'n_words': 190}