Public Member Functions | |
__construct () | |
processFile ($sFileIndex) | |
getStoreLocation () | |
isUploaded () | |
delete ($sOxId=null) | |
download () | |
exist () | |
hasValidDownloads () | |
getMaxDownloadsCount () | |
getMaxUnregisteredDownloadsCount () | |
getLinkExpirationTime () | |
getDownloadExpirationTime () | |
getSize () | |
Public Attributes | |
const | NO_USER = 2 |
Protected Member Functions | |
_checkArticleFile ($aFileInfo) | |
_getBaseDownloadDirPath () | |
_getFileLocation () | |
_getHashedFileDir ($sFileHash) | |
_getFileHash ($sFileName) | |
_uploadFile ($sSource, $sTarget) | |
_deleteFile () | |
_getFilenameForUrl () | |
Protected Attributes | |
$_sCoreTable = 'oxfiles' | |
$_sClassName = 'oxfile' | |
$_sRelativeFilePath = null | |
$_blIsPaid = null | |
$_sDownloadLink = null | |
$_blHasValidDownloads = null | |
$_sManualUploadDir = "uploads" |
Article files manager.
Definition at line 7 of file oxfile.php.
oxFile.__construct | ( | ) |
oxFile._checkArticleFile | ( | $ | aFileInfo | ) | [protected] |
Checks if given file is valid upload file
array | $aFileInfo File info array |
Definition at line 101 of file oxfile.php.
oxFile._deleteFile | ( | ) | [protected] |
Checks if file is not used for other objects. If not used, unlink the file.
Definition at line 281 of file oxfile.php.
oxFile._getBaseDownloadDirPath | ( | ) | [protected] |
Return full path of root dir where download files are stored
Definition at line 120 of file oxfile.php.
oxFile._getFileHash | ( | $ | sFileName | ) | [protected] |
Calculates file hash. Currently MD5 is used.
string | $sFileName File name values |
Definition at line 212 of file oxfile.php.
oxFile._getFileLocation | ( | ) | [protected] |
Returns relative file path from oxConfig 'sDownloadsDir' variable.
Definition at line 162 of file oxfile.php.
oxFile._getFilenameForUrl | ( | ) | [protected] |
returns oxfile__oxfilename for URL usage converts spec symbols to xx combination
Definition at line 303 of file oxfile.php.
oxFile._getHashedFileDir | ( | $ | sFileHash | ) | [protected] |
Returns relative sub dir of oxconfig 'sDownloadsDir' of required file from supplied $sFileHash parameter. Creates dir in case it does not exist.
string | $sFileHash File hash value |
Definition at line 192 of file oxfile.php.
oxFile._uploadFile | ( | $ | sSource, | |
$ | sTarget | |||
) | [protected] |
Moves file from source to target and changes file mode. Returns true on success.
string | $sSource Source filename | |
string | $sTarget Target filename |
Definition at line 226 of file oxfile.php.
oxFile.delete | ( | $ | sOxId = null |
) |
Deletes oxFile record from DB, removes orphan files.
string | $sOxId default null |
Reimplemented from oxBase.
Definition at line 262 of file oxfile.php.
oxFile.download | ( | ) |
Supplies the downloadable file for client and exits
Definition at line 311 of file oxfile.php.
oxFile.exist | ( | ) |
oxFile.getDownloadExpirationTime | ( | ) |
Returns download link expiration time in hours, after the first download
Definition at line 429 of file oxfile.php.
oxFile.getLinkExpirationTime | ( | ) |
Returns ordered file link expiration time in hours
Definition at line 413 of file oxfile.php.
oxFile.getMaxDownloadsCount | ( | ) |
oxFile.getMaxUnregisteredDownloadsCount | ( | ) |
Returns max download count of file, if user is not registered
Definition at line 397 of file oxfile.php.
oxFile.getSize | ( | ) |
oxFile.getStoreLocation | ( | ) |
Returns full filesystem path where files are stored. Make sure that object oxfiles__oxstorehash or oxfiles__oxfilename attribute is set before calling this method
Definition at line 149 of file oxfile.php.
oxFile.hasValidDownloads | ( | ) |
Checks if this file has valid ordered downloads
Definition at line 348 of file oxfile.php.
oxFile.isUploaded | ( | ) |
Checks whether the file has been uploaded over admin area. Returns true in case file is uploaded (and hashed) over admin area. Returns false in case file is placed manually (ftp) to "out/downloads/uploads" dir. It's similar so don't get confused here.
Definition at line 245 of file oxfile.php.
oxFile.processFile | ( | $ | sFileIndex | ) |
Sets oxefile__oxstorehash with file hash and moves file to desired location
int | $sFileIndex File index |
Definition at line 80 of file oxfile.php.
oxFile.$_blHasValidDownloads = null [protected] |
Definition at line 56 of file oxfile.php.
oxFile.$_blIsPaid = null [protected] |
Definition at line 41 of file oxfile.php.
oxFile.$_sClassName = 'oxfile' [protected] |
Reimplemented from oxBase.
Definition at line 27 of file oxfile.php.
oxFile.$_sCoreTable = 'oxfiles' [protected] |
Reimplemented from oxBase.
Definition at line 20 of file oxfile.php.
oxFile.$_sDownloadLink = null [protected] |
Definition at line 49 of file oxfile.php.
oxFile.$_sManualUploadDir = "uploads" [protected] |
Definition at line 63 of file oxfile.php.
oxFile.$_sRelativeFilePath = null [protected] |
Definition at line 34 of file oxfile.php.
const oxFile.NO_USER = 2 |
No active user exception code.
Definition at line 13 of file oxfile.php.