[ Index ]

PHP Cross Reference of phpBB-3.2.11-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: 418 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.

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

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

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.
return: null

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

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

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

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

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

param: string $form_name The name of the file in the form data
return: null

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

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



Generated: Wed Nov 11 20:33:01 2020 Cross-referenced by PHPXref 0.7.1