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

Returs headers array

Returns:
array

Definition at line 717 of file oxdynimggenerator.php.

oxDynImgGenerator._getImageInfo (  )  [protected]

Returns image info array

Returns:
array

Definition at line 268 of file oxdynimggenerator.php.

oxDynImgGenerator._getImageMasterPath (  )  [protected]

Returns path to possible master image

Returns:
string

Definition at line 251 of file oxdynimggenerator.php.

oxDynImgGenerator._getImageName (  )  [protected]

Returns requested image name

Returns:
string

Definition at line 241 of file oxdynimggenerator.php.

oxDynImgGenerator._getImageTarget (  )  [protected]

Returns full requested image path on file system

Returns:
string

Definition at line 283 of file oxdynimggenerator.php.

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]

Returns requested image uri

Returns:
string

Definition at line 217 of file oxdynimggenerator.php.

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]

Nopic image path

Returns:
string

Definition at line 293 of file oxdynimggenerator.php.

oxDynImgGenerator._getShopBasePath (  )  [protected]

Returns shops base path

Returns:
string

Definition at line 207 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 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]

Custom header setter

Parameters:
string $sHeader header
Returns:
null

Definition at line 707 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 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]

Creates and returns picture generator instance

Returns:
oxDynImgGenerator

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


Member Data Documentation

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

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

oxDynImgGenerator.$_aHeaders = array() [protected]

Definition at line 117 of file oxdynimggenerator.php.

oxDynImgGenerator.$_hLockHandle = null [protected]

Definition at line 136 of file oxdynimggenerator.php.

oxDynImgGenerator.$_oInstance = null [static, protected]

Definition at line 111 of file oxdynimggenerator.php.

oxDynImgGenerator.$_sImageInfoSep = "_" [protected]

Definition at line 130 of file oxdynimggenerator.php.

oxDynImgGenerator.$_sImageUri = null [protected]

Definition at line 142 of file oxdynimggenerator.php.


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