Public Attributes |
const | NO_USER = 2 |
Detailed Description
Article files manager.
Definition at line 7 of file oxfile.php.
Constructor & Destructor Documentation
Initialises the instance
Reimplemented from oxBase.
Definition at line 68 of file oxfile.php.
Member Function Documentation
oxFile::_checkArticleFile |
( |
|
$aFileInfo | ) |
|
|
protected |
Checks if given file is valid upload file
- Parameters
-
array | $aFileInfo | File info array |
- Returns
- void
Definition at line 104 of file oxfile.php.
Checks if file is not used for other objects. If not used, unlink the file.
- Returns
- null
Definition at line 298 of file oxfile.php.
oxFile::_getBaseDownloadDirPath |
( |
| ) |
|
|
protected |
Return full path of root dir where download files are stored
- Returns
- string
Definition at line 123 of file oxfile.php.
oxFile::_getFileHash |
( |
|
$sFileName | ) |
|
|
protected |
Calculates file hash. Currently MD5 is used.
- Parameters
-
string | $sFileName | File name values |
- Returns
- string
Definition at line 230 of file oxfile.php.
oxFile::_getFileLocation |
( |
| ) |
|
|
protected |
Returns relative file path from oxConfig 'sDownloadsDir' variable.
- Returns
- string
Definition at line 181 of file oxfile.php.
oxFile::_getFilenameForUrl |
( |
| ) |
|
|
protected |
returns oxfile__oxfilename for URL usage converts spec symbols to xx combination
- Returns
- string
Definition at line 319 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.
- Parameters
-
string | $sFileHash | File hash value |
- Returns
- string
Definition at line 211 of file oxfile.php.
oxFile::_uploadFile |
( |
|
$sSource, |
|
|
|
$sTarget |
|
) |
| |
|
protected |
Moves file from source to target and changes file mode. Returns true on success.
- Parameters
-
string | $sSource | Source filename |
string | $sTarget | Target filename |
- Returns
- bool
Definition at line 244 of file oxfile.php.
oxFile::delete |
( |
|
$sOxId = null | ) |
|
Deletes oxFile record from DB, removes orphan files.
- Parameters
-
- Returns
- bool
Reimplemented from oxBase.
Definition at line 279 of file oxfile.php.
Supplies the downloadable file for client and exits
Definition at line 327 of file oxfile.php.
Check if file exist
- Returns
- bool
Definition at line 354 of file oxfile.php.
oxFile::getDownloadExpirationTime |
( |
| ) |
|
Returns download link expiration time in hours, after the first download
- Returns
- int
Definition at line 441 of file oxfile.php.
oxFile::getLinkExpirationTime |
( |
| ) |
|
Returns ordered file link expiration time in hours
- Returns
- int
Definition at line 426 of file oxfile.php.
oxFile::getMaxDownloadsCount |
( |
| ) |
|
Returns max download count of file
- Returns
- int
Definition at line 396 of file oxfile.php.
oxFile::getMaxUnregisteredDownloadsCount |
( |
| ) |
|
Returns max download count of file, if user is not registered
- Returns
- int
Definition at line 411 of file oxfile.php.
Returns file size in bytes
- Returns
- int
Definition at line 456 of file oxfile.php.
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
- Returns
- string
Definition at line 150 of file oxfile.php.
oxFile::hasValidDownloads |
( |
| ) |
|
Checks if this file has valid ordered downloads
- Returns
- bool
Definition at line 364 of file oxfile.php.
oxFile::isUnderDownloadFolder |
( |
| ) |
|
Return true if file is under download folder. Return false if file is above download folder or if file does not exist.
- Returns
- bool
Definition at line 163 of file oxfile.php.
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.
- Returns
- bool
Definition at line 263 of file oxfile.php.
oxFile::processFile |
( |
|
$sFileIndex | ) |
|
Sets oxefile__oxstorehash with file hash and moves file to desired location
- Parameters
-
- Returns
- void
Definition at line 81 of file oxfile.php.
Member Data Documentation
oxFile::$_blHasValidDownloads = null |
|
protected |
oxFile::$_blIsPaid = null |
|
protected |
oxFile::$_sClassName = 'oxfile' |
|
protected |
oxFile::$_sCoreTable = 'oxfiles' |
|
protected |
oxFile::$_sDownloadLink = null |
|
protected |
oxFile::$_sManualUploadDir = "uploads" |
|
protected |
oxFile::$_sRelativeFilePath = null |
|
protected |
const oxFile::NO_USER = 2 |
No active user exception code.
Definition at line 12 of file oxfile.php.
The documentation for this class was generated from the following file: