phpbb\convert\controller\convertor::intro PHP Method

intro() public method

Render the intro page
public intro ( boolean | integer $start_new ) : Response
$start_new boolean | integer Whether or not to force to start a new convertor
return Symfony\Component\HttpFoundation\Response
    public function intro($start_new)
    {
        $this->setup_navigation('intro');
        if ($start_new) {
            if ($this->request->is_ajax()) {
                $response = new StreamedResponse();
                $iohandler = $this->iohandler;
                $url = $this->controller_helper->route('phpbb_convert_intro', array('start_new' => 'new'));
                $response->setCallback(function () use($iohandler, $url) {
                    $iohandler->redirect($url);
                });
                $response->headers->set('X-Accel-Buffering', 'no');
                return $response;
            }
            $this->config['convert_progress'] = '';
            $this->config['convert_db_server'] = '';
            $this->config['convert_db_user'] = '';
            $this->db->sql_query('DELETE FROM ' . $this->config_table . "\n\t\t\t\tWHERE config_name = 'convert_progress'\n\t\t\t\t\tOR config_name = 'convert_db_server'\n\t\t\t\t\tOR config_name = 'convert_db_user'");
        }
        // Let's see if there is a conversion in the works...
        $options = array();
        if (!empty($this->config['convert_progress']) && !empty($this->config['convert_db_server']) && !empty($this->config['convert_db_user']) && !empty($this->config['convert_options'])) {
            $options = unserialize($this->config['convert_progress']);
            $options = array_merge($options, unserialize($this->config['convert_db_server']), unserialize($this->config['convert_db_user']), unserialize($this->config['convert_options']));
        }
        // This information should have already been checked once, but do it again for safety
        if (!empty($options) && !empty($options['tag']) && isset($options['dbms']) && isset($options['dbhost']) && isset($options['dbport']) && isset($options['dbuser']) && isset($options['dbpasswd']) && isset($options['dbname']) && isset($options['table_prefix'])) {
            $this->template->assign_vars(array('TITLE' => $this->language->lang('CONTINUE_CONVERT'), 'BODY' => $this->language->lang('CONTINUE_CONVERT_BODY'), 'S_CONTINUE' => true, 'U_NEW_ACTION' => $this->controller_helper->route('phpbb_convert_intro', array('start_new' => 'new')), 'U_CONTINUE_ACTION' => $this->controller_helper->route('phpbb_convert_convert', array('converter' => $options['tag']))));
            return $this->controller_helper->render('installer_convert.html', 'CONTINUE_CONVERT', true);
        }
        return $this->render_convert_list();
    }