Verzeichnisstruktur phpBB-3.2.0


Veröffentlicht
06.01.2017

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: 09.10.2024, 12:54 - Dateigröße: 3.98 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   
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   
139              return $response;
140          }
141          else
142          {
143              // Determine whether the installation was started or not
144              if (true)
145              {
146                  // Set active stage
147                  $this->menu_provider->set_nav_property(
148                      array('install', 0, 'introduction'),
149                      array(
150                          'selected'    => true,
151                          'completed'    => false,
152                      )
153                  );
154   
155                  // If not, let's render the welcome page
156                  $this->template->assign_vars(array(
157                      'SHOW_INSTALL_START_FORM'    => true,
158                      'TITLE'                        => $this->language->lang('INSTALL_INTRO'),
159                      'CONTENT'                    => $this->language->lang('INSTALL_INTRO_BODY'),
160                  ));
161   
162                  /** @var \phpbb\install\helper\iohandler\iohandler_interface $iohandler */
163                  $iohandler = $this->iohandler_factory->get();
164                  $this->controller_helper->handle_navigation($iohandler);
165   
166                  return $this->controller_helper->render('installer_install.html', 'INSTALL', true);
167              }
168   
169              // @todo: implement no js controller logic
170          }
171      }
172  }
173