Open Journal Systems  2.4.3
 All Classes Namespaces Functions Variables Groups Pages
PKPTemporaryFileManager Class Reference
Inheritance diagram for PKPTemporaryFileManager:
PrivateFileManager FileManager TemporaryFileManager

Public Member Functions

 _performPeriodicCleanup ()
 
 deleteFile ($fileId, $userId)
 
 downloadFile ($fileId, $userId, $inline=false)
 
 getBasePath ()
 
getFile ($fileId, $userId)
 
 handleUpload ($fileName, $userId)
 
 PKPTemporaryFileManager ()
 
 readFile ($fileId, $userId, $output=false)
 
- Public Member Functions inherited from PrivateFileManager
 getBasePath ()
 
 PrivateFileManager ()
 
- Public Member Functions inherited from FileManager
 copyDir ($source, $dest)
 
 copyFile ($source, $dest)
 
 deleteFile ($filePath)
 
 downloadFile ($filePath, $mediaType=null, $inline=false, $fileName=null)
 
 fileExists ($filePath, $type= 'file')
 
 FileManager ()
 
 getDocumentExtension ($type)
 
 getDocumentType ($type)
 
 getExtension ($fileName)
 
 getImageExtension ($type)
 
 getNiceFileSize ($size)
 
 getUploadedFileName ($fileName)
 
 getUploadedFilePath ($fileName)
 
 getUploadedFileType ($fileName)
 
 mkdir ($dirPath, $perms=null)
 
 mkdirtree ($dirPath, $perms=null)
 
 parseFileExtension ($fileName)
 
readFile ($filePath, $output=false)
 
 rmdir ($dirPath)
 
 rmtree ($file)
 
 setMode ($path, $mask)
 
 truncateFileName ($fileName, $length=127)
 
 uploadedFileExists ($fileName)
 
 uploadError ($fileName)
 
 uploadFile ($fileName, $destFileName)
 
 writeFile ($dest, &$contents)
 

Detailed Description

Class defining operations for temporary file management.

See Also
TemporaryFileDAO

Definition at line 19 of file PKPTemporaryFileManager.inc.php.

Member Function Documentation

PKPTemporaryFileManager::_performPeriodicCleanup ( )

Perform periodic cleanup tasks. This is used to occasionally remove expired temporary files.

Definition at line 134 of file PKPTemporaryFileManager.inc.php.

References deleteFile(), and DAORegistry\getDAO().

Referenced by PKPTemporaryFileManager().

PKPTemporaryFileManager::deleteFile (   $fileId,
  $userId 
)

Delete a file by ID.

Parameters
$fileIdint

Definition at line 67 of file PKPTemporaryFileManager.inc.php.

References getBasePath(), DAORegistry\getDAO(), and getFile().

Referenced by _performPeriodicCleanup().

PKPTemporaryFileManager::downloadFile (   $fileId,
  $userId,
  $inline = false 
)

Download a file.

Parameters
$fileIdint the file id of the file to download
$inlineprint file as inline instead of attachment, optional
Returns
boolean

Definition at line 82 of file PKPTemporaryFileManager.inc.php.

References getBasePath(), and getFile().

PKPTemporaryFileManager::getBasePath ( )

Get the base path for temporary file storage.

Returns
string

Definition at line 33 of file PKPTemporaryFileManager.inc.php.

Referenced by TemporaryFileManager\articleToTemporaryFile(), deleteFile(), downloadFile(), handleUpload(), and readFile().

& PKPTemporaryFileManager::getFile (   $fileId,
  $userId 
)

Retrieve file information by file ID.

Returns
TemporaryFile

Definition at line 41 of file PKPTemporaryFileManager.inc.php.

References DAORegistry\getDAO().

Referenced by deleteFile(), downloadFile(), and readFile().

PKPTemporaryFileManager::handleUpload (   $fileName,
  $userId 
)

Upload the file and add it to the database.

Parameters
$fileNamestring index into the $_FILES array
$userIdint
Returns
object The new TemporaryFile or false on failure

Definition at line 98 of file PKPTemporaryFileManager.inc.php.

References FileManager\fileExists(), getBasePath(), Core\getCurrentDate(), DAORegistry\getDAO(), FileManager\getUploadedFileName(), String\mime_content_type(), FileManager\mkdirtree(), FileManager\parseFileExtension(), FileManager\truncateFileName(), and FileManager\uploadFile().

PKPTemporaryFileManager::PKPTemporaryFileManager ( )

Constructor

Definition at line 23 of file PKPTemporaryFileManager.inc.php.

References _performPeriodicCleanup().

PKPTemporaryFileManager::readFile (   $fileId,
  $userId,
  $output = false 
)

Read a file's contents.

Parameters
$outputboolean output the file's contents instead of returning a string
Returns
boolean

Definition at line 52 of file PKPTemporaryFileManager.inc.php.

References getBasePath(), and getFile().


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