phpDocumentor Gd
Classes
[ class tree: Gd ] [ index: Gd ] [ all elements ]

Class: GdToolkitHelper

Source Location: /modules/gd/classes/GdToolkitHelper.class

Class GdToolkitHelper

Method Summary
array   discoverGdVersion()   Find out which version of GD is compiled in this PHP-environment
array   discoverMimeTypes()   Find out which mime types are supported on this GD.
GdFunctionality   &getGdFunctionality()   Factory to get a new GdFunctionality object.
GalleryStatus   getOperationsAndProperties()   Figure out what operations and properties are supported by the image* functions in the PHP installation and return them.
boolean   hasImageCreateTrueColor()   Tries to find out if we can imageCreateTrueColor()
array   isBundled()   Find out if this GD library is the one bundled with the PHP source.
array   isGdVersionSupported()   See if this GD version is supported by this module. Currently GD >= 2.0 is supported.
boolean   isOperationSupported()   Checks if a certain operation is supported by this GD library
string   minGdVersion()   The minimal version of GD that this module supports

[ Top ]
Methods
discoverGdVersion  [line 239]

  array discoverGdVersion( [ $gd = null]  )

Find out which version of GD is compiled in this PHP-environment

This is ugly, but the only way that works on any PHP version. The idea is from Justin Greer's manual comments for imageCreateTruecolor at php.net. This really doesn't get the correct GD version if it is an external library, since they are defined in the PHP code and just refer to the functionality that is supported. So if one sees "1.6.2 or higher", it can be as high as 1.8.2, depending on the PHP version and which functionality they test for.

Parameters:
   $gd: 

API Tags:
Return:  GalleryStatus string the GD version number or '0' if there is no GD support Prefixed with '>' if PHP says "or higher"


[ Top ]
discoverMimeTypes  [line 324]

  array discoverMimeTypes( [ $gd = null]  )

Find out which mime types are supported on this GD.

Parameters:
   $gd: 

API Tags:
Return:  GalleryStatus array supported mime-types


[ Top ]
getGdFunctionality  [line 390]

  GdFunctionality &getGdFunctionality( )

Factory to get a new GdFunctionality object.



[ Top ]
getOperationsAndProperties  [line 46]

  GalleryStatus getOperationsAndProperties( [object a $gd = null]  )

Figure out what operations and properties are supported by the image* functions in the PHP installation and return them.

Parameters:
object a   $gd:  GdFunctionality-object to work with

API Tags:
Return:  a status code array('operations' => ... 'properties' => ...)


[ Top ]
hasImageCreateTrueColor  [line 372]

  boolean hasImageCreateTrueColor( [ $gd = null]  )

Tries to find out if we can imageCreateTrueColor()

This function is always defined, but will fail with a Fatal PHP error on GD < 2.0.1. There are a lot of PHP installations compiled with external GD libraries where phpinfo informs "2.0 or higher", so we can't really know which version we have. Currently we will just consider any "2.0" to be "< 2.0.1", since I have never seen a 2.0 release that doesn't support the imageCreateTrueColor().

Parameters:
   $gd: 


[ Top ]
isBundled  [line 307]

  array isBundled( [ $gd = null]  )

Find out if this GD library is the one bundled with the PHP source.

The bundled library provides some functionality that is currently not available on the standard GD library. Those are tested here.

Parameters:
   $gd: 

API Tags:
Return:  GalleryStatus boolean true if it is the bundled library, false otherwise


[ Top ]
isGdVersionSupported  [line 281]

  array isGdVersionSupported( [string $gdVersion = null], [ $gd = null]  )

See if this GD version is supported by this module. Currently GD >= 2.0 is supported.

Parameters:
string   $gdVersion:  A gd version string or empty to check the current version
   $gd: 

API Tags:
Return:  GalleryStatus boolean true if supported, false otherwise


[ Top ]
isOperationSupported  [line 190]

  boolean isOperationSupported( $operation, [ $gd = null]  )

Checks if a certain operation is supported by this GD library

Parameters:
   $operation: 
   $gd: 


[ Top ]
minGdVersion  [line 220]

  string minGdVersion( )

The minimal version of GD that this module supports


API Tags:
Return:  A version string


[ Top ]

Documentation generated on Fri, 03 Oct 2008 05:15:56 -0700 by phpDocumentor 1.3.0RC6