I want to recompile container from controller when I use $this->container->compile();
public function changeAction(Request $request)
{
//......
echo($this->container->getParameter('mailer_user')."\n");
/*$cmd='php ../app/console cache:clear';
$process=new Process($cmd);
$process->run(function ($type, $buffer) {
if ('err' === $type) {
echo 'ERR > '.$buffer;
}
else {
echo 'OUT > '.$buffer;
}
});*/
$this->container->compile();
echo($this->container->getParameter('mailer_user')."\n");
die();
}
I got an error : You cannot compile a dumped frozen container
I want to know if when I clear the cache from controller the container will recompile?