Class SGL_Image

Description

Base image class.

Located in /SGL/Image.php (line 48)


	
			
Variable Summary
 string $fileName
 string $moduleName
 array $_aParams
 array $_aStrats
Method Summary
 static boolean _ensureDirIsWritable (string $dirName)
 static boolean _isInstanceMethod ()
 static boolean _isStaticMethod ()
 SGL_Image SGL_Image ([string $fileName = null], [string $moduleName = ''])
 boolean create (string $srcLocation, [string $callback = 'move_uploaded_file'], [boolean $replace = false])
 boolean delete ([mixed $fileName = null])
 string getFileName ()
 string getPath (string $moduleName)
 string getUrl (string $moduleName)
 boolean init (mixed $params, [string $container = SGL_IMAGE_DEFAULT_SECTION])
 void isTransformable ( $fileName)
 void isValidImage ( $fileName)
 boolean replace (string $srcLocation, [string $callback = 'move_uploaded_file'])
 array setImagePath ([ $path = ""])
 boolean transform ([mixed $section = null], [string $pathOverride = null])
 boolean transformAll ()
 string _getImagePath (string $callType, string $moduleName)
 boolean _loadStrategies ()
 boolean _setParams (array $aParams)
 boolean _toThumbnails ([string $callback = 'copy'])
Variables
string $fileName (line 55)

Image file name e.g. my-image-name.jpg.

string $moduleName (line 62)

Name of module, which uses this class.

array $_aParams = array() (line 69)

Used for image modification.

array $_aStrats = array() (line 83)

Loaded strategies.

array $_aThumbnails = array() (line 76)

Thumbnails params are stored here.

Methods
static _ensureDirIsWritable (line 573)
  • access: private
boolean _ensureDirIsWritable (string $dirName)
  • string $dirName
static _isInstanceMethod (line 681)

Check if SGL_Image instance is initialized.

boolean _isInstanceMethod ()
static _isStaticMethod (line 666)

Check if method is called statically.

boolean _isStaticMethod ()
Constructor SGL_Image (line 93)

Constructor.

  • access: public
SGL_Image SGL_Image ([string $fileName = null], [string $moduleName = ''])
  • string $fileName
  • string $moduleName
create (line 244)

Upload image and create thumbnails.

  • access: public
boolean create (string $srcLocation, [string $callback = 'move_uploaded_file'], [boolean $replace = false])
  • string $srcLocation: image temporary location
  • string $callback: which method to use to create new image
  • boolean $replace: replace existing image
delete (line 301)

Delete image and it's thumbnails.

  • access: public
boolean delete ([mixed $fileName = null])
  • mixed $fileName
generateUniqueFileName (line 167)

Generate filename.

  • access: public
string generateUniqueFileName ()
getFileName (line 110)

Get filename.

string getFileName ()
getPath (line 183)

Get path to image folder. Can be called statically or as instance call.

string getPath (string $moduleName)
  • string $moduleName
getThumbnailNames (line 428)
  • access: public
array getThumbnailNames ()
getUrl (line 207)

Get URL to image folder. Can be called statically or as instance call.

It is only possible to get an URL to a folder if we place files at SGL_MOD_DIR/$moduleName/www/images. To achieve this we must specify a module name during image instantiation or as an argument here.

string getUrl (string $moduleName)
  • string $moduleName
init (line 127)

Initialize SGL_Image instance. Can parse the specified ini file passed as $params or use the prepeared array directly.

Load strategies taking into account extracted params.

  • access: public
boolean init (mixed $params, [string $container = SGL_IMAGE_DEFAULT_SECTION])
  • mixed $params
  • string $container
isTransformable (line 223)
void isTransformable ( $fileName)
  • $fileName
isValidImage (line 217)
void isValidImage ( $fileName)
  • $fileName
replace (line 287)

Alias for SGL_Image#create($srcLocation, $callback, $replace = true).

boolean replace (string $srcLocation, [string $callback = 'move_uploaded_file'])
  • string $srcLocation
  • string $callback
setImagePath (line 411)
  • access: public
array setImagePath ([ $path = ""])
  • $path
transform (line 335)

Transform image.

  • access: public
boolean transform ([mixed $section = null], [string $pathOverride = null])
  • mixed $section
  • string $pathOverride
transformAll (line 393)

Transform main image and all it's thumbnails by loaded strategies.

boolean transformAll ()
_getImagePath (line 472)
  • access: private
string _getImagePath (string $callType, string $moduleName)
  • string $callType
  • string $moduleName
_loadStrategies (line 601)
  • access: private
boolean _loadStrategies ()
_setParams (line 442)

Set modification params.

  • access: private
boolean _setParams (array $aParams)
  • array $aParams
_toThumbnails (line 528)

Copy, move or delete thumbnails, using original image.

  • access: private
boolean _toThumbnails ([string $callback = 'copy'])
  • string $callback: operation to perform on original image

Documentation generated on Tue, 23 Feb 2010 18:14:30 +0000 by phpDocumentor 1.4.3