i have long running task which i have incorporated as a Process in my symfony project. This is how i call the process
$rootDir = $this->get('kernel')->getRootDir();
$adk_process = new Process(
'php ../bin/console app:adkaction ' . $numcampaigns . ', ' . $timezone . ',' . $depdate);
$adk_process->setWorkingDirectory($rootDir);
$adk_process->setOptions(['suppress_errors' => false]);
$adk_process->setTimeout(null);
$adk_process->start();
while ($adk_process->isRunning()) {
$currprogress = $adk_process->getIncrementalOutput();
return $this->render('BackEnd/user.html.twig',[
'form'=>$form->createView(),
'currprogress' => $currprogress
]);
}
My process currently does not have any output (it is parsing xml file and pushing data to db). When done currprogress variable should be pushes into my .twig template when it will populate progress bar.
I need to show the progress of file parsing (i.e. how many items were processed as it can be up to 100k lines and the process can run for 2-3 hours).
At the moment i cannot get the the incremental output from my process to push it over to my temaplte. What would be the best way to do it!