public function settings($convertor)
{
$this->setup_navigation('settings');
require_once $this->phpbb_root_path . 'includes/constants.' . $this->php_ext;
require_once $this->phpbb_root_path . 'includes/functions_convert.' . $this->php_ext;
// Include convertor if available
$convertor_file_path = $this->phpbb_root_path . 'install/convertors/convert_' . $convertor . '.' . $this->php_ext;
if (!file_exists($convertor_file_path)) {
if ($this->request->is_ajax()) {
$response = new StreamedResponse();
$ref = $this;
$response->setCallback(function () use($ref) {
$ref->render_error('CONVERT_NOT_EXIST');
});
$response->headers->set('X-Accel-Buffering', 'no');
return $response;
}
$this->render_error('CONVERT_NOT_EXIST');
return $this->controller_helper->render('installer_convert.html', 'STAGE_SETTINGS', true);
}
$get_info = true;
$phpbb_root_path = $this->phpbb_root_path;
// These globals are required
$phpEx = $this->php_ext;
// See above
include_once $convertor_file_path;
// The test_file is a file that should be present in the location of the old board.
if (!isset($test_file)) {
if ($this->request->is_ajax()) {
$response = new StreamedResponse();
$ref = $this;
$response->setCallback(function () use($ref) {
$ref->render_error('DEV_NO_TEST_FILE');
});
$response->headers->set('X-Accel-Buffering', 'no');
return $response;
}
$this->render_error('DEV_NO_TEST_FILE');
return $this->controller_helper->render('installer_convert.html', 'STAGE_SETTINGS', true);
}
if ($this->request->variable('submit', false)) {
// It must be an AJAX request at this point
$response = new StreamedResponse();
$ref = $this;
$response->setCallback(function () use($ref, $convertor) {
$ref->proccess_settings_form($convertor);
});
$response->headers->set('X-Accel-Buffering', 'no');
return $response;
} else {
$this->template->assign_vars(array('U_ACTION' => $this->controller_helper->route('phpbb_convert_settings', array('convertor' => $convertor))));
if ($this->request->is_ajax()) {
$response = new StreamedResponse();
$ref = $this;
$response->setCallback(function () use($ref) {
$ref->render_settings_form();
});
$response->headers->set('X-Accel-Buffering', 'no');
return $response;
}
$this->render_settings_form();
}
return $this->controller_helper->render('installer_convert.html', 'STAGE_SETTINGS', true);
}