oxUtilsFile Class Reference

Inheritance diagram for oxUtilsFile:

Inheritance graph
[legend]
Collaboration diagram for oxUtilsFile:

Collaboration graph
[legend]

List of all members.


Detailed Description

File manipulation utility class

Definition at line 6 of file oxutilsfile.php.


Public Member Functions

 normalizeDir ($sDir)
 copyDir ($sSourceDir, $sTargetDir)
 deleteDir ($sSourceDir)
 readRemoteFileAsString ($sPath)
 processFiles ($oObject=null, $aFiles=array())
 checkFile ($sFile)
 urlValidate ($sLink)
 handleUploadedFile ($aFileInfo, $sUploadPath)

Static Public Member Functions

static getInstance ()

Protected Member Functions

 _prepareImageName ($sValue, $sType, $blDemo=false)
 _getImagePath ($sType)
 _prepareImage ($sType, $sSource, $sTarget)
 _moveImage ($sSource, $sTarget)

Protected Attributes

 $_aTypeToPath
 $_aBadFiles = array( 'php', 'jsp', 'cgi', 'cmf', 'exe' )
 $_aAllowedFiles = array( 'gif', 'jpg', 'png', 'pdf' )

Static Private Attributes

static $_instance = null

Member Function Documentation

static oxUtilsFile.getInstance (  )  [static]

Returns object instance

Returns:
oxUtilsFile

Definition at line 69 of file oxutilsfile.php.

oxUtilsFile.normalizeDir ( sDir  ) 

Normalizes dir by adding missing trailing slash

Parameters:
string $sDir Directory
Returns:
string

Definition at line 94 of file oxutilsfile.php.

oxUtilsFile.copyDir ( sSourceDir,
sTargetDir 
)

Copies directory tree for creating a new shop.

Parameters:
string $sSourceDir Source directory
string $sTargetDir Target directory
Returns:
null

Definition at line 111 of file oxutilsfile.php.

oxUtilsFile.deleteDir ( sSourceDir  ) 

Deletes directory tree.

Parameters:
string $sSourceDir Path to directory
Returns:
null

Definition at line 147 of file oxutilsfile.php.

oxUtilsFile.readRemoteFileAsString ( sPath  ) 

Reads remote stored file. Returns contents of file.

Parameters:
string $sPath Remote file path & name
Returns:
string

Definition at line 178 of file oxutilsfile.php.

oxUtilsFile._prepareImageName ( sValue,
sType,
blDemo = false 
) [protected]

Prepares image file name

Parameters:
object $sValue uploadable file name
string $sType image type
object $blDemo if true = whecks if file type is defined in oxutilsfile._aAllowedFiles
Returns:
string

Definition at line 203 of file oxutilsfile.php.

oxUtilsFile._getImagePath ( sType  )  [protected]

Returns image storage path

Parameters:
string $sType image type
Returns:
string

Definition at line 239 of file oxutilsfile.php.

oxUtilsFile._prepareImage ( sType,
sSource,
sTarget 
) [protected]

Prepares (resizes anc copies) images according to its type. Returns preparation status

Parameters:
string $sType image type
string $sSource image location
string $sTarget image copy location
Returns:
array

Definition at line 255 of file oxutilsfile.php.

oxUtilsFile._moveImage ( sSource,
sTarget 
) [protected]

Moves image from source to target location

Parameters:
string $sSource image location
string $sTarget image copy location
Returns:
bool

Definition at line 362 of file oxutilsfile.php.

oxUtilsFile.processFiles ( oObject = null,
aFiles = array() 
)

Uploaded file processor (filters, etc), sets configuration parameters to passed object and returns it.

Parameters:
object $oObject object, that parameters are modified according to passed files
array $aFiles name of files to process
Returns:
object

Definition at line 381 of file oxutilsfile.php.

oxUtilsFile.checkFile ( sFile  ) 

Checks if passed file exists and may be opened for reading. Returns true on success.

Parameters:
string $sFile Name of file to check
Returns:
bool

Definition at line 435 of file oxutilsfile.php.

oxUtilsFile.urlValidate ( sLink  ) 

Checks if given URL is accessible (HTTP-Code: 200)

Parameters:
string $sLink given link
Returns:
boolean

Definition at line 465 of file oxutilsfile.php.

oxUtilsFile.handleUploadedFile ( aFileInfo,
sUploadPath 
)

Handles uploaded path. Returns new URL to the file

Parameters:
array $aFileInfo Global $_FILE parameter info
string $sUploadPath RELATIVE (to config sShopDir parameter) path for uploaded file to be copied
Exceptions:
oxException if file is not valid
Returns:
string

Definition at line 502 of file oxutilsfile.php.


Member Data Documentation

oxUtilsFile.$_instance = null [static, private]

Definition at line 13 of file oxutilsfile.php.

oxUtilsFile.$_aTypeToPath [protected]

Initial value:

 array( 'ICO'  => 'icon',
                                     'CICO' => 'icon',
                                     'TH'   => '0',
                                     'TC'   => '0',
                                     'P1'   => '1',
                                     'P2'   => '2',
                                     'P3'   => '3',
                                     'P4'   => '4',
                                     'P5'   => '5',
                                     'P6'   => '6',
                                     'P7'   => '7',
                                     'P8'   => '8',
                                     'P9'   => '9',
                                     'P10'  => '10',
                                     'P11'  => '11',
                                     'P12'  => '12',
                                     'Z1'   => 'z1',
                                     'Z2'   => 'z2',
                                     'Z3'   => 'z3',
                                     'Z4'   => 'z4',
                                     'Z5'   => 'z5',
                                     'Z6'   => 'z6',
                                     'Z7'   => 'z7',
                                     'Z8'   => 'z8',
                                     'Z9'   => 'z9',
                                     'Z10'  => 'z10',
                                     'Z11'  => 'z11',
                                     'Z12'  => 'z12'
                                   )

Definition at line 20 of file oxutilsfile.php.

oxUtilsFile.$_aBadFiles = array( 'php', 'jsp', 'cgi', 'cmf', 'exe' ) [protected]

Definition at line 55 of file oxutilsfile.php.

oxUtilsFile.$_aAllowedFiles = array( 'gif', 'jpg', 'png', 'pdf' ) [protected]

Definition at line 63 of file oxutilsfile.php.


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

Generated on Tue Aug 18 09:26:15 2009 for OXID eShop CE by  doxygen 1.5.5