API - XOOPS 2.5.11 Beta 2
By monxoops.fr
SystemFineUploadHandler Class Reference
Inheritance diagram for SystemFineUploadHandler:

Public Member Functions

 __construct (\stdClass $claims)
 
 getName ()
 
 getUploadName ()
 
 combineChunks ($uploadDirectory, $name=null)
 
 handleUpload ($uploadDirectory, $name=null)
 
 handleDelete ($uploadDirectory, $name=null)
 

Data Fields

 $allowedExtensions = array()
 
 $allowedMimeTypes = array('(none)')
 
 $sizeLimit = null
 
 $inputName = 'qqfile'
 
 $chunksFolder = 'chunks'
 
 $chunksCleanupProbability = 0.001
 
 $chunksExpireIn = 604800
 
 $claims
 

Protected Member Functions

 storeUploadedFile ($target, $mimeType, $uuid)
 
 getUniqueTargetPath ($uploadDirectory, $filename)
 
 cleanupChunks ()
 
 removeDir ($dir)
 
 toBytes ($str)
 
 isInaccessible ($directory)
 
 isWindows ()
 

Protected Attributes

 $uploadName
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

__construct ( \stdClass  $claims)

XoopsFineUploadHandler constructor.

Parameters
stdClass$claimsclaims passed in JWT header

Reimplemented in SystemFineAvatarUploadHandler, and SystemFineImUploadHandler.

Member Function Documentation

◆ cleanupChunks()

cleanupChunks ( )
protected

Deletes all file parts in the chunks folder for files uploaded more than chunksExpireIn seconds ago

Returns
void
Here is the call graph for this function:
Here is the caller graph for this function:

◆ combineChunks()

combineChunks (   $uploadDirectory,
  $name = null 
)

Combine chunks into a single file

Parameters
string$uploadDirectoryupload directory
string | null$namename
Returns
array response to be json encoded and returned to client
Here is the call graph for this function:

◆ getName()

getName ( )

Get the original filename

Here is the caller graph for this function:

◆ getUniqueTargetPath()

getUniqueTargetPath (   $uploadDirectory,
  $filename 
)
protected

Returns a path to use with this upload. Check that the name does not exist, and appends a suffix otherwise.

Parameters
string$uploadDirectoryTarget directory
string$filenameThe name of the file to use.
Returns
string|false path or false if path could not be determined

◆ getUploadName()

getUploadName ( )

Get the name of the uploaded file

Returns
string

◆ handleDelete()

handleDelete (   $uploadDirectory,
  $name = null 
)

Process a delete.

Parameters
string$uploadDirectoryTarget directory.
string | null$nameOverwrites the name of the file.
Returns
array response to be json encoded and returned to client
Here is the call graph for this function:

◆ handleUpload()

handleUpload (   $uploadDirectory,
  $name = null 
)

Process the upload.

Parameters
string$uploadDirectoryTarget directory.
string$nameOverwrites the name of the file.
Returns
array response to be json encoded and returned to client
Here is the call graph for this function:

◆ isInaccessible()

isInaccessible (   $directory)
protected

Determines whether a directory can be accessed.

is_executable() is not reliable on Windows prior PHP 5.0.0 (http://www.php.net/manual/en/function.is-executable.php) The following tests if the current OS is Windows and if so, merely checks if the folder is writable; otherwise, it checks additionally for executable status (like before).

Parameters
string$directoryThe target directory to test access
Returns
bool true if directory is NOT accessible
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isWindows()

isWindows ( )
protected

Determines is the OS is Windows or not

Returns
boolean
Here is the caller graph for this function:

◆ removeDir()

removeDir (   $dir)
protected

Removes a directory and all files contained inside

Parameters
string$dir
Returns
void
Here is the call graph for this function:
Here is the caller graph for this function:

◆ storeUploadedFile()

storeUploadedFile (   $target,
  $mimeType,
  $uuid 
)
protected

Reimplemented in SystemFineAvatarUploadHandler, and SystemFineImUploadHandler.

Here is the caller graph for this function:

◆ toBytes()

toBytes (   $str)
protected

Converts a given size with units to bytes.

Parameters
string$str
Returns
int
Here is the caller graph for this function:

Field Documentation

◆ $allowedExtensions

$allowedExtensions = array()

◆ $allowedMimeTypes

$allowedMimeTypes = array('(none)')

◆ $chunksCleanupProbability

$chunksCleanupProbability = 0.001

◆ $chunksExpireIn

$chunksExpireIn = 604800

◆ $chunksFolder

$chunksFolder = 'chunks'

◆ $claims

$claims

◆ $inputName

$inputName = 'qqfile'

◆ $sizeLimit

$sizeLimit = null

◆ $uploadName

$uploadName
protected

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