framework/web/widgets/captcha/CCaptcha.php
public static function checkRequirements($extension=null)
	{
		if(extension_loaded('imagick'))
		{
			$imagick=new Imagick();
			$imagickFormats=$imagick->queryFormats('PNG');
		}
		if(extension_loaded('gd'))
		{
			$gdInfo=gd_info();
		}
		if($extension===null)
		{
			if(isset($imagickFormats) && in_array('PNG',$imagickFormats))
				return true;
			if(isset($gdInfo) && $gdInfo['FreeType Support'])
				return true;
		}
		elseif($extension=='imagick' && isset($imagickFormats) && in_array('PNG',$imagickFormats))
			return true;
		elseif($extension=='gd' && isset($gdInfo) && $gdInfo['FreeType Support'])
			return true;
		return false;
	}
public static function checkRequirements($extension=null)
	{
		if(extension_loaded('imagick'))
		{
			$imagick=new Imagick();
			$imagickFormats=$imagick->queryFormats('PNG');
		}
		if(extension_loaded('gd'))
		{
			$gdInfo=gd_info();
		}
		if($extension===null)
		{
			if(isset($imagickFormats) && in_array('PNG',$imagickFormats))
				return true;
			if(isset($gdInfo) && $gdInfo['FreeType Support'])
				return true;
		}
		elseif($extension=='imagick' && isset($imagickFormats) && in_array('PNG',$imagickFormats))
			return true;
		elseif($extension=='gd' && isset($gdInfo) && $gdInfo['FreeType Support'])
			return true;
		return false;
	}
public static function checkRequirements ( $ extension = null ) { if ( extension_loaded ( 'imagick' ) ) { $ imagick = new Imagick ( ) ; $ imagickFormats = $ imagick -> queryFormats ( 'PNG' ) ; } if ( extension_loaded ( 'gd' ) ) { $ gdInfo = gd_info ( ) ; } if ( $ extension === null ) { if ( isset ( $ imagickFormats ) && in_array ( 'PNG' , $ imagickFormats ) ) return true ; if ( isset ( $ gdInfo ) && $ gdInfo [ 'FreeType Support' ] ) return true ; } elseif ( $ extension == 'imagick' && isset ( $ imagickFormats ) && in_array ( 'PNG' , $ imagickFormats ) ) return true ; elseif ( $ extension == 'gd' && isset ( $ gdInfo ) && $ gdInfo [ 'FreeType Support' ] ) return true ; return false ; }
Checks if specified graphic extension support is loaded.
@param string $extension name to be checked. Possible values are 'gd', 'imagick' and null.
Default value is null meaning that both extensions will be checked. This parameter
is available since 1.1.13.
@return boolean true if ImageMagick extension with PNG support or GD with FreeType support is loaded,
otherwise false
@since 1.1.5
Checks if specified graphic extension support is loaded .