Documentation TYPO3 par Ameos

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='')
 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()

Detailed Description

Definition at line 105 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:
string Takes a valid Path ($theFile)
Returns:
string Returns the path (without trailing slash) of the closest recycle-folder if found. Else false.

Definition at line 328 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 451 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions::checkIfAllowed(), t3lib_basicFileFunctions::checkIfFullAccess(), t3lib_basicFileFunctions::checkPathAgainstMounts(), 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(), and t3lib_basicFileFunctions::isPathValid().

Referenced by processData().

t3lib_extFileFunctions::func_edit cmds  ) 
 

Editing textfiles or foldes (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 750 of file class.t3lib_extfilefunc.php.

References 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 542 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions::checkIfAllowed(), t3lib_basicFileFunctions::checkIfFullAccess(), t3lib_basicFileFunctions::checkPathAgainstMounts(), 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 713 of file class.t3lib_extfilefunc.php.

References 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 683 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 637 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 821 of file class.t3lib_extfilefunc.php.

References t3lib_basicFileFunctions::checkIfFullAccess(), t3lib_basicFileFunctions::checkPathAgainstMounts(), 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
Returns:
string Returns the new filename upon success

Definition at line 782 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::init_actionPerms setup  ) 
 

Sets up permission to perform file/directory operations. See below or the be_user-table for the significanse of the various bits in $setup ($BE_USER->user['fileoper_perms'])

Parameters:
integer File permission integer from BE_USER object.
Returns:
void

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

t3lib_extFileFunctions::printLogErrorMessages redirect = ''  ) 
 

Print log error messages from the operations of this script instance

Parameters:
string Redirect URL (for creating link in message)
Returns:
void (Will exit on error)

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

References t3lib_div::makeInstance().

t3lib_extFileFunctions::processData  ) 
 

Processing the command array in $this->fileCmdMap

Returns:
void

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

References func_copy(), func_delete(), func_edit(), func_move(), func_newfile(), func_newfolder(), func_rename(), func_unzip(), and func_upload().

t3lib_extFileFunctions::start fileCmds  ) 
 

Initialization of the class

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

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

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

Logging file operations

Parameters:
integer The action number. See the functions in the class for a hint. Eg. edit is '9', upload is '1' ...
integer The severity: 0 = message, 1 = error, 2 = System Error, 3 = security notice (admin)
integer This 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.
string This is the default, raw error message in english
array Array 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 357 of file class.t3lib_extfilefunc.php.


Member Data Documentation

t3lib_extFileFunctions::$actionPerms
 

Initial value:

 Array(                         // This array is self-explaning (look in the class below). It grants access to the functions. This could be set from outside in order to enabled functions to users. See also the function init_actionPerms() which takes input directly from the user-record
                'deleteFile' => 0,                                      // Deleting files physically
                'deleteFolder' => 0,                            // Deleting foldes physically
                'deleteFolderRecursively' => 0,         // normally folders are deleted by the PHP-function rmdir(), but with this option a user deletes with 'rm -Rf ....' which is pretty wild!
                '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 115 of file class.t3lib_extfilefunc.php.


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


Généré par L'expert TYPO3 avec  doxygen 1.4.6