Class MED_FILE

Description

Class MED_FILE

Handels medias which consists only of one single file

  • author: Peter Krebs (pk) <p.krebs@lvus.at>
  • version: pk-05-11-17
  • version: pk-04-01-02
  • version: pk-08-01-31
  • version: $Id: DBMS_TABLEOBJ.phpclass,v 1.60 2008/12/17 16:28:52 peterkrebs Exp $
  • copyright: (c) 2002-2003 by Peter Krebs and Landesverlag Unternehmensservice
  • since: pk-03-12-18
  • project: Open CSP-Management
  • license: GNU Public License

Located in /media/MED_FILE.phpclass (line 38)

OCSP_OBJ
   |
   --DBMS_TABLEOBJ
      |
      --MED_TABLEOBJ
         |
         --MED_FILE
Direct descendents
Class Description
 class MED_IMAGE Class MED_IMAGE
 class MED_PHPINC Class MED_PHPINC
Variable Summary
 mixed $colPrevix
 mixed $myTable
Method Summary
 MED_FILE MED_FILE ([int $aId = 0], [string $mimeType = ""], [bool $debug = FALSE])
 MED_FILE &chkObjectClass ([ $debug = FALSE])
 string createZip ([string $dest = ""], [boolean $debug = FALSE])
 void curUserCanOpen ([boolean $debug = FALSE])
 boolean dbDelete ([string $gDBIDX = "USRDB"], [boolean $backupData = FALSE], [boolean $debug = FALSE])
 DBMS_FORM &dbGetForm (int $mode, [string $frmName = ""], [boolean $debug = FALSE])
 int dbInsert ([string $gDBIDX = "USRDB"], [boolean $debug = FALSE])
 array getDBRow ([bool $withoutNull = TRUE], [bool $debug = FALSE])
 string getDownlaodLink (boolean $asZip)
 string getFileName ()
 string getFilePath ([boolean $debug = FALSE])
 int getFileSize ([boolean $debug = FALSE])
 string getHTMLListTag ([array $argArr = NULL], [boolean $debug = FALSE])
 int getId ()
 string getMIMEType ()
 string getMyLink ()
 int getStateId ()
 string getTitle ()
 void sendHttpDownload ([boolean $checkRights = FALSE], [boolean $ziped = FALSE])
 void sendHttpFile ([bool $checkRights = TRUE])
 bool setDBRow (array $row, [bool $asPopulated = TRUE], [bool $debug = FALSE])
 void setFile (string $aName, [bool $isTmp = FALSE], [bool $debug = FALSE])
 string setFileFromSource (string $source, [bool $overwrite = FALSE], [bool $link = FALSE], [bool $debug = FALSE])
 string setFileFromUpload (array $uplFile, [boolean $overwrite = FALSE], [boolean $debug = FALSE])
 bool setFORMPOST ( &$frmObj,  $dbval, [bool $debug = FALSE], DBMS_FORM $frmObj, array $dbVal)
 int setMIMEfromExtension (string $aName, [bool $debug = FALSE])
 void setMIMEType (int $aTypeId)
Variables
Methods
Constructor MED_FILE (line 62)
MED_FILE MED_FILE ([int $aId = 0], [string $mimeType = ""], [bool $debug = FALSE])
  • int $aId
  • string $mimeType
  • bool $debug
chkObjectClass (line 710)

checks if the current class is the best for the mimetype if not a new object is returned with the class from the mime table

MED_FILE &chkObjectClass ([ $debug = FALSE])
  • $debug
createZip (line 454)

creates a zip file from the file

  • return: zip file path
  • version: pk-07-02-08
  • since: pk-04-08-10
string createZip ([string $dest = ""], [boolean $debug = FALSE])
  • string $dest
  • boolean $debug
curUserCanOpen (line 752)

returns if the current user can open the file

  • since: pk-06-11-13
void curUserCanOpen ([boolean $debug = FALSE])
  • boolean $debug
dbDelete (line 193)

deletes the file

if $backupData is true the file is not deleted and remains in the category directory.

  • since: pk-05-04-29
boolean dbDelete ([string $gDBIDX = "USRDB"], [boolean $backupData = FALSE], [boolean $debug = FALSE])
  • string $gDBIDX
  • boolean $backupData
  • boolean $debug

Redefinition of:
DBMS_TABLEOBJ::dbDelete()
dbGetForm (line 241)

returns a database form

DBMS_FORM &dbGetForm (int $mode, [string $frmName = ""], [boolean $debug = FALSE])
  • int $mode: dbms form show mode
  • string $frmName: dbms form name
  • boolean $debug

Redefinition of:
DBMS_TABLEOBJ::dbGetForm()
returns a database form

Redefined in descendants as:
dbInsert (line 167)

inserts a new file

  • since: pk-05-09-13
int dbInsert ([string $gDBIDX = "USRDB"], [boolean $debug = FALSE])
  • string $gDBIDX
  • boolean $debug

Redefinition of:
DBMS_TABLEOBJ::dbInsert()
inserts a new row to the table
getDBRow (line 111)

returns a field => value array

array getDBRow ([bool $withoutNull = TRUE], [bool $debug = FALSE])
  • bool $withoutNull: null values are not added to the array
  • bool $debug: show debug info?

Redefinition of:
DBMS_TABLEOBJ::getDBRow()
returns a field => value array
getDownlaodLink (line 625)

returns the download url of the file

  • since: pk-06-11-13
string getDownlaodLink (boolean $asZip)
  • boolean $asZip
getFileName (line 267)

returns the file name (used for downloads,online views ...)

  • since: pk-07-02-08
string getFileName ()
getFilePath (line 290)

returns the absolute system file path

  • since: pk-07-02-08
string getFilePath ([boolean $debug = FALSE])
  • boolean $debug
getFileSize (line 639)

returns the filesize of the media file

  • version: pk-07-02-09
int getFileSize ([boolean $debug = FALSE])
  • boolean $debug
getHTMLListTag (line 593)

gets the html list tag representing the file

  • version: pk-06-11-13 use $this->getMyLink()
  • since: pk-04-08-10
string getHTMLListTag ([array $argArr = NULL], [boolean $debug = FALSE])
  • array $argArr
  • boolean $debug

Redefined in descendants as:
getId (line 76)
int getId ()
getMIMEType (line 666)

gets the mime type string from T_MED_MIMETYPES if no mimetype is set 'application/octet-stream' is returned

string getMIMEType ()
getMyLink (line 611)

retuns the link url to the file

  • since: pk-06-11-13
string getMyLink ()
getStateId (line 84)
  • since: pk-06-11-13
int getStateId ()
getTitle (line 92)
  • since: pk-06-11-13
string getTitle ()
sendHttpDownload (line 496)

echos the file with header information to force browser saving the file

  • todo: check rights
void sendHttpDownload ([boolean $checkRights = FALSE], [boolean $ziped = FALSE])
  • boolean $checkRights: check if user has rights
  • boolean $ziped
sendHttpFile (line 551)

sets header and passthru the file

  • version: pk-07-02-08
void sendHttpFile ([bool $checkRights = TRUE])
  • bool $checkRights: check if user has rights
setDBRow (line 138)

sets a database row to the object fields

sets each key (=columname) value

bool setDBRow (array $row, [bool $asPopulated = TRUE], [bool $debug = FALSE])
  • array $row: the row form a select * from DBMS_TABLEOBJ::myTable
  • bool $asPopulated: set populateTS as if the object has been populated
  • bool $debug

Redefinition of:
DBMS_TABLEOBJ::setDBRow()
sets a database row to the object fields
setFile (line 327)

sets file with attribs

void setFile (string $aName, [bool $isTmp = FALSE], [bool $debug = FALSE])
  • string $aName
  • bool $isTmp
  • bool $debug

Redefined in descendants as:
setFileFromSource (line 361)

moves the file from a source on the server to the category dir returns the full path to the file

string setFileFromSource (string $source, [bool $overwrite = FALSE], [bool $link = FALSE], [bool $debug = FALSE])
  • string $source
  • bool $overwrite
  • bool $link: link the file instead of moving
  • bool $debug
setFileFromUpload (line 426)

sets the file values from a php $_FILES array by setting MEF_NAME and calling setFileFromSource() and finaly calling setMIMEfromExtension

  • since: pk-05-04-19
string setFileFromUpload (array $uplFile, [boolean $overwrite = FALSE], [boolean $debug = FALSE])
  • array $uplFile
  • boolean $overwrite
  • boolean $debug
setFORMPOST (line 216)

sets post array with form checks

  • version: pk-03-12-13
bool setFORMPOST ( &$frmObj,  $dbval, [bool $debug = FALSE], DBMS_FORM $frmObj, array $dbVal)
  • DBMS_FORM $frmObj: a formObj as ref
  • array $dbVal: array with data
  • bool $debug
  • &$frmObj
  • $dbval

Redefined in descendants as:
setMIMEfromExtension (line 684)

tries to get mimetype from file extension

int setMIMEfromExtension (string $aName, [bool $debug = FALSE])
  • string $aName
  • bool $debug
setMIMEType (line 653)

sets dem MIME-Type Id

void setMIMEType (int $aTypeId)
  • int $aTypeId

Inherited Methods

Inherited From MED_TABLEOBJ

 MED_TABLEOBJ::getCategory()
 MED_TABLEOBJ::getCatId()
 MED_TABLEOBJ::getCatRootDir()
 MED_TABLEOBJ::setCatId()
 MED_TABLEOBJ::setName()

Inherited From DBMS_TABLEOBJ

 DBMS_TABLEOBJ::DBMS_TABLEOBJ()
 DBMS_TABLEOBJ::cacheRestore()
 DBMS_TABLEOBJ::cacheWriteTo()
 DBMS_TABLEOBJ::clearErrors()
 DBMS_TABLEOBJ::dbDelete()
 DBMS_TABLEOBJ::dbGetDataArray()
 DBMS_TABLEOBJ::dbGetForm()
 DBMS_TABLEOBJ::dbInsert()
 DBMS_TABLEOBJ::dbPopulate()
 DBMS_TABLEOBJ::dbReplace()
 DBMS_TABLEOBJ::dbSave()
 DBMS_TABLEOBJ::db_SetKey()
 DBMS_TABLEOBJ::db_SetKeyArray()
 DBMS_TABLEOBJ::getClassInclude()
 DBMS_TABLEOBJ::getDbDesc()
 DBMS_TABLEOBJ::getDBField()
 DBMS_TABLEOBJ::getDBRow()
 DBMS_TABLEOBJ::getDBVal()
 DBMS_TABLEOBJ::getDefaults()
 DBMS_TABLEOBJ::getErrorMsg()
 DBMS_TABLEOBJ::getFieldDBDefault()
 DBMS_TABLEOBJ::getForm()
 DBMS_TABLEOBJ::getFormClassName()
 DBMS_TABLEOBJ::getFormName()
 DBMS_TABLEOBJ::getJSON()
 DBMS_TABLEOBJ::getKeyArr()
 DBMS_TABLEOBJ::getMyTable()
 DBMS_TABLEOBJ::getObjValArray()
 DBMS_TABLEOBJ::getObjValValue()
 DBMS_TABLEOBJ::getPopulateTs()
 DBMS_TABLEOBJ::getWhere()
 DBMS_TABLEOBJ::hasChanged()
 DBMS_TABLEOBJ::hasColumn()
 DBMS_TABLEOBJ::hasErrors()
 DBMS_TABLEOBJ::hasObjVals()
 DBMS_TABLEOBJ::init()
 DBMS_TABLEOBJ::isInit()
 DBMS_TABLEOBJ::isPopulated()
 DBMS_TABLEOBJ::keysAreSet()
 DBMS_TABLEOBJ::populateFromKeys()
 DBMS_TABLEOBJ::populateFromValues()
 DBMS_TABLEOBJ::populateObjVals()
 DBMS_TABLEOBJ::p_cacheIsExpired()
 DBMS_TABLEOBJ::saveLinkedRow()
 DBMS_TABLEOBJ::saveLinkedTableRows()
 DBMS_TABLEOBJ::saveObjVals()
 DBMS_TABLEOBJ::setChanged()
 DBMS_TABLEOBJ::setDBField()
 DBMS_TABLEOBJ::setDBFieldIfDiff()
 DBMS_TABLEOBJ::setDBFieldIfEmpty()
 DBMS_TABLEOBJ::setDBRow()
 DBMS_TABLEOBJ::setDBVal()
 DBMS_TABLEOBJ::setDefaults()
 DBMS_TABLEOBJ::setError()
 DBMS_TABLEOBJ::setLinkedTableRow()
 DBMS_TABLEOBJ::setMyTable()
 DBMS_TABLEOBJ::setObjValArray()
 DBMS_TABLEOBJ::setObjValValue()
 DBMS_TABLEOBJ::setObjVarIfEmpty()
 DBMS_TABLEOBJ::setUnChanged()
 DBMS_TABLEOBJ::userIsAllowed()
 DBMS_TABLEOBJ::writeDebugInfo()
 DBMS_TABLEOBJ::xmladdDOMElement()
 DBMS_TABLEOBJ::xmlExport()
 DBMS_TABLEOBJ::_getCacheFileName()
 DBMS_TABLEOBJ::_getDBFields()

Inherited From OCSP_OBJ

 OCSP_OBJ::castObj()
 OCSP_OBJ::cloneMe()
 OCSP_OBJ::currentUser()
 OCSP_OBJ::dbConnect()
 OCSP_OBJ::defaultDBObj()
 OCSP_OBJ::defaultReadDBObj()
 OCSP_OBJ::defaultWriteDBObj()
 OCSP_OBJ::getConf()
 OCSP_OBJ::getDBObj()
 OCSP_OBJ::get_myClassConstant()
 OCSP_OBJ::get_myObject_vars()
 OCSP_OBJ::get_mySourceFile()
 OCSP_OBJ::isConnected()
 OCSP_OBJ::isMultiByteStr()
 OCSP_OBJ::isUTF8()
 OCSP_OBJ::setConf()
 OCSP_OBJ::setDBObj()
 OCSP_OBJ::set_myObject_vars()
 OCSP_OBJ::set_myVarsFrom()
Class Constants

Inherited Constants

Inherited from DBMS_TABLEOBJ

DBMS_TABLEOBJ::CLASS_SRC_FILE

Inherited from OCSP_OBJ

OCSP_OBJ::CLASS_SRC_FILE

Documentation generated on Thu, 08 Jan 2009 17:44:55 +0100 by phpDocumentor 1.4.0a2