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

install.php

Zuletzt modifiziert: 01.05.2026, 11:25 - Dateigröße: 4.04 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\navigation\navigation_provider;
 019  use Symfony\Component\HttpFoundation\StreamedResponse;
 020  use Symfony\Component\HttpFoundation\Response;
 021  use phpbb\install\helper\iohandler\factory;
 022  use phpbb\template\template;
 023  use phpbb\request\request_interface;
 024  use phpbb\install\installer;
 025  use phpbb\language\language;
 026   
 027  /**
 028   * Controller for installing phpBB
 029   */
 030  class install
 031  {
 032      /**
 033       * @var helper
 034       */
 035      protected $controller_helper;
 036   
 037      /**
 038       * @var factory
 039       */
 040      protected $iohandler_factory;
 041   
 042      /**
 043       * @var navigation_provider
 044       */
 045      protected $menu_provider;
 046   
 047      /**
 048       * @var language
 049       */
 050      protected $language;
 051   
 052      /**
 053       * @var template
 054       */
 055      protected $template;
 056   
 057      /**
 058       * @var request_interface
 059       */
 060      protected $request;
 061   
 062      /**
 063       * @var installer
 064       */
 065      protected $installer;
 066   
 067      /**
 068       * @var install_helper
 069       */
 070      protected $install_helper;
 071   
 072      /**
 073       * Constructor
 074       *
 075       * @param helper                 $helper
 076       * @param factory                 $factory
 077       * @param navigation_provider    $nav_provider
 078       * @param language                $language
 079       * @param template                $template
 080       * @param request_interface        $request
 081       * @param installer                $installer
 082       * @param install_helper        $install_helper
 083       */
 084      public function __construct(helper $helper, factory $factory, navigation_provider $nav_provider, language $language, template $template, request_interface $request, installer $installer, install_helper $install_helper)
 085      {
 086          $this->controller_helper    = $helper;
 087          $this->iohandler_factory    = $factory;
 088          $this->menu_provider        = $nav_provider;
 089          $this->language                = $language;
 090          $this->template                = $template;
 091          $this->request                = $request;
 092          $this->installer            = $installer;
 093          $this->install_helper        = $install_helper;
 094      }
 095   
 096      /**
 097       * Controller logic
 098       *
 099       * @return Response|StreamedResponse
 100       *
 101       * @throws http_exception When phpBB is already installed
 102       */
 103      public function handle()
 104      {
 105          if ($this->install_helper->is_phpbb_installed())
 106          {
 107              throw new http_exception(403, 'INSTALL_PHPBB_INSTALLED');
 108          }
 109   
 110          $this->template->assign_vars(array(
 111              'U_ACTION' => $this->controller_helper->route('phpbb_installer_install'),
 112          ));
 113   
 114          // Set up input-output handler
 115          if ($this->request->is_ajax())
 116          {
 117              $this->iohandler_factory->set_environment('ajax');
 118          }
 119          else
 120          {
 121              $this->iohandler_factory->set_environment('nojs');
 122          }
 123   
 124          // Set the appropriate input-output handler
 125          $this->installer->set_iohandler($this->iohandler_factory->get());
 126          $this->controller_helper->handle_language_select();
 127          $this->controller_helper->handle_installer_restart();
 128   
 129          if ($this->request->is_ajax())
 130          {
 131              $installer = $this->installer;
 132              $response = new StreamedResponse();
 133              $response->setCallback(function() use ($installer) {
 134                  $installer->run();
 135              });
 136   
 137              // Try to bypass any server output buffers
 138              $response->headers->set('X-Accel-Buffering', 'no');
 139   
 140              return $response;
 141          }
 142          else
 143          {
 144              // Determine whether the installation was started or not
 145              if (true)
 146              {
 147                  // Set active stage
 148                  $this->menu_provider->set_nav_property(
 149                      array('install', 0, 'introduction'),
 150                      array(
 151                          'selected'    => true,
 152                          'completed'    => false,
 153                      )
 154                  );
 155   
 156                  // If not, let's render the welcome page
 157                  $this->template->assign_vars(array(
 158                      'SHOW_INSTALL_START_FORM'    => true,
 159                      'TITLE'                        => $this->language->lang('INSTALL_INTRO'),
 160                      'CONTENT'                    => $this->language->lang('INSTALL_INTRO_BODY'),
 161                  ));
 162   
 163                  /** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */
 164                  $iohandler = $this->iohandler_factory->get();
 165                  $this->controller_helper->handle_navigation($iohandler);
 166   
 167                  return $this->controller_helper->render('installer_install.html', 'INSTALL', true);
 168              }
 169   
 170              // @todo: implement no js controller logic
 171          }
 172      }
 173  }
 174