TYPO3 API  SVNRelease
Public Member Functions | Public Attributes
t3lib_extFileFunctions Class Reference
Inheritance diagram for t3lib_extFileFunctions:
Inheritance graph
[legend]
Collaboration diagram for t3lib_extFileFunctions:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 start ($fileCmds)
 init_actionPerms ($setup)
 processData ()
 printLogErrorMessages ($redirect= '')
 getErrorMessages ()
 findRecycler ($theFile)
 writeLog ($action, $error, $details_nr, $details, $data)
 func_delete ($cmds)
 func_copy ($cmds)
 func_move ($cmds)
 func_rename ($cmds)
 func_newfolder ($cmds)
 func_newfile ($cmds)
 func_edit ($cmds)
 func_upload ($cmds)
 func_unzip ($cmds)

Public Attributes

 $maxCopyFileSize = 10000
 $maxMoveFileSize = 10000
 $maxUploadFileSize = 10000
 $unzipPath = ''
 $dontCheckForUnique = 0
 $actionPerms
 $recyclerFN = '_recycler_'
 $useRecycler = 1
 $PHPFileFunctions = 0
 $dont_use_exec_commands = 0
 $internalUploadMap = array()
 $lastError = ''

Detailed Description

Definition at line 94 of file class.t3lib_extfilefunc.php.


Member Function Documentation

t3lib_extFileFunctions::findRecycler ( theFile)

Goes back in the path and checks in each directory if a folder named $this->recyclerFN (usually '_recycler_') is present. If a folder in the tree happens to be a _recycler_-folder (which means that we're deleting something inside a _recycler_-folder) this is ignored

Parameters:
stringTakes a valid Path ($theFile)
Returns:
string Returns the path (without trailing slash) of the closest recycle-folder if found. Else false.

Definition at line 334 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions\checkPathAgainstMounts(), t3lib_basicFileFunctions\cleanDirectoryName(), t3lib_basicFileFunctions\isPathValid(), and t3lib_div\split_fileref().

Referenced by func_delete().

t3lib_extFileFunctions::func_copy ( cmds)

Copying files and folders (action=2)

Parameters:
array$cmds,['data']is the file/folder to copy. $cmds['target'] is the path where to copy to. $cmds['altName'] (boolean): If set, another filename is found in case the target already exists
Returns:
string Returns the new filename upon success

Definition at line 469 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions\checkIfAllowed(), t3lib_basicFileFunctions\checkIfFullAccess(), t3lib_basicFileFunctions\checkPathAgainstMounts(), t3lib_utility_Command\exec(), t3lib_div\fixPermissions(), t3lib_basicFileFunctions\getUniqueName(), t3lib_basicFileFunctions\is_directory(), t3lib_div\isFirstPartOfStr(), t3lib_basicFileFunctions\isPathValid(), and t3lib_div\split_fileref().

Referenced by processData().

t3lib_extFileFunctions::func_delete ( cmds)

Deleting files and folders (action=4)

Parameters:
array$cmds,['data']is the file/folder to delete
Returns:
boolean Returns true upon success

Definition at line 384 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions\checkPathAgainstMounts(), findRecycler(), func_move(), t3lib_basicFileFunctions\is_directory(), t3lib_basicFileFunctions\isPathValid(), and t3lib_div\rmdir().

Referenced by processData().

t3lib_extFileFunctions::func_edit ( cmds)

Editing textfiles or folders (action=9)

Parameters:
array$cmds,['data']is the new content. $cmds['target'] is the target (file or dir)
Returns:
boolean Returns true on success

Definition at line 877 of file class.t3lib_extfilefunc.php.

References $content, $GLOBALS, t3lib_basicFileFunctions\checkIfAllowed(), t3lib_basicFileFunctions\checkPathAgainstMounts(), t3lib_div\inList(), t3lib_div\split_fileref(), and t3lib_div\writeFile().

Referenced by processData().

t3lib_extFileFunctions::func_move ( cmds)

Moving files and folders (action=3)

Parameters:
array$cmds,['data']is the file/folder to move. $cmds['target'] is the path where to move to. $cmds['altName'] (boolean): If set, another filename is found in case the target already exists
Returns:
string Returns the new filename upon success

Definition at line 588 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions\checkIfAllowed(), t3lib_basicFileFunctions\checkIfFullAccess(), t3lib_basicFileFunctions\checkPathAgainstMounts(), t3lib_utility_Command\exec(), t3lib_basicFileFunctions\getUniqueName(), t3lib_basicFileFunctions\is_directory(), t3lib_div\isFirstPartOfStr(), t3lib_basicFileFunctions\isPathValid(), and t3lib_div\split_fileref().

Referenced by func_delete(), and processData().

t3lib_extFileFunctions::func_newfile ( cmds)

This creates a new file. (action=8)

Parameters:
array$cmds,['data']is the new filename. $cmds['target'] is the path where to create it
Returns:
string Returns the new filename upon success

Definition at line 822 of file class.t3lib_extfilefunc.php.

References $GLOBALS, t3lib_basicFileFunctions\checkFileNameLen(), t3lib_basicFileFunctions\checkIfAllowed(), t3lib_basicFileFunctions\checkPathAgainstMounts(), t3lib_basicFileFunctions\cleanFileName(), t3lib_div\inList(), t3lib_basicFileFunctions\is_directory(), t3lib_div\split_fileref(), and t3lib_div\writeFile().

Referenced by processData().

t3lib_extFileFunctions::func_newfolder ( cmds)

This creates a new folder. (action=6)

Parameters:
array$cmds,['data']is the foldername. $cmds['target'] is the path where to create it.
Returns:
string Returns the new foldername upon success

Definition at line 778 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions\checkFileNameLen(), t3lib_basicFileFunctions\checkPathAgainstMounts(), t3lib_basicFileFunctions\cleanFileName(), t3lib_basicFileFunctions\is_directory(), and t3lib_div\mkdir().

Referenced by processData().

t3lib_extFileFunctions::func_rename ( cmds)

Renaming files or foldes (action=5)

Parameters:
array$cmds,['data']is the new name. $cmds['target'] is the target (file or dir).
Returns:
string Returns the new filename upon success

Definition at line 710 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions\checkFileNameLen(), t3lib_basicFileFunctions\checkIfAllowed(), t3lib_basicFileFunctions\checkPathAgainstMounts(), t3lib_basicFileFunctions\cleanFileName(), and t3lib_div\split_fileref().

Referenced by processData().

t3lib_extFileFunctions::func_unzip ( cmds)

Unzipping file (action=7) This is permitted only if the user has fullAccess or if the file resides

Parameters:
array$cmds,['data']is the zip-file. $cmds['target'] is the target directory. If not set we'll default to the same directory as the file is in.
Returns:
boolean Returns true on success

Definition at line 980 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions\checkIfFullAccess(), t3lib_basicFileFunctions\checkPathAgainstMounts(), t3lib_utility_Command\exec(), t3lib_basicFileFunctions\is_directory(), and t3lib_div\split_fileref().

Referenced by processData().

t3lib_extFileFunctions::func_upload ( cmds)

Upload of files (action=1)

Parameters:
array$cmds,['data']is the ID-number (points to the global var that holds the filename-ref ($_FILES['upload_'.$id]['name']). $cmds['target'] is the target directory, $cmds['charset'] is the the character set of the file name (utf-8 is needed for JS-interaction)
Returns:
string Returns the new filename upon success

Definition at line 923 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions\checkIfAllowed(), t3lib_basicFileFunctions\checkPathAgainstMounts(), t3lib_basicFileFunctions\cleanFileName(), t3lib_basicFileFunctions\getUniqueName(), t3lib_basicFileFunctions\is_directory(), t3lib_div\split_fileref(), and t3lib_div\upload_copy_move().

Referenced by processData().

t3lib_extFileFunctions::getErrorMessages ( )

Adds log error messages from the previous file operations of this script instance to the FlashMessageQueue

Returns:
void

Definition at line 303 of file class.t3lib_extfilefunc.php.

References $GLOBALS, $res, $row, t3lib_FlashMessageQueue\addMessage(), t3lib_message_AbstractMessage\ERROR, and t3lib_div\makeInstance().

Referenced by printLogErrorMessages().

t3lib_extFileFunctions::init_actionPerms ( setup)

Sets up permission to perform file/directory operations. See below or the be_user-table for the significance of the various bits in $setup.

Parameters:
integerFile permission integer from BE_USER OR'ed with permissions of back-end groups this user is a member of
Returns:
void

Definition at line 170 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::printLogErrorMessages ( redirect = '')

Adds log error messages from the operations of this script instance to the FlashMessageQueue

Parameters:
stringRedirect URL (for creating link in message)
Returns:
void

Definition at line 292 of file class.t3lib_extfilefunc.php.

References getErrorMessages().

t3lib_extFileFunctions::processData ( )

Processing the command array in $this->fileCmdMap

Returns:
mixed false, if the file functions were not initialized otherwise returns an array of all the results that are returned from each command, separated in each action.

Definition at line 204 of file class.t3lib_extfilefunc.php.

References $GLOBALS, func_copy(), func_delete(), func_edit(), func_move(), func_newfile(), func_newfolder(), func_rename(), func_unzip(), func_upload(), and t3lib_div\getUserObj().

t3lib_extFileFunctions::start ( fileCmds)

Initialization of the class

Parameters:
arrayThe $file array with the commands to execute. See "TYPO3 Core API" document
Returns:
void

Definition at line 140 of file class.t3lib_extfilefunc.php.

References $GLOBALS, and t3lib_div\getMaxUploadFileSize().

t3lib_extFileFunctions::writeLog ( action,
error,
details_nr,
details,
data 
)

Logging file operations

Parameters:
integerThe action number. See the functions in the class for a hint. Eg. edit is '9', upload is '1' ...
integerThe severity: 0 = message, 1 = error, 2 = System Error, 3 = security notice (admin)
integerThis number is unique for every combination of $type and $action. This is the error-message number, which can later be used to translate error messages.
stringThis is the default, raw error message in english
arrayArray with special information that may go into $details by "%s" marks / sprintf() when the log is shown
Returns:
void
See also:
class.t3lib_userauthgroup.php

Definition at line 363 of file class.t3lib_extfilefunc.php.

References $GLOBALS.


Member Data Documentation

t3lib_extFileFunctions::$actionPerms
Initial value:
 Array( 
        'deleteFile' => 0, 
        'deleteFolder' => 0, 
        'deleteFolderRecursively' => 0, 
        'moveFile' => 0,
        'moveFolder' => 0,
        'copyFile' => 0,
        'copyFolder' => 0,
        'newFolder' => 0,
        'newFile' => 0,
        'editFile' => 0,
        'unzipFile' => 0,
        'uploadFile' => 0,
        'renameFile' => 0,
        'renameFolder' => 0
    )

Definition at line 104 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$dont_use_exec_commands = 0

Definition at line 126 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$dontCheckForUnique = 0

Definition at line 102 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$internalUploadMap = array()

Definition at line 129 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$lastError = ''

Definition at line 131 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$maxCopyFileSize = 10000

Definition at line 98 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$maxMoveFileSize = 10000

Definition at line 99 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$maxUploadFileSize = 10000

Definition at line 100 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$PHPFileFunctions = 0

Definition at line 125 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$recyclerFN = '_recycler_'

Definition at line 121 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$unzipPath = ''

Definition at line 101 of file class.t3lib_extfilefunc.php.

t3lib_extFileFunctions::$useRecycler = 1

Definition at line 122 of file class.t3lib_extfilefunc.php.


The documentation for this class was generated from the following file: