Class filespec

Description

Responsible for holding all file relevant information, as well as doing file-specific operations.

The fileupload class can be used to upload several files, each of them being this object to operate further on.

Located in /includes/functions_upload.php (line 24)


	
			
Direct descendents
Class Description
 class fileerror Class for assigning error messages before a real filespec class can be assigned
Variable Summary
 mixed $error
 mixed $extension
 mixed $filename
 mixed $filesize
 mixed $file_moved
 mixed $height
 mixed $image_info
 mixed $init_error
 mixed $local
 mixed $mimetype
 mixed $realname
 mixed $upload
 mixed $uploadname
 mixed $width
Method Summary
 filespec filespec ( $upload_ary,  $upload_namespace)
 void check_content ( $disallowed_content)
 void clean_filename ([real|unique|unique_ext $mode = 'unique'], [string $prefix = ''], [ $user_id = ''])
 void get ( $property)
 void get_extension ( $filename)
 void get_filesize ( $filename)
 void get_mimetype ( $filename)
 true is_image ()
 true is_uploaded ()
 void move_file ( $destination, [bool $overwrite = false], [ $skip_image_check = false], [octal $chmod = 0666], string $destination_path)
 void remove ()
Variables
mixed $destination_file = '' (line 36)
mixed $destination_path = '' (line 37)
mixed $error = array() (line 43)
mixed $extension = '' (line 30)
mixed $filename = '' (line 26)
mixed $filesize = 0 (line 31)
mixed $file_moved = false (line 39)
mixed $height = 0 (line 33)
mixed $image_info = array() (line 34)
mixed $init_error = false (line 40)
mixed $local = false (line 41)
mixed $mimetype = '' (line 29)
mixed $realname = '' (line 27)
mixed $upload = '' (line 45)
mixed $uploadname = '' (line 28)
mixed $width = 0 (line 32)
Methods
Constructor filespec (line 51)

File Class

  • access: private
filespec filespec ( $upload_ary,  $upload_namespace)
  • $upload_ary
  • $upload_namespace
additional_checks (line 405)

Performing additional checks

void additional_checks ()
check_content (line 236)

Check the first 256 bytes for forbidden content

void check_content ( $disallowed_content)
  • $disallowed_content
clean_filename (line 92)

Cleans destination filename

  • access: public
void clean_filename ([real|unique|unique_ext $mode = 'unique'], [string $prefix = ''], [ $user_id = ''])
  • real|unique|unique_ext $mode: real creates a realname, filtering some characters, lowering every character. Unique creates an unique filename
  • string $prefix: Prefix applied to filename
  • $user_id
get (line 137)

Get property from file object

void get ( $property)
  • $property
get_extension (line 191)

Get file extension

void get_extension ( $filename)
  • $filename
get_filesize (line 227)

Get filesize

void get_filesize ( $filename)
  • $filename
get_mimetype (line 206)

Get mimetype. Utilize mime_content_type if the function exist.

Not used at the moment...

void get_mimetype ( $filename)
  • $filename
is_image (line 152)

Check if file is an image (mimetype)

  • return: if it is an image, false if not
true is_image ()
is_uploaded (line 162)

Check if the file got correctly uploaded

  • return: if it is a valid upload, false if not
true is_uploaded ()
move_file (line 269)

Move file to destination folder The phpbb_root_path variable will be applied to the destination path

  • access: public
void move_file ( $destination, [bool $overwrite = false], [ $skip_image_check = false], [octal $chmod = 0666], string $destination_path)
  • string $destination_path: Destination path, for example $config['avatar_path']
  • bool $overwrite: If set to true, an already existing file will be overwritten
  • octal $chmod: Permission mask for chmodding the file after a successful move
  • $destination
  • $skip_image_check
remove (line 180)

Remove file

void remove ()

Documentation generated on Sat, 05 Jul 2008 17:31:36 +0200 by phpDocumentor 1.4.2