OXID eShop CE
6.1.5
|
Public Member Functions | |
__construct () | |
getNewFilesCounter () | |
normalizeDir ($sDir) | |
copyDir ($sSourceDir, $sTargetDir) | |
deleteDir ($sSourceDir) | |
readRemoteFileAsString ($sPath) | |
processFiles ($oObject=null, $aFiles=[], $blUseMasterImage=false, $blUnique=true) | |
checkFile ($sFile) | |
urlValidate ($sLink) | |
processFile ($sFileName, $sUploadPath) | |
getImageDirByType ($sType, $blGenerated=false) | |
translateError ($iError) | |
Public Attributes | |
const | PROMO_PICTURE_DIR = 'promo' |
Protected Member Functions | |
_setNewFilesCounter ($iNewFilesCounter) | |
_prepareImageName ($sValue, $sType, $blDemo, $sImagePath, $blUnique=true) | |
_getImagePath ($sType) | |
_getImageSize ($sImgType, $iImgNum, $sImgConf) | |
_copyFile ($sSource, $sTarget) | |
_moveImage ($sSource, $sTarget) | |
_getUniqueFileName ($sFilePath, $sFileName, $sFileExt, $sSufix="", $blUnique=true) | |
Protected Attributes | |
$_iMaxPicImgCount = 12 | |
$_iMaxZoomImgCount = 12 | |
$_aTypeToPath | |
$_aBadFiles = ['php', 'php3', 'php4', 'php5', 'phps', 'php6', 'jsp', 'cgi', 'cmf', 'exe', 'phtml', 'pht', 'phar'] | |
$_aAllowedFiles = ['gif', 'jpg', 'jpeg', 'png', 'pdf'] | |
$_iNewFilesCounter = 0 | |
File manipulation utility class
OxidEsales\EshopCommunity\Core\UtilsFile::__construct | ( | ) |
Class constructor, initailizes pictures count info (_iMaxPicImgCount/_iMaxZoomImgCount)
|
protected |
Copy file from source to target location
string | $sSource | file location |
string | $sTarget | file location |
|
protected |
Returns image storage path
string | $sType | image type |
|
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 |
|
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) |
string | $sSufix | file name sufix (e.g. _ico) |
bool | $blUnique | TRUE - generates unique file name, FALSE - just glues given parts of file name |
|
protected |
Moves image from source to target location
string | $sSource | image location |
string | $sTarget | image copy location |
|
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 \OxidEsales\Eshop\Core\UtilsFile::_aAllowedFiles |
string | $sImagePath | final image file location |
bool | $blUnique | if TRUE - generates unique file name |
|
protected |
Setter for param _iNewFilesCounter which counts how many new files added.
integer | $iNewFilesCounter | New files count. |
OxidEsales\EshopCommunity\Core\UtilsFile::checkFile | ( | $sFile | ) |
Checks if passed file exists and may be opened for reading. Returns true on success.
string | $sFile | Name of file to check |
OxidEsales\EshopCommunity\Core\UtilsFile::copyDir | ( | $sSourceDir, | |
$sTargetDir | |||
) |
Copies directory tree for creating a new shop.
string | $sSourceDir | Source directory |
string | $sTargetDir | Target directory |
OxidEsales\EshopCommunity\Core\UtilsFile::deleteDir | ( | $sSourceDir | ) |
Deletes directory tree.
string | $sSourceDir | Path to directory |
OxidEsales\EshopCommunity\Core\UtilsFile::getImageDirByType | ( | $sType, | |
$blGenerated = false |
|||
) |
Returns image storage path
string | $sType | image type |
bool | $blGenerated | generated image dir. |
OxidEsales\EshopCommunity\Core\UtilsFile::getNewFilesCounter | ( | ) |
Getter for param _iNewFilesCounter which counts how many new files added.
OxidEsales\EshopCommunity\Core\UtilsFile::normalizeDir | ( | $sDir | ) |
Normalizes dir by adding missing trailing slash
string | $sDir | Directory |
OxidEsales\EshopCommunity\Core\UtilsFile::processFile | ( | $sFileName, | |
$sUploadPath | |||
) |
Process uploaded files. Returns unique file name, on fail false
string | $sFileName | form file item name |
string | $sUploadPath | RELATIVE (to config sShopDir parameter) path for uploaded file to be copied |
oxException | if file is not valid |
OxidEsales\EshopCommunity\Core\UtilsFile::processFiles | ( | $oObject = null , |
|
$aFiles = [] , |
|||
$blUseMasterImage = false , |
|||
$blUnique = true |
|||
) |
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 |
bool | $blUseMasterImage | use master image as source for processing |
bool | $blUnique | TRUE - forces new file creation with unique name |
OxidEsales\EshopCommunity\Core\UtilsFile::readRemoteFileAsString | ( | $sPath | ) |
Reads remote stored file. Returns contents of file.
string | $sPath | Remote file path & name |
OxidEsales\EshopCommunity\Core\UtilsFile::translateError | ( | $iError | ) |
Translate php file upload errors to user readable format.
integer | $iError | php file upload error number |
OxidEsales\EshopCommunity\Core\UtilsFile::urlValidate | ( | $sLink | ) |
Checks if given URL is accessible (HTTP-Code: 200)
string | $sLink | given link |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
const OxidEsales\EshopCommunity\Core\UtilsFile::PROMO_PICTURE_DIR = 'promo' |