List of all members.
Public Member Functions |
| __call ($sMethod, $aArgs) |
| getImagePath ($sAbsPath=false) |
| outputImage () |
Static Public Member Functions |
static | getInstance () |
Protected Member Functions |
| _getShopBasePath () |
| _getImageUri () |
| _getImageName () |
| _getImageMasterPath () |
| _getImageInfo () |
| _getImageTarget () |
| _getNopicImageTarget () |
| _getImageType () |
| _generatePng ($sSource, $sTarget, $iWidth, $iHeight) |
| _generateJpg ($sSource, $sTarget, $iWidth, $iHeight, $iQuality) |
| _generateGif ($sSource, $sTarget, $iWidth, $iHeight) |
| _isTargetPathValid ($sPath) |
| _createFolders ($sDir) |
| _isValidPath ($sPath) |
| _generateImage ($sImageSource, $sImageTarget) |
| _getLockName ($sName) |
| _lock ($sSource) |
| _unlock ($sSource) |
| _setHeader ($sHeader) |
| _getHeaders () |
Protected Attributes |
| $_aHeaders = array() |
| $_aAllowedImgTypes = array( "jpg", "jpeg", "png", "gif" ) |
| $_sImageInfoSep = "_" |
| $_hLockHandle = null |
| $_sImageUri = null |
| $_aConfParamToPath |
Static Protected Attributes |
static | $_oInstance = null |
Detailed Description
Image generator class
Definition at line 105 of file oxdynimggenerator.php.
Member Function Documentation
oxDynImgGenerator.__call |
( |
$ |
sMethod, |
|
|
$ |
aArgs | |
|
) |
| | |
Only used for convenience in UNIT tests by doing so we avoid writing extended classes for testing protected or private methods
- Parameters:
-
| string | $sMethod Methods name |
| array | $aArgs Argument array |
- Exceptions:
-
- Returns:
- string
Definition at line 188 of file oxdynimggenerator.php.
oxDynImgGenerator._createFolders |
( |
$ |
sDir |
) |
[protected] |
Checks if valid and creates missing needed folders
- Parameters:
-
| string | $sDir folder(s) to create |
- Returns:
- bool
Definition at line 387 of file oxdynimggenerator.php.
oxDynImgGenerator._generateGif |
( |
$ |
sSource, |
|
|
$ |
sTarget, |
|
|
$ |
iWidth, |
|
|
$ |
iHeight | |
|
) |
| | [protected] |
Generates GIF type image and returns its location on file system
- Parameters:
-
| string | $sSource image source |
| string | $sTarget image target |
| int | $iWidth image width |
| int | $iHeight image height |
- Returns:
- string
Definition at line 352 of file oxdynimggenerator.php.
oxDynImgGenerator._generateImage |
( |
$ |
sImageSource, |
|
|
$ |
sImageTarget | |
|
) |
| | [protected] |
Generates requested image
- Parameters:
-
| string | $sImageSource image source |
| string | $sImageTarget image target |
- Returns:
- string
Definition at line 504 of file oxdynimggenerator.php.
oxDynImgGenerator._generateJpg |
( |
$ |
sSource, |
|
|
$ |
sTarget, |
|
|
$ |
iWidth, |
|
|
$ |
iHeight, |
|
|
$ |
iQuality | |
|
) |
| | [protected] |
Generates JPG type image and returns its location on file system
- Parameters:
-
| string | $sSource image source |
| string | $sTarget image target |
| int | $iWidth image width |
| int | $iHeight image height |
| int | $iQuality new image quality |
- Returns:
- string
Definition at line 337 of file oxdynimggenerator.php.
oxDynImgGenerator._generatePng |
( |
$ |
sSource, |
|
|
$ |
sTarget, |
|
|
$ |
iWidth, |
|
|
$ |
iHeight | |
|
) |
| | [protected] |
Generates PNG type image and returns its location on file system
- Parameters:
-
| string | $sSource image source |
| string | $sTarget image target |
| int | $iWidth image width |
| int | $iHeight image height |
- Returns:
- string
Definition at line 321 of file oxdynimggenerator.php.
oxDynImgGenerator._getHeaders |
( |
|
) |
[protected] |
oxDynImgGenerator._getImageInfo |
( |
|
) |
[protected] |
oxDynImgGenerator._getImageMasterPath |
( |
|
) |
[protected] |
oxDynImgGenerator._getImageName |
( |
|
) |
[protected] |
oxDynImgGenerator._getImageTarget |
( |
|
) |
[protected] |
oxDynImgGenerator._getImageType |
( |
|
) |
[protected] |
Returns image type used for image generation and header setting
- Returns:
- string
Definition at line 304 of file oxdynimggenerator.php.
oxDynImgGenerator._getImageUri |
( |
|
) |
[protected] |
oxDynImgGenerator._getLockName |
( |
$ |
sName |
) |
[protected] |
Returns lock file name
- Parameters:
-
| string | $sName original file name |
- Returns:
- string
Definition at line 550 of file oxdynimggenerator.php.
oxDynImgGenerator._getNopicImageTarget |
( |
|
) |
[protected] |
oxDynImgGenerator._getShopBasePath |
( |
|
) |
[protected] |
oxDynImgGenerator._isTargetPathValid |
( |
$ |
sPath |
) |
[protected] |
Checks if requested image path is valid. If path is valid but is not created - creates directory structure
- Parameters:
-
| string | $sPath image path name to check |
- Returns:
- bool
Definition at line 366 of file oxdynimggenerator.php.
oxDynImgGenerator._isValidPath |
( |
$ |
sPath |
) |
[protected] |
Checks if main folder matches requested
- Parameters:
-
| string | $sPath image path name to check |
- Returns:
- bool
Definition at line 420 of file oxdynimggenerator.php.
oxDynImgGenerator._lock |
( |
$ |
sSource |
) |
[protected] |
Locks file and returns locking state
- Parameters:
-
| string | $sSource source file which should be locked |
- Returns:
- bool
Definition at line 562 of file oxdynimggenerator.php.
oxDynImgGenerator._setHeader |
( |
$ |
sHeader |
) |
[protected] |
oxDynImgGenerator._unlock |
( |
$ |
sSource |
) |
[protected] |
Deletes lock file
- Parameters:
-
| string | $sSource source file which should be locked |
- Returns:
- null
Definition at line 596 of file oxdynimggenerator.php.
oxDynImgGenerator.getImagePath |
( |
$ |
sAbsPath = false |
) |
|
Returns path to image file which needs should be rendered. If file cannot be found - return false
- Parameters:
-
| string | $sAbsPath absolute requested image path (not url, but real path on file system) |
- Returns:
- string | false
Definition at line 613 of file oxdynimggenerator.php.
static oxDynImgGenerator.getInstance |
( |
|
) |
[static] |
oxDynImgGenerator.outputImage |
( |
|
) |
|
Creates and outputs requested image. If source file was not found - tries to render related "nopic.jpg". If "nopic.jpg" is not available - sends 404 header to browser
- Returns:
- null
Definition at line 662 of file oxdynimggenerator.php.
Member Data Documentation
oxDynImgGenerator.$_aAllowedImgTypes = array( "jpg", "jpeg", "png", "gif" ) [protected] |
oxDynImgGenerator.$_aConfParamToPath [protected] |
Initial value: array(
"sIconsize" => '/.*\/generated\/product\/(icon|\d+)\/\d+\_\d+\_\d+$/',
"sThumbnailsize" => '/.*\/generated\/product\/(thumb|\d+)\/\d+\_\d+\_\d+$/',
"sZoomImageSize" => '/.*\/generated\/product\/\d+\/\d+\_\d+\_\d+$/',
"aDetailImageSizes" => '/.*\/generated\/product\/\d+\/\d+\_\d+\_\d+$/',
"sManufacturerIconsize" => '/.*\/generated\/(manufacturer|vendor)\/icon\/\d+\_\d+\_\d+$/',
"sCatThumbnailsize" => '/.*\/generated\/category\/thumb\/\d+\_\d+\_\d+$/',
"sCatIconsize" => '/.*\/generated\/category\/icon\/\d+\_\d+\_\d+$/',
"sCatPromotionsize" => '/.*\/generated\/category\/promo_icon\/\d+\_\d+\_\d+$/'
)
Definition at line 148 of file oxdynimggenerator.php.
oxDynImgGenerator.$_aHeaders = array() [protected] |
oxDynImgGenerator.$_hLockHandle = null [protected] |
oxDynImgGenerator.$_oInstance = null [static, protected] |
oxDynImgGenerator.$_sImageInfoSep = "_" [protected] |
oxDynImgGenerator.$_sImageUri = null [protected] |
The documentation for this class was generated from the following file: