

Definition at line 6 of file oxutilsfile.php.
Public Member Functions | |
| __construct () | |
| 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, $sImagePath) | |
| _getImagePath ($sType) | |
| _getImageSize ($sImgType, $iImgNum, $sImgConf) | |
| _prepareImage ($sType, $sSource, $sTarget) | |
| _moveImage ($sSource, $sTarget) | |
| _removeTempImage ($sImagePath) | |
| _getUniqueFileName ($sFilePath, $sFileName, $sFileExt) | |
Protected Attributes | |
| $_iMaxPicImgCount = 12 | |
| $_iMaxZoomImgCount = 12 | |
| $_aTypeToPath | |
| $_aBadFiles = array( 'php', 'jsp', 'cgi', 'cmf', 'exe' ) | |
| $_aAllowedFiles = array( 'gif', 'jpg', 'png', 'pdf' ) | |
Static Private Attributes | |
| static | $_instance = null |
| oxUtilsFile.__construct | ( | ) |
Class constructor, initailizes pictures count info (_iMaxPicImgCount/_iMaxZoomImgCount)
Reimplemented from oxSuperCfg.
Definition at line 106 of file oxutilsfile.php.
| static oxUtilsFile.getInstance | ( | ) | [static] |
| oxUtilsFile.normalizeDir | ( | $ | sDir | ) |
Normalizes dir by adding missing trailing slash
| string | $sDir Directory |
Definition at line 126 of file oxutilsfile.php.
| oxUtilsFile.copyDir | ( | $ | sSourceDir, | |
| $ | sTargetDir | |||
| ) |
Copies directory tree for creating a new shop.
| string | $sSourceDir Source directory | |
| string | $sTargetDir Target directory |
Definition at line 143 of file oxutilsfile.php.
| oxUtilsFile.deleteDir | ( | $ | sSourceDir | ) |
Deletes directory tree.
| string | $sSourceDir Path to directory |
Definition at line 179 of file oxutilsfile.php.
| oxUtilsFile.readRemoteFileAsString | ( | $ | sPath | ) |
Reads remote stored file. Returns contents of file.
| string | $sPath Remote file path & name |
Definition at line 210 of file oxutilsfile.php.
| oxUtilsFile._prepareImageName | ( | $ | sValue, | |
| $ | sType, | |||
| $ | blDemo = false, |
|||
| $ | sImagePath | |||
| ) | [protected] |
Prepares image file name
| object | $sValue uploadable file name | |
| string | $sType image type | |
| object | $blDemo if true = whecks if file type is defined in oxutilsfile._aAllowedFiles string $sImagePath final image file location |
Definition at line 236 of file oxutilsfile.php.
| oxUtilsFile._getImagePath | ( | $ | sType | ) | [protected] |
Returns image storage path
| string | $sType image type |
Definition at line 273 of file oxutilsfile.php.
| oxUtilsFile._getImageSize | ( | $ | sImgType, | |
| $ | iImgNum, | |||
| $ | sImgConf | |||
| ) | [protected] |
Returns array of sizes which are used to resize images. If size is not defined - NULL will be returned
| string | $sImgType image type (TH, TC, ICO etc), can be useful for modules | |
| int | $iImgNum number of image (e.g. numper of ZOOM1 is 1) | |
| string | $sImgConf config parameter name, which keeps size info |
Definition at line 289 of file oxutilsfile.php.
| oxUtilsFile._prepareImage | ( | $ | sType, | |
| $ | sSource, | |||
| $ | sTarget | |||
| ) | [protected] |
Prepares (resizes anc copies) images according to its type. Returns preparation status
| string | $sType image type | |
| string | $sSource image location | |
| string | $sTarget image copy location |
Definition at line 327 of file oxutilsfile.php.
| oxUtilsFile._moveImage | ( | $ | sSource, | |
| $ | sTarget | |||
| ) | [protected] |
Moves image from source to target location
| string | $sSource image location | |
| string | $sTarget image copy location |
Definition at line 386 of file oxutilsfile.php.
| oxUtilsFile._removeTempImage | ( | $ | sImagePath | ) | [protected] |
Removes temporary created image
| string | $sImagePath temporary image path |
Definition at line 410 of file oxutilsfile.php.
| oxUtilsFile.processFiles | ( | $ | oObject = null, |
|
| $ | aFiles = array() | |||
| ) |
Uploaded file processor (filters, etc), sets configuration parameters to passed object and returns it.
| object | $oObject object, that parameters are modified according to passed files | |
| array | $aFiles name of files to process |
Definition at line 424 of file oxutilsfile.php.
| oxUtilsFile.checkFile | ( | $ | sFile | ) |
Checks if passed file exists and may be opened for reading. Returns true on success.
| string | $sFile Name of file to check |
Definition at line 486 of file oxutilsfile.php.
| oxUtilsFile.urlValidate | ( | $ | sLink | ) |
Checks if given URL is accessible (HTTP-Code: 200)
| string | $sLink given link |
Definition at line 516 of file oxutilsfile.php.
| oxUtilsFile.handleUploadedFile | ( | $ | aFileInfo, | |
| $ | sUploadPath | |||
| ) |
Handles uploaded path. Returns new URL to the file
| array | $aFileInfo Global $_FILE parameter info | |
| string | $sUploadPath RELATIVE (to config sShopDir parameter) path for uploaded file to be copied |
| oxException | if file is not valid |
Definition at line 553 of file oxutilsfile.php.
| oxUtilsFile._getUniqueFileName | ( | $ | sFilePath, | |
| $ | sFileName, | |||
| $ | sFileExt | |||
| ) | [protected] |
Checks if file with same name does not exist, if exists - addes number prefix to file name Returns unique file name.
| string | $sFilePath file storage path/folder (e.g. /htdocs/out/img/) | |
| string | $sFileName name of file (e.g. picture1) | |
| string | $sFileExt file extension (e.g. gif) |
Definition at line 605 of file oxutilsfile.php.
oxUtilsFile.$_instance = null [static, private] |
Definition at line 13 of file oxutilsfile.php.
oxUtilsFile.$_iMaxPicImgCount = 12 [protected] |
Definition at line 20 of file oxutilsfile.php.
oxUtilsFile.$_iMaxZoomImgCount = 12 [protected] |
Definition at line 27 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 34 of file oxutilsfile.php.
oxUtilsFile.$_aBadFiles = array( 'php', 'jsp', 'cgi', 'cmf', 'exe' ) [protected] |
Definition at line 69 of file oxutilsfile.php.
oxUtilsFile.$_aAllowedFiles = array( 'gif', 'jpg', 'png', 'pdf' ) [protected] |
Definition at line 77 of file oxutilsfile.php.
1.5.5