[ Index ]

PHP Cross Reference of phpBB-3.2.11-deutsch




/phpbb/files/ -> filespec.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: 584 lines (15 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

filespec:: (16 methods):

Class: filespec  - X-Ref

Responsible for holding all file relevant information, as well as doing file-specific operations.
The {@link fileupload fileupload class} can be used to upload several files, each of them being this object to operate further on.

__construct(\phpbb\filesystem\filesystem_interface $phpbb_filesystem, language $language, \bantu\IniGetWrapper\IniGetWrapper $php_ini, \FastImageSize\FastImageSize $imagesize, $phpbb_root_path, \phpbb\mimetype\guesser $mimetype_guesser = null, \phpbb\plupload\plupload $plupload = null)   X-Ref
File upload class

param: \phpbb\filesystem\filesystem_interface    $phpbb_filesystem Filesystem
param: language                    $language Language
param: \bantu\IniGetWrapper\IniGetWrapper            $php_ini ini_get() wrapper
param: \FastImageSize\FastImageSize $imagesize Imagesize class
param: string                    $phpbb_root_path phpBB root path
param: \phpbb\mimetype\guesser    $mimetype_guesser Mime type guesser
param: \phpbb\plupload\plupload    $plupload Plupload

set_upload_ary($upload_ary)   X-Ref
Set upload ary

param: array $upload_ary Upload ary
return: filespec This instance of the filespec class

set_upload_namespace($namespace)   X-Ref
Set the upload namespace

param: upload $namespace Instance of upload class
return: filespec This instance of the filespec class

init_error()   X-Ref
Check if class members were not properly initialised yet

return: bool True if there was an init error, false if not

set_error($error)   X-Ref
Set error in error array

param: mixed $error Content for error array
return: \phpbb\files\filespec This instance of the filespec class

clean_filename($mode = 'unique', $prefix = '', $user_id = '')   X-Ref
Cleans destination filename

param: string $mode Either real, unique, or unique_ext. Real creates a
param: string $prefix Prefix applied to filename
param: string $user_id The user_id is only needed for when cleaning a user's avatar

get($property)   X-Ref
Get property from file object

param: string $property Name of property
return: mixed Content of property

is_image()   X-Ref
Check if file is an image (mime type)

return: bool true if it is an image, false if not

is_uploaded()   X-Ref
Check if the file got correctly uploaded

return: bool true if it is a valid upload, false if not

remove()   X-Ref
Remove file

get_extension($filename)   X-Ref
Get file extension

param: string $filename Filename that needs to be checked
return: string Extension of the supplied filename

get_mimetype($filename)   X-Ref
Get mime type

param: string $filename Filename that needs to be checked
return: string Mime type of supplied filename

get_filesize($filename)   X-Ref
Get file size

param: string $filename File name of file to check
return: int File size

check_content($disallowed_content)   X-Ref
Check the first 256 bytes for forbidden content

param: array $disallowed_content Array containg disallowed content
return: bool False if disallowed content found, true if not

move_file($destination, $overwrite = false, $skip_image_check = false, $chmod = false)   X-Ref
Move file to destination folder
The phpbb_root_path variable will be applied to the destination path

param: string $destination Destination path, for example $config['avatar_path']
param: bool $overwrite If set to true, an already existing file will be overwritten
param: bool $skip_image_check If set to true, the check for the file to be a valid image is skipped
param: string|bool $chmod Permission mask for chmodding the file after a successful move.
return: bool True if file was moved, false if not

additional_checks()   X-Ref
Performing additional checks

return: bool False if issue was found, true if not

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