Verzeichnisstruktur phpBB-3.3.16


Veröffentlicht
27.04.2026

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

      (Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

update.php

Zuletzt modifiziert: 01.05.2026, 11:25 - Dateigröße: 3.89 KiB


 001  <?php
 002  /**
 003   *
 004   * This file is part of the phpBB Forum Software package.
 005   *
 006   * @copyright (c) phpBB Limited <https://www.phpbb.com>
 007   * @license GNU General Public License, version 2 (GPL-2.0)
 008   *
 009   * For full copyright and license information, please see
 010   * the docs/CREDITS.txt file.
 011   *
 012   */
 013   
 014  namespace phpbb\install\controller;
 015   
 016  use phpbb\exception\http_exception;
 017  use phpbb\install\helper\install_helper;
 018  use phpbb\install\helper\iohandler\factory;
 019  use phpbb\install\helper\navigation\navigation_provider;
 020  use phpbb\install\installer;
 021  use phpbb\language\language;
 022  use phpbb\request\request_interface;
 023  use phpbb\template\template;
 024  use Symfony\Component\HttpFoundation\StreamedResponse;
 025   
 026  /**
 027   * Updater controller
 028   */
 029  class update
 030  {
 031      /**
 032       * @var helper
 033       */
 034      protected $controller_helper;
 035   
 036      /**
 037       * @var installer
 038       */
 039      protected $installer;
 040   
 041      /**
 042       * @var install_helper
 043       */
 044      protected $install_helper;
 045   
 046      /**
 047       * @var factory
 048       */
 049      protected $iohandler_factory;
 050   
 051      /**
 052       * @var language
 053       */
 054      protected $language;
 055   
 056      /**
 057       * @var navigation_provider
 058       */
 059      protected $menu_provider;
 060   
 061      /**
 062       * @var request_interface
 063       */
 064      protected $request;
 065   
 066      /**
 067       * @var template
 068       */
 069      protected $template;
 070   
 071      /**
 072       * Constructor
 073       *
 074       * @param helper                $controller_helper
 075       * @param installer                $installer
 076       * @param install_helper        $install_helper
 077       * @param factory                $iohandler
 078       * @param language                $language
 079       * @param navigation_provider    $menu_provider
 080       * @param request_interface        $request
 081       * @param template                $template
 082       */
 083      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)
 084      {
 085          $this->controller_helper    = $controller_helper;
 086          $this->installer            = $installer;
 087          $this->install_helper        = $install_helper;
 088          $this->iohandler_factory    = $iohandler;
 089          $this->language                = $language;
 090          $this->menu_provider        = $menu_provider;
 091          $this->request                = $request;
 092          $this->template                = $template;
 093      }
 094   
 095      /**
 096       * Controller entry point
 097       *
 098       * @return Response|StreamedResponse
 099       *
 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  }
 167