Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes

oxDynImgGenerator Class Reference

Collaboration diagram for oxDynImgGenerator:

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 107 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:
oxSystemComponentException Throws an exception if the called method does not exist or is not accessable in current class
Returns:
string

Definition at line 190 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 389 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 354 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 506 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 339 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 323 of file oxdynimggenerator.php.

oxDynImgGenerator._getHeaders (  )  [protected]

Returs headers array

Returns:
array

Definition at line 719 of file oxdynimggenerator.php.

oxDynImgGenerator._getImageInfo (  )  [protected]

Returns image info array

Returns:
array

Definition at line 270 of file oxdynimggenerator.php.

oxDynImgGenerator._getImageMasterPath (  )  [protected]

Returns path to possible master image

Returns:
string

Definition at line 253 of file oxdynimggenerator.php.

oxDynImgGenerator._getImageName (  )  [protected]

Returns requested image name

Returns:
string

Definition at line 243 of file oxdynimggenerator.php.

oxDynImgGenerator._getImageTarget (  )  [protected]

Returns full requested image path on file system

Returns:
string

Definition at line 285 of file oxdynimggenerator.php.

oxDynImgGenerator._getImageType (  )  [protected]

Returns image type used for image generation and header setting

Returns:
string

Definition at line 306 of file oxdynimggenerator.php.

oxDynImgGenerator._getImageUri (  )  [protected]

Returns requested image uri

Returns:
string

Definition at line 219 of file oxdynimggenerator.php.

oxDynImgGenerator._getLockName ( sName  )  [protected]

Returns lock file name

Parameters:
string $sName original file name
Returns:
string

Definition at line 552 of file oxdynimggenerator.php.

oxDynImgGenerator._getNopicImageTarget (  )  [protected]

Nopic image path

Returns:
string

Definition at line 295 of file oxdynimggenerator.php.

oxDynImgGenerator._getShopBasePath (  )  [protected]

Returns shops base path

Returns:
string

Definition at line 209 of file oxdynimggenerator.php.

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 368 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 422 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 564 of file oxdynimggenerator.php.

oxDynImgGenerator._setHeader ( sHeader  )  [protected]

Custom header setter

Parameters:
string $sHeader header
Returns:
null

Definition at line 709 of file oxdynimggenerator.php.

oxDynImgGenerator._unlock ( sSource  )  [protected]

Deletes lock file

Parameters:
string $sSource source file which should be locked
Returns:
null

Definition at line 598 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 615 of file oxdynimggenerator.php.

static oxDynImgGenerator.getInstance (  )  [static]

Creates and returns picture generator instance

Returns:
oxDynImgGenerator

Definition at line 170 of file oxdynimggenerator.php.

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 664 of file oxdynimggenerator.php.


Member Data Documentation

oxDynImgGenerator.$_aAllowedImgTypes = array( "jpg", "jpeg", "png", "gif" ) [protected]

Definition at line 125 of file oxdynimggenerator.php.

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 150 of file oxdynimggenerator.php.

oxDynImgGenerator.$_aHeaders = array() [protected]

Definition at line 119 of file oxdynimggenerator.php.

oxDynImgGenerator.$_hLockHandle = null [protected]

Definition at line 138 of file oxdynimggenerator.php.

oxDynImgGenerator.$_oInstance = null [static, protected]

Definition at line 113 of file oxdynimggenerator.php.

oxDynImgGenerator.$_sImageInfoSep = "_" [protected]

Definition at line 132 of file oxdynimggenerator.php.

oxDynImgGenerator.$_sImageUri = null [protected]

Definition at line 144 of file oxdynimggenerator.php.


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