[ Index ] |
PHP Cross Reference of phpBB-3.3.14-deutsch |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * 4 * This file is part of the phpBB Forum Software package. 5 * 6 * @copyright (c) phpBB Limited <https://www.phpbb.com> 7 * @license GNU General Public License, version 2 (GPL-2.0) 8 * 9 * For full copyright and license information, please see 10 * the docs/CREDITS.txt file. 11 * 12 */ 13 14 namespace phpbb\install\controller; 15 16 use phpbb\exception\http_exception; 17 use phpbb\install\helper\install_helper; 18 use phpbb\install\helper\iohandler\factory; 19 use phpbb\install\helper\navigation\navigation_provider; 20 use phpbb\install\installer; 21 use phpbb\language\language; 22 use phpbb\request\request_interface; 23 use phpbb\template\template; 24 use Symfony\Component\HttpFoundation\StreamedResponse; 25 26 /** 27 * Updater controller 28 */ 29 class update 30 { 31 /** 32 * @var helper 33 */ 34 protected $controller_helper; 35 36 /** 37 * @var installer 38 */ 39 protected $installer; 40 41 /** 42 * @var install_helper 43 */ 44 protected $install_helper; 45 46 /** 47 * @var factory 48 */ 49 protected $iohandler_factory; 50 51 /** 52 * @var language 53 */ 54 protected $language; 55 56 /** 57 * @var navigation_provider 58 */ 59 protected $menu_provider; 60 61 /** 62 * @var request_interface 63 */ 64 protected $request; 65 66 /** 67 * @var template 68 */ 69 protected $template; 70 71 /** 72 * Constructor 73 * 74 * @param helper $controller_helper 75 * @param installer $installer 76 * @param install_helper $install_helper 77 * @param factory $iohandler 78 * @param language $language 79 * @param navigation_provider $menu_provider 80 * @param request_interface $request 81 * @param template $template 82 */ 83 public function __construct(helper $controller_helper, installer $installer, install_helper $install_helper, factory $iohandler, language $language, navigation_provider $menu_provider, request_interface $request, template $template) 84 { 85 $this->controller_helper = $controller_helper; 86 $this->installer = $installer; 87 $this->install_helper = $install_helper; 88 $this->iohandler_factory = $iohandler; 89 $this->language = $language; 90 $this->menu_provider = $menu_provider; 91 $this->request = $request; 92 $this->template = $template; 93 } 94 95 /** 96 * Controller entry point 97 * 98 * @return Response|StreamedResponse 99 * 100 * @throws http_exception When phpBB is not installed 101 */ 102 public function handle() 103 { 104 if (!$this->install_helper->is_phpbb_installed()) 105 { 106 throw new http_exception(403, 'INSTALL_PHPBB_NOT_INSTALLED'); 107 } 108 109 $this->template->assign_vars(array( 110 'U_ACTION' => $this->controller_helper->route('phpbb_installer_update'), 111 )); 112 113 // Set up input-output handler 114 if ($this->request->is_ajax()) 115 { 116 $this->iohandler_factory->set_environment('ajax'); 117 } 118 else 119 { 120 $this->iohandler_factory->set_environment('nojs'); 121 } 122 123 // Set the appropriate input-output handler 124 $this->installer->set_iohandler($this->iohandler_factory->get()); 125 $this->controller_helper->handle_language_select(); 126 127 // Render the intro page 128 if ($this->request->is_ajax()) 129 { 130 $installer = $this->installer; 131 $response = new StreamedResponse(); 132 $response->setCallback(function() use ($installer) { 133 $installer->run(); 134 }); 135 136 // Try to bypass any server output buffers 137 $response->headers->set('X-Accel-Buffering', 'no'); 138 $response->headers->set('Content-type', 'application/json'); 139 140 return $response; 141 } 142 else 143 { 144 // Set active stage 145 $this->menu_provider->set_nav_property( 146 array('update', 0, 'introduction'), 147 array( 148 'selected' => true, 149 'completed' => false, 150 ) 151 ); 152 153 $this->template->assign_vars(array( 154 'SHOW_INSTALL_START_FORM' => true, 155 'TITLE' => $this->language->lang('UPDATE_INSTALLATION'), 156 'CONTENT' => $this->language->lang('UPDATE_INSTALLATION_EXPLAIN'), 157 )); 158 159 /** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */ 160 $iohandler = $this->iohandler_factory->get(); 161 $this->controller_helper->handle_navigation($iohandler); 162 163 return $this->controller_helper->render('installer_update.html', 'UPDATE_INSTALLATION', true); 164 } 165 } 166 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Mon Nov 25 19:05:08 2024 | Cross-referenced by PHPXref 0.7.1 |