OXID eShop CE  4.10.6
 All Classes Namespaces Files Functions Variables Pages
oxFile Class Reference
+ Inheritance diagram for oxFile:
+ Collaboration diagram for oxFile:

Public Member Functions

 __construct ()
 processFile ($sFileIndex)
 getStoreLocation ()
 isUnderDownloadFolder ()
 isUploaded ()
 delete ($sOxId=null)
 download ()
 exist ()
 hasValidDownloads ()
 getMaxDownloadsCount ()
 getMaxUnregisteredDownloadsCount ()
 getLinkExpirationTime ()
 getDownloadExpirationTime ()
 getSize ()
- Public Member Functions inherited from oxBase
 getUseSkipSaveFields ()
 setUseSkipSaveFields ($blUseSkipSaveFields)
 __set ($sName, $sValue)
 __get ($sName)
 __isset ($mVar)
 __clone ()
 oxClone ($oObject)
 getUpdateSeo ()
 setUpdateSeo ($blUpdateSeo)
 init ($sTableName=null, $blForceAllFields=false)
 assign ($dbRecord)
 getClassName ()
 getCoreTableName ()
 getId ()
 setId ($sOXID=null)
 setShopId ($iShopId)
 getShopId ()
 getViewName ($blForceCoreTableUsage=null)
 modifyCacheKey ($sCacheKey, $blOverride=false)
 disableLazyLoading ()
 isDerived ()
 setIsDerived ($blVal)
 isMultilang ()
 load ($sOXID)
 isLoaded ()
 buildSelectString ($aWhere=null)
 assignRecord ($sSelect)
 getFieldData ($sFieldName)
 getSelectFields ($blForceCoreTableUsage=null)
 save ()
 allowDerivedUpdate ()
 allowDerivedDelete ()
 exists ($sOXID=null)
 getSqlActiveSnippet ($blForceCoreTable=null)
 beforeUpdate ($sOXID=null)
 onChange ($iAction=null, $sOXID=null)
 setInList ()
 isOx ()
 isReadOnly ()
 setReadOnly ($blReadOnly)
 getFieldNames ()
 addFieldName ($sName)
 getLanguage ()
- Public Member Functions inherited from oxSuperCfg
 __call ($sMethod, $aArgs)
 getConfig ()
 setConfig ($oConfig)
 getSession ()
 setSession ($oSession)
 getUser ()
 setUser ($oUser)
 isAdmin ()
 setAdminMode ($blAdmin)

Public Attributes

const NO_USER = 2

Protected Member Functions

 _checkArticleFile ($aFileInfo)
 _getBaseDownloadDirPath ()
 _getFileLocation ()
 _getHashedFileDir ($sFileHash)
 _getFileHash ($sFileName)
 _uploadFile ($sSource, $sTarget)
 _deleteFile ()
 _getFilenameForUrl ()
- Protected Member Functions inherited from oxBase
 _setUpdateSeoOnFieldChange ($sField)
 _removeElement2ShopRelations ($sOxId)
 _isInList ()
 _getObjectViewName ($sTable, $sShopID=null)
 _getTableFields ($sTable, $blReturnSimple=false)
 _getAllFields ($blReturnSimple=false)
 _initDataStructure ($blForceFullStructure=false)
 _getNonCachedFieldNames ($blForceFullStructure=false)
 _getFieldStatus ($sFieldName)
 _addField ($sName, $iStatus, $sType=null, $sLength=null)
 _getFieldLongName ($sFieldName)
 _setFieldData ($sFieldName, $sValue, $iDataType=oxField::T_TEXT)
 _canFieldBeNull ($sFieldName)
 _getFieldDefaultValue ($sFieldName)
 _getUpdateFieldValue ($sFieldName, $oField)
 _getUpdateFields ($blUseSkipSaveFields=true)
 _update ()
 _insert ()
 _isDisabledFieldCache ()
 _addSkippedSaveFieldsForMapping ()
 _disableLazyLoadingForCaching ()

Protected Attributes

 $_sCoreTable = 'oxfiles'
 $_sClassName = 'oxfile'
 $_sRelativeFilePath = null
 $_blIsPaid = null
 $_sDownloadLink = null
 $_blHasValidDownloads = null
 $_sManualUploadDir = "uploads"
- Protected Attributes inherited from oxBase
 $_sOXID = null
 $_iShopId = null
 $_blIsSimplyClonable = true
 $_sClassName = 'oxbase'
 $_sCoreTable = null
 $_sViewTable = null
 $_aFieldNames = array('oxid' => 0)
 $_sCacheKey = null
 $_blUseLazyLoading = false
 $_aSkipSaveFields = array('oxtimestamp')
 $_blUseSkipSaveFields = true
 $_sExistKey = 'oxid'
 $_blIsDerived = null
 $_blIsSeoObject = false
 $_blUpdateSeo = true
 $_blReadOnly = false
 $_blIsInList = false
 $_isLoaded = false
 $_aInnerLazyCache = null
 $_blEmployMultilanguage = false

Additional Inherited Members

- Static Protected Attributes inherited from oxBase
static $_blDisableFieldCaching = array()

Detailed Description

Article files manager.

Definition at line 7 of file oxfile.php.

Constructor & Destructor Documentation

oxFile::__construct ( )

Initialises the instance

Reimplemented from oxBase.

Definition at line 69 of file oxfile.php.

Member Function Documentation

oxFile::_checkArticleFile (   $aFileInfo)
protected

Checks if given file is valid upload file

Parameters
array$aFileInfoFile info array
Exceptions
oxExceptionThrows exception if file wasn't uploaded successfully.

Definition at line 106 of file oxfile.php.

oxFile::_deleteFile ( )
protected

Checks if file is not used for other objects. If not used, unlink the file.

Returns
null|false

Definition at line 305 of file oxfile.php.

oxFile::_getBaseDownloadDirPath ( )
protected

Return full path of root dir where download files are stored

Returns
string

Definition at line 125 of file oxfile.php.

oxFile::_getFileHash (   $sFileName)
protected

Calculates file hash. Currently MD5 is used.

Parameters
string$sFileNameFile name values
Returns
string

Definition at line 236 of file oxfile.php.

oxFile::_getFileLocation ( )
protected

Returns relative file path from oxConfig 'sDownloadsDir' variable.

Returns
string

Definition at line 186 of file oxfile.php.

oxFile::_getFilenameForUrl ( )
protected

returns oxfile__oxfilename for URL usage converts spec symbols to xx combination

Returns
string

Definition at line 327 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$sFileHashFile hash value
Returns
string

Definition at line 216 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$sSourceSource filename
string$sTargetTarget filename
Returns
bool

Definition at line 250 of file oxfile.php.

oxFile::delete (   $sOxId = null)

Deletes oxFile record from DB, removes orphan files.

Parameters
string$sOxIddefault null
Returns
bool

Reimplemented from oxBase.

Definition at line 286 of file oxfile.php.

oxFile::download ( )

Supplies the downloadable file for client and exits

Definition at line 335 of file oxfile.php.

oxFile::exist ( )

Check if file exist

Returns
bool

Definition at line 362 of file oxfile.php.

oxFile::getDownloadExpirationTime ( )

Returns download link expiration time in hours, after the first download

Returns
int

Definition at line 453 of file oxfile.php.

oxFile::getLinkExpirationTime ( )

Returns ordered file link expiration time in hours

Returns
int

Definition at line 437 of file oxfile.php.

oxFile::getMaxDownloadsCount ( )

Returns max download count of file

Returns
int

Definition at line 405 of file oxfile.php.

oxFile::getMaxUnregisteredDownloadsCount ( )

Returns max download count of file, if user is not registered

Returns
int

Definition at line 421 of file oxfile.php.

oxFile::getSize ( )

Returns file size in bytes

Returns
int

Definition at line 469 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 154 of file oxfile.php.

oxFile::hasValidDownloads ( )

Checks if this file has valid ordered downloads

Returns
bool

Definition at line 372 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 168 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.

Returns
bool

Definition at line 269 of file oxfile.php.

oxFile::processFile (   $sFileIndex)

Sets oxefile__oxstorehash with file hash. Moves file to desired location and change its access rights.

Parameters
int$sFileIndexFile index
Exceptions
oxExceptionThrows exception if file wasn't moved or if rights wasn't changed.

Definition at line 83 of file oxfile.php.

Member Data Documentation

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

Definition at line 27 of file oxfile.php.

oxFile::$_sCoreTable = 'oxfiles'
protected

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.


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