Moodle  2.2.1
http://www.collinsharper.com
file_info Class Reference
Inheritance diagram for file_info:

Public Member Functions

 __construct ($browser, $context)
 get_params ()
 get_visible_name ()
 is_directory ()
 get_children ()
 get_parent ()
 get_params_rawencoded ()
 get_url ($forcedownload=false, $https=false)
 is_readable ()
 is_writable ()
 is_empty_area ()
 get_filesize ()
 get_mimetype ()
 get_timecreated ()
 get_timemodified ()
 get_license ()
 get_author ()
 get_source ()
 get_sortorder ()
 create_directory ($newdirname, $userid=NULL)
 create_file_from_string ($newfilename, $content, $userid=NULL)
 create_file_from_pathname ($newfilename, $pathname, $userid=NULL)
 create_file_from_storedfile ($newfilename, $fid, $userid=NULL)
 delete ()
 copy_to_storage ($contextid, $component, $filearea, $itemid, $filepath, $filename)
 copy_to_pathname ($pathname)

Protected Attributes

 $context
 $browser

Detailed Description

Definition at line 38 of file file_info.php.


Constructor & Destructor Documentation

__construct ( browser,
context 
)

Reimplemented in file_info_context_system.

Definition at line 44 of file file_info.php.


Member Function Documentation

copy_to_pathname ( pathname)

Copy content of this file to local storage, overriding current file if needed.

Parameters:
string$pathnamereal local full file name
Returns:
boolean success

Reimplemented in file_info_stored.

Definition at line 282 of file file_info.php.

copy_to_storage ( contextid,
component,
filearea,
itemid,
filepath,
filename 
)

Copy content of this file to local storage, overriding current file if needed.

Parameters:
int$contextid
string$component
string$filearea
int$itemid
string$filepath
string$filename
Returns:
boolean success

Reimplemented in file_info_stored.

Definition at line 273 of file file_info.php.

create_directory ( newdirname,
userid = NULL 
)

Create new directory, may throw exception - make sure params are valid.

Parameters:
string$newdirnamename of new directory
intid of author, default $USER->id
Returns:
file_info new directory

Reimplemented in file_info_stored.

Definition at line 215 of file file_info.php.

create_file_from_pathname ( newfilename,
pathname,
userid = NULL 
)

Create new file from pathname - make sure params are valid.

Parameters:
string$newfilenamename of new file
string$pathnamelocation of file
intid of author, default $USER->id
Returns:
file_info new file

Reimplemented in file_info_stored.

Definition at line 239 of file file_info.php.

create_file_from_storedfile ( newfilename,
fid,
userid = NULL 
)

Create new file from stored file - make sure params are valid.

Parameters:
string$newfilenamename of new file
mixeddile id or stored_file of file
intid of author, default $USER->id
Returns:
file_info new file

Reimplemented in file_info_stored.

Definition at line 251 of file file_info.php.

create_file_from_string ( newfilename,
content,
userid = NULL 
)

Create new file from string - make sure params are valid.

Parameters:
string$newfilenamename of new file
string$contentof file
intid of author, default $USER->id
Returns:
file_info new file

Reimplemented in file_info_stored.

Definition at line 227 of file file_info.php.

delete ( )

Delete file, make sure file is deletable first.

Returns:
bool success

Reimplemented in file_info_stored.

Definition at line 259 of file file_info.php.

Returns the author name of the file

Returns:
string author name or null

Reimplemented in file_info_stored.

Definition at line 188 of file file_info.php.

Returns file size in bytes, null for directories

Returns:
int bytes or null if not known

Reimplemented in file_info_stored.

Definition at line 148 of file file_info.php.

Returns the license type of the file

Returns:
string license short name or null

Reimplemented in file_info_stored.

Definition at line 180 of file file_info.php.

Returns mimetype

Returns:
string mimetype or null if not known

Reimplemented in file_info_stored.

Definition at line 156 of file file_info.php.

Returns list of standard virtual file/directory identification. The difference from stored_file parameters is that null values are allowed in all fields

Returns:
array with keys contextid, component, filearea, itemid, filepath and filename

Reimplemented in file_info_area_backup_section, file_info_area_course_section, imscp_file_info, file_info_stored, and workshop_file_info_submissions_container.

Definition at line 55 of file file_info.php.

Here is the caller graph for this function:

Returns array of url encoded params.

Returns:
array with numeric keys

Definition at line 92 of file file_info.php.

Here is the call graph for this function:

Returns the sort order of the file

Returns:
int

Reimplemented in file_info_stored.

Definition at line 204 of file file_info.php.

Returns the source of the file

Returns:
string a source url or null

Reimplemented in file_info_stored.

Definition at line 196 of file file_info.php.

Returns time created unix timestamp if known

Returns:
int timestamp or null

Reimplemented in file_info_stored.

Definition at line 164 of file file_info.php.

Returns time modified unix timestamp if known

Returns:
int timestamp or null

Reimplemented in file_info_stored.

Definition at line 172 of file file_info.php.

get_url ( forcedownload = false,
https = false 
)

Returns file download url

Parameters:
bool$forcedownload
bool$httsforce https
Returns:
string url

Reimplemented in file_info_area_course_legacy, and file_info_stored.

Definition at line 111 of file file_info.php.

Is this info area and is it "empty"? Are there any files in subfolders?

This is used mostly in repositories to reduce the number of empty folders. This method may be very slow, use with care.

Returns:
bool

Reimplemented in file_info_area_backup_section, file_info_area_course_section, file_info_context_module, and file_info_stored.

Definition at line 140 of file file_info.php.

Can I read content of this file or enter directory?

Returns:
bool

Reimplemented in file_info_stored.

Definition at line 119 of file file_info.php.


Field Documentation

$browser [protected]

Definition at line 42 of file file_info.php.

$context [protected]

Definition at line 40 of file file_info.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations