Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
download_updated_files.php
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 $this->installer_config->set('file_updater_elem_progress', '');
082 $this->installer_config->set('update_files', array());
083 throw new jump_to_restart_point_exception('check_update_files');
084 }
085 else
086 {
087 $file_update_info = $this->installer_config->get('update_files', array());
088
089 // Display download box only if the archive won't be empty
090 $display_download_link = !empty($file_update_info) && !(isset($file_update_info['delete']) && count($file_update_info) == 1);
091 if ($display_download_link)
092 {
093 // Render download box
094 $this->iohandler->add_download_link(
095 'phpbb_installer_update_file_download',
096 'DOWNLOAD_UPDATE_METHOD',
097 'DOWNLOAD_UPDATE_METHOD_EXPLAIN'
098 );
099 }
100
101 // Add form to continue update
102 $this->iohandler->add_user_form_group('UPDATE_CONTINUE_UPDATE_PROCESS', array(
103 'update_recheck_files_submit' => array(
104 'label' => 'UPDATE_RECHECK_UPDATE_FILES',
105 'type' => 'submit',
106 'is_secondary' => empty($file_update_info),
107 ),
108 'database_update_submit' => array(
109 'label' => 'UPDATE_CONTINUE_UPDATE_PROCESS',
110 'type' => 'submit',
111 'disabled' => $display_download_link,
112 ),
113 ));
114
115 throw new user_interaction_required_exception();
116 }
117 }
118
119 /**
120 * {@inheritdoc}
121 */
122 static public function get_step_count()
123 {
124 return 0;
125 }
126
127 /**
128 * {@inheritdoc}
129 */
130 public function get_task_lang_name()
131 {
132 return '';
133 }
134 }
135