[ Index ]

PHP Cross Reference of phpBB-3.3.0-deutsch

title

Body

[close]

/phpbb/plupload/ -> plupload.php (summary)

This file is part of the phpBB Forum Software package.

Copyright: (c) phpBB Limited
License: GNU General Public License, version 2 (GPL-2.0)
File Size: 417 lines (11 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

plupload:: (14 methods):
  __construct()
  handle_upload()
  configure()
  is_active()
  is_multipart()
  emit_error()
  generate_filter_string()
  generate_resize_string()
  get_chunk_size()
  temporary_filepath()
  integrate_uploaded_file()
  prepare_temporary_directory()
  set_default_directories()
  set_upload_directories()


Class: plupload  - X-Ref

This class handles all server-side plupload functions

__construct($phpbb_root_path, \phpbb\config\config $config, \phpbb\request\request_interface $request, \phpbb\user $user, \bantu\IniGetWrapper\IniGetWrapper $php_ini, \phpbb\mimetype\guesser $mimetype_guesser)   X-Ref
Constructor.

param: string $phpbb_root_path
param: \phpbb\config\config $config
param: \phpbb\request\request_interface $request
param: \phpbb\user $user
param: \bantu\IniGetWrapper\IniGetWrapper $php_ini
param: \phpbb\mimetype\guesser $mimetype_guesser

handle_upload($form_name)   X-Ref
Plupload allows for chunking so we must check for that and assemble
the whole file first before performing any checks on it.

return: array|null    null if there are no chunks to piece together
param: string $form_name The name of the file element in the upload form

configure(\phpbb\cache\service $cache, \phpbb\template\template $template, $s_action, $forum_id, $max_files)   X-Ref
Fill in the plupload configuration options in the template

return: null
param: \phpbb\cache\service        $cache
param: \phpbb\template\template    $template
param: string                        $s_action The URL to submit the POST data to
param: int                        $forum_id The ID of the forum
param: int                        $max_files Maximum number of files allowed. 0 for unlimited.

is_active()   X-Ref
Checks whether the page request was sent by plupload or not

return: bool

is_multipart()   X-Ref
Returns whether the current HTTP request is a multipart request.

return: bool

emit_error($code, $msg)   X-Ref
Sends an error message back to the client via JSON response

return: null
param: int $code        The error code
param: string $msg    The translation string of the message to be sent

generate_filter_string(\phpbb\cache\service $cache, $forum_id)   X-Ref
Looks at the list of allowed extensions and generates a string
appropriate for use in configuring plupload with

return: string
param: \phpbb\cache\service    $cache        Cache service object
param: string                $forum_id    The forum identifier

generate_resize_string()   X-Ref
Generates a string that is used to tell plupload to automatically resize
files before uploading them.

return: string

get_chunk_size()   X-Ref
Checks various php.ini values to determine the maximum chunk
size a file should be split into for upload.

The intention is to calculate a value which reflects whatever
the most restrictive limit is set to.  And to then set the chunk
size to half that value, to ensure any required transfer overhead
and POST data remains well within the limit.  Or, if all of the
limits are set to unlimited, the chunk size will also be unlimited.

return: int

temporary_filepath($file_name)   X-Ref
No description

integrate_uploaded_file($form_name, $chunk, $file_path)   X-Ref
Checks whether the chunk we are about to deal with was actually uploaded
by PHP and actually exists, if not, it generates an error

return: null
param: string $form_name The name of the file in the form data
param: int $chunk Chunk number
param: string $file_path File path

prepare_temporary_directory()   X-Ref
Creates the temporary directory if it does not already exist.

return: null

set_default_directories()   X-Ref
Sets the default directories for uploads

return: null

set_upload_directories($upload_directory, $temporary_directory)   X-Ref
Sets the upload directories to the specified paths

return: null
param: string $upload_directory Upload directory
param: string $temporary_directory Temporary directory



Generated: Tue Apr 7 19:44:41 2020 Cross-referenced by PHPXref 0.7.1