[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/core/ -> file_api.php (summary)

File API

Copyright: Copyright (C) 2000 - 2002 Kenzaburo Ito - kenito@300baud.org
Copyright: Copyright (C) 2002 - 2011 MantisBT Team - mantisbt-dev@lists.sourceforge.net
File Size: 1019 lines (33 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 35 functions

  file_get_display_name()
  file_bug_attachment_count()
  file_bug_has_attachments()
  file_can_view_bug_attachments()
  file_can_download_bug_attachments()
  file_can_delete_bug_attachments()
  file_get_icon_url()
  file_path_combine()
  file_normalize_attachment_path()
  file_get_visible_attachments()
  file_delete_attachments()
  file_delete_project_files()
  file_ftp_cache_cleanup()
  file_ftp_connect()
  file_ftp_put()
  file_ftp_get()
  file_ftp_delete()
  file_ftp_disconnect()
  file_delete_local()
  file_get_field()
  file_delete()
  file_type_check()
  file_clean_name()
  file_generate_name()
  file_generate_unique_name()
  diskfile_is_name_unique()
  file_is_name_unique()
  file_add()
  file_is_uploading_enabled()
  file_allow_project_upload()
  file_allow_bug_upload()
  file_ensure_valid_upload_path()
  file_ensure_uploaded()
  file_get_content()
  file_move_bug_attachments()

Functions
Functions that are not part of a class:

file_get_display_name( $p_filename )   X-Ref
No description

file_bug_attachment_count( $p_bug_id )   X-Ref
No description

file_bug_has_attachments( $p_bug_id )   X-Ref
No description

file_can_view_bug_attachments( $p_bug_id, $p_uploader_user_id = null )   X-Ref
No description

file_can_download_bug_attachments( $p_bug_id, $p_uploader_user_id = null )   X-Ref
No description

file_can_delete_bug_attachments( $p_bug_id, $p_uploader_user_id = null )   X-Ref
No description

file_get_icon_url( $p_display_filename )   X-Ref
No description

file_path_combine( $p_path, $p_filename )   X-Ref
Combines a path and a file name making sure that the separator exists.

param: string $p_path       The path.
param: string $p_filename   The file name.
return: The combined full path.

file_normalize_attachment_path( $p_diskfile, $p_project_id )   X-Ref
Nomalizes the disk file path based on the following algorithm:
1. If disk file exists, then return as is.
2. If not, and a project path is available, then check with that, if exists return it.
3. If not, then use default upload path, then check with that, if exists return it.
4. If disk file doesn't include a path, then return expected path based on project path or default path.
5. Otherwise return as is.

param: string $p_diskfile  The disk file (full path or just filename).
param: integer The project id - shouldn't be 0 (ALL_PROJECTS).
return: The normalized full path.

file_get_visible_attachments( $p_bug_id )   X-Ref
No description

file_delete_attachments( $p_bug_id )   X-Ref
No description

file_delete_project_files( $p_project_id )   X-Ref
No description

file_ftp_cache_cleanup()   X-Ref
No description

file_ftp_connect()   X-Ref
No description

file_ftp_put( $p_conn_id, $p_remote_filename, $p_local_filename )   X-Ref
No description

file_ftp_get( $p_conn_id, $p_local_filename, $p_remote_filename )   X-Ref
No description

file_ftp_delete( $p_conn_id, $p_filename )   X-Ref
No description

file_ftp_disconnect( $p_conn_id )   X-Ref
No description

file_delete_local( $p_filename )   X-Ref
No description

file_get_field( $p_file_id, $p_field_name, $p_table = 'bug' )   X-Ref
No description

file_delete( $p_file_id, $p_table = 'bug' )   X-Ref
No description

file_type_check( $p_file_name )   X-Ref
No description

file_clean_name( $p_filename )   X-Ref
No description

file_generate_name( $p_seed )   X-Ref
No description

file_generate_unique_name( $p_seed, $p_filepath )   X-Ref
No description

diskfile_is_name_unique( $p_name, $p_filepath )   X-Ref
No description

file_is_name_unique( $p_name, $p_bug_id )   X-Ref
No description

file_add( $p_bug_id, $p_file, $p_table = 'bug', $p_title = '', $p_desc = '', $p_user_id = null, $p_date_added = 0, $p_skip_bug_update = false )   X-Ref
Add a file to the system using the configured storage method

param: integer $p_bug_id the bug id
param: array $p_file the uploaded file info, as retrieved from gpc_get_file()
param: string $p_table table ('bug' or 'doc')
param: string $p_title file title
param: string $p_desc file description
param: int $p_user_id user id
param: int $p_date_added date added
param: bool $p_skip_bug_update skip bug last modification update (useful when importing bug attachments)

file_is_uploading_enabled()   X-Ref
No description

file_allow_project_upload( $p_project_id = null, $p_user_id = null )   X-Ref
No description

file_allow_bug_upload( $p_bug_id = null, $p_user_id = null )   X-Ref
No description

file_ensure_valid_upload_path( $p_upload_path )   X-Ref
No description

file_ensure_uploaded( $p_file )   X-Ref
Ensure a file was uploaded

This function perform various checks for determining if the upload
was successful

param: array $p_file the uploaded file info, as retrieved from gpc_get_file()

file_get_content( $p_file_id, $p_type = 'bug' )   X-Ref
Get file content

param: int $p_file_id file id
param: string $p_type file type (either 'bug' or 'doc')
return: array|bool array containing file type and content or false on failure to retrieve file

file_move_bug_attachments( $p_bug_id, $p_project_id_to )   X-Ref
Move any attachments as needed when a bug is moved from project to project.

param: int $p_bug_id ID of bug containing attachments to be moved
param: int $p_project_id_to destination project ID for the bug
return: null



Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7