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

download_updated_files.php

Zuletzt modifiziert: 09.10.2024, 12:57 - Dateigröße: 2.65 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\module\update_filesystem\task;
 015   
 016  use phpbb\filesystem\filesystem;
 017  use phpbb\install\exception\jump_to_restart_point_exception;
 018  use phpbb\install\exception\user_interaction_required_exception;
 019  use phpbb\install\helper\config;
 020  use phpbb\install\helper\iohandler\iohandler_interface;
 021  use phpbb\install\task_base;
 022   
 023  class download_updated_files extends task_base
 024  {
 025      /**
 026       * @var config
 027       */
 028      protected $installer_config;
 029   
 030      /**
 031       * @var filesystem
 032       */
 033      protected $filesystem;
 034   
 035      /**
 036       * @var iohandler_interface
 037       */
 038      protected $iohandler;
 039   
 040      /**
 041       * Constructor
 042       *
 043       * @param config                $config
 044       * @param iohandler_interface    $iohandler
 045       * @param filesystem            $filesystem
 046       */
 047      public function __construct(config $config, iohandler_interface $iohandler, filesystem $filesystem)
 048      {
 049          $this->installer_config    = $config;
 050          $this->iohandler        = $iohandler;
 051          $this->filesystem        = $filesystem;
 052   
 053          parent::__construct(false);
 054      }
 055   
 056      /**
 057       * {@inheritdoc}
 058       */
 059      public function check_requirements()
 060      {
 061          return $this->installer_config->get('do_update_files', false)
 062              && $this->installer_config->get('file_update_method', '') === 'compression';
 063      }
 064   
 065      /**
 066       * {@inheritdoc}
 067       */
 068      public function run()
 069      {
 070          if ($this->iohandler->get_input('database_update_submit', false))
 071          {
 072              // Remove archive
 073              $this->filesystem->remove(
 074                  $this->installer_config->get('update_file_archive', null)
 075              );
 076   
 077              $this->installer_config->set('update_file_archive', null);
 078          }
 079          else if ($this->iohandler->get_input('update_recheck_files_submit', false))
 080          {
 081              throw new jump_to_restart_point_exception('check_update_files');
 082          }
 083          else
 084          {
 085              // Render download box
 086              $this->iohandler->add_download_link(
 087                  'phpbb_installer_update_file_download',
 088                  'DOWNLOAD_UPDATE_METHOD',
 089                  'DOWNLOAD_UPDATE_METHOD_EXPLAIN'
 090              );
 091   
 092              // Add form to continue update
 093              $this->iohandler->add_user_form_group('UPDATE_CONTINUE_UPDATE_PROCESS', array(
 094                  'update_recheck_files_submit'    => array(
 095                      'label'    => 'UPDATE_RECHECK_UPDATE_FILES',
 096                      'type'    => 'submit',
 097                  ),
 098                  'database_update_submit'    => array(
 099                      'label'    => 'UPDATE_CONTINUE_UPDATE_PROCESS',
 100                      'type'    => 'submit',
 101                  ),
 102              ));
 103   
 104              throw new user_interaction_required_exception();
 105          }
 106      }
 107   
 108      /**
 109       * {@inheritdoc}
 110       */
 111      static public function get_step_count()
 112      {
 113          return 0;
 114      }
 115   
 116      /**
 117       * {@inheritdoc}
 118       */
 119      public function get_task_lang_name()
 120      {
 121          return '';
 122      }
 123  }
 124