Symfony\Bundle\WebProfilerBundle\Controller\ProfilerController::importAction PHP Method

importAction() public method

Imports token data.
public importAction ( ) : Response
return Symfony\Component\HttpFoundation\Response A Response instance
    public function importAction()
    {
        $profiler = $this->container->get('profiler');
        $profiler->disable();

        $file = $this->container->get('request')->files->get('file');
        if (!$file || UPLOAD_ERR_OK !== $file->getError()) {
            throw new \RuntimeException('Problem uploading the data.');
        }

        if (!$profile = $profiler->import(file_get_contents($file->getPath()))) {
            throw new \RuntimeException('Problem uploading the data (token already exists).');
        }

        return new RedirectResponse($this->container->get('router')->generate('_profiler', array('token' => $profile->getToken())));
    }