Documentation TYPO3 par Ameos |
Public Member Functions | |
init ($mounts, $f_ext) | |
getTotalFileInfo ($wholePath) | |
is_allowed ($iconkey, $type) | |
checkIfFullAccess ($theDest) | |
is_webpath ($path) | |
checkIfAllowed ($ext, $theDest, $filename='') | |
checkFileNameLen ($fileName) | |
is_directory ($theDir) | |
isPathValid ($theFile) | |
getUniqueName ($theFile, $theDest, $dontCheckForUnique=0) | |
checkPathAgainstMounts ($thePath) | |
findFirstWebFolder () | |
blindPath ($thePath) | |
findTempFolder () | |
cleanDirectoryName ($theDir) | |
rmDoubleSlash ($string) | |
slashPath ($path) | |
cleanFileName ($fileName, $charset='') | |
formatSize ($sizeInBytes) | |
Public Attributes | |
$getUniqueNamePrefix = '' | |
$maxNumber = 20 | |
$uniquePrecision = 6 | |
$maxInputNameLen = 60 | |
$tempFN = '_temp_' | |
$f_ext = Array() | |
$mounts = Array() | |
$webPath = '' | |
$isInit = 0 |
Definition at line 81 of file class.t3lib_basicfilefunc.php.
|
Removes filemount part of a path, thus blinding the position. Takes a path, $thePath, and removes the part of the path which equals the filemount.
Definition at line 362 of file class.t3lib_basicfilefunc.php. |
|
Returns true if the input filename string is shorter than $this->maxInputNameLen.
Definition at line 241 of file class.t3lib_basicfilefunc.php. Referenced by t3lib_extFileFunctions::func_newfile(), t3lib_extFileFunctions::func_newfolder(), and t3lib_extFileFunctions::func_rename(). |
|
If the filename is given, check it against the TYPO3_CONF_VARS[BE][fileDenyPattern] + Checks if the $ext fileextension is allowed in the path $theDest (this is based on whether $theDest is below the $this->webPath)
Definition at line 231 of file class.t3lib_basicfilefunc.php. References is_allowed(), is_webpath(), and t3lib_div::verifyFilenameAgainstDenyPattern(). Referenced by t3lib_extFileFunctions::func_copy(), t3lib_extFileFunctions::func_edit(), t3lib_extFileFunctions::func_move(), t3lib_extFileFunctions::func_newfile(), t3lib_extFileFunctions::func_rename(), and t3lib_extFileFunctions::func_upload(). |
|
Returns true if you can operate of ANY file ('*') in the space $theDest is in ('webspace' / 'ftpspace')
Definition at line 197 of file class.t3lib_basicfilefunc.php. References is_webpath(). Referenced by t3lib_extFileFunctions::func_copy(), t3lib_extFileFunctions::func_move(), and t3lib_extFileFunctions::func_unzip(). |
|
Checks if $thePath is a path under one of the paths in $this->mounts See comment in the header of this class.
Definition at line 326 of file class.t3lib_basicfilefunc.php. References t3lib_div::isFirstPartOfStr(). Referenced by t3lib_extFileFunctions::findRecycler(), t3lib_extFileFunctions::func_copy(), t3lib_extFileFunctions::func_delete(), t3lib_extFileFunctions::func_edit(), t3lib_extFileFunctions::func_move(), t3lib_extFileFunctions::func_newfile(), t3lib_extFileFunctions::func_newfolder(), t3lib_extFileFunctions::func_rename(), t3lib_extFileFunctions::func_unzip(), and t3lib_extFileFunctions::func_upload(). |
|
Removes all dots, slashes and spaces after a path...
Definition at line 412 of file class.t3lib_basicfilefunc.php. Referenced by t3lib_extFileFunctions::findRecycler(), and is_directory(). |
|
Returns a string where any character not matching [.a-zA-Z0-9_-] is substituted by '_'
Definition at line 446 of file class.t3lib_basicfilefunc.php. References t3lib_div::makeInstance(). Referenced by t3lib_extFileFunctions::func_newfile(), t3lib_extFileFunctions::func_newfolder(), t3lib_extFileFunctions::func_rename(), and t3lib_extFileFunctions::func_upload(). |
|
Find first web folder (relative to PATH_site.'fileadmin') in filemounts array
Definition at line 342 of file class.t3lib_basicfilefunc.php. References t3lib_div::isFirstPartOfStr(). |
|
Find temporary folder Finds the first $this->tempFN ('_temp_' usually) -folder in the internal array of filemounts, $this->mounts
Definition at line 378 of file class.t3lib_basicfilefunc.php. |
|
Formats an integer, $sizeInBytes, to Mb or Kb or just bytes
Definition at line 480 of file class.t3lib_basicfilefunc.php. |
|
Returns an array with a whole lot of fileinformation.
Definition at line 152 of file class.t3lib_basicfilefunc.php. References t3lib_div::split_fileref(). |
|
Returns the destination path/filename of a unique filename/foldername in that path. If $theFile exists in $theDest (directory) the file have numbers appended up to $this->maxNumber. Hereafter a unique string will be appended. This function is used by fx. TCEmain when files are attached to records and needs to be uniquely named in the uploads/* folders
Definition at line 283 of file class.t3lib_basicfilefunc.php. References is_directory(), and t3lib_div::split_fileref(). Referenced by t3lib_extFileFunctions::func_copy(), t3lib_extFileFunctions::func_move(), and t3lib_extFileFunctions::func_upload(). |
|
Constructor This function should be called to initialise the internal arrays $this->mounts and $this->f_ext A typical example of the array $mounts is this: $mounts[xx][path] = (..a mounted path..) the 'xx'-keys is just numerical from zero. There are also a [name] and [type] value that just denotes the mountname and type. Not used for athentication here. $this->mounts is traversed in the function checkPathAgainstMounts($thePath), and it is checked that $thePath is actually below one of the mount-paths The mountpaths are with a trailing '/'. $thePath must be with a trailing '/' also! As you can see, $this->mounts is very critical! This is the array that decides where the user will be allowed to copy files!! Typically the global var $WEBMOUNTS would be passed along as $mounts A typical example of the array $f_ext is this: $f_ext['webspace']['allow']=''; $f_ext['webspace']['deny']='php3,php'; $f_ext['ftpspace']['allow']='*'; $f_ext['ftpspace']['deny']=''; The control of fileextensions goes in two catagories. Webspace and Ftpspace. Webspace is folders accessible from a webbrowser (below TYPO3_DOCUMENT_ROOT) and ftpspace is everything else. The control is done like this: If an extension matches 'allow' then the check returns true. If not and an extension matches 'deny' then the check return false. If no match at all, returns true. You list extensions comma-separated. If the value is a '*' every extension is allowed The list is case-insensitive when used in this class (see init()) Typically TYPO3_CONF_VARS['BE']['fileExtensions'] would be passed along as $f_ext. Example: $basicff->init($GLOBALS['FILEMOUNTS'],$TYPO3_CONF_VARS['BE']['fileExtensions']);
Definition at line 133 of file class.t3lib_basicfilefunc.php. References $f_ext, $mounts, t3lib_div::getIndpEnv(), and t3lib_div::uniqueList(). |
|
Checks if a $iconkey (fileextension) is allowed according to $this->f_ext.
Definition at line 172 of file class.t3lib_basicfilefunc.php. References t3lib_div::inList(). Referenced by checkIfAllowed(). |
|
Cleans $theDir for slashes in the end of the string and returns the new path, if it exists on the server.
Definition at line 251 of file class.t3lib_basicfilefunc.php. References cleanDirectoryName(), and isPathValid(). Referenced by t3lib_extFileFunctions::func_copy(), t3lib_extFileFunctions::func_delete(), t3lib_extFileFunctions::func_move(), t3lib_extFileFunctions::func_newfile(), t3lib_extFileFunctions::func_newfolder(), t3lib_extFileFunctions::func_unzip(), t3lib_extFileFunctions::func_upload(), and getUniqueName(). |
|
Checks if $this->webPath (should be TYPO3_DOCUMENT_ROOT) is in the first part of $path Returns true also if $this->init is not set or if $path is empty...
Definition at line 211 of file class.t3lib_basicfilefunc.php. References t3lib_div::isFirstPartOfStr(), and slashPath(). Referenced by checkIfAllowed(), and checkIfFullAccess(). |
|
Wrapper for t3lib_div::validPathStr()
Definition at line 268 of file class.t3lib_basicfilefunc.php. References t3lib_div::validPathStr(). Referenced by t3lib_extFileFunctions::findRecycler(), t3lib_extFileFunctions::func_copy(), t3lib_extFileFunctions::func_delete(), t3lib_extFileFunctions::func_move(), and is_directory(). |
|
Converts any double slashes (//) to a single slash (/)
Definition at line 422 of file class.t3lib_basicfilefunc.php. |
|
Returns a string which has a slash '/' appended if it doesn't already have that slash
Definition at line 432 of file class.t3lib_basicfilefunc.php. Referenced by is_webpath(). |