Amiro.CMS API Reference
Amiro.Ru / Manual
Loading search...

The AMI_iCaptchaImage interface

• Introduction

Captcha image generator interface.

• Interface synopsis

AMI_iCaptchaImage {
/* Methods */
// Constructor.
public __construct ( [ int $numSymbols = 4 ], [ string $charset = AMI_iCaptcha::CHARSET_DIGITS ] ) returns AMI_iCaptchaImage;
// Main class function. Generation and return the image.
public createImage ( [ string $imageType = '' ], [ string $imageString = '' ] ) returns void;
// Generates random string for image.
public generateRandomImageString ( [ string $charset = AMI_iCaptcha::CHARSET_DIGITS ] ) returns string;
// Getting custom option value.
public getGenerateOption ( string $name ) returns mixed;
// Returns image string.
public getImageString ( ) returns string;
// Returns is GD lib installed or not.
public isGDLibInstalled ( ) returns bool;
// Output current image to output stream.
public outToStream ( ) returns bool;
// Setting custom option.
public setGenerateOption ( string $name, string $value ) returns void;
// Setting string of symbols to generate image.
public setImageString ( string $string ) returns void;
// Setting number of symbols in image.
public setNumSymbols ( [ int $numSymbols = 4 ] ) returns void;
}
Tags:
since 5.12.0

• Interface Methods

// Constructor.
public __construct ( [ int $numSymbols = 4 ], [ string $charset = AMI_iCaptcha::CHARSET_DIGITS ] ) returns AMI_iCaptchaImage;
  • int $numSymbols
    How many symbols
  • string $charset
    Available constants: AMI_iCaptcha::CHARSET_DIGITS, AMI_iCaptcha::CHARSET_LETTERS, AMI_iCaptcha::CHARSET_LETTERS|AMI_iCaptcha::CHARSET_DIGITS
Defines the default parameters and constants.
// Main class function. Generation and return the image.
public createImage ( [ string $imageType = '' ], [ string $imageString = '' ] ) returns void;
  • string $imageType
    Optional, type of image. This version supported types - 'png', 'gif', 'jpg', 'wbmp'
  • string $imageString
    Optional, the string, which will be drawn. If parameter is not given, then will be drawn random number.
// Generates random string for image.
public generateRandomImageString ( [ string $charset = AMI_iCaptcha::CHARSET_DIGITS ] ) returns string;
  • string $charset
    Available constants: AMI_iCaptcha::CHARSET_DIGITS, AMI_iCaptcha::CHARSET_LETTERS, AMI_iCaptcha::CHARSET_LETTERS|AMI_iCaptcha::CHARSET_DIGITS
// Getting custom option value.
public getGenerateOption ( string $name ) returns mixed;
  • string $name
    Option name
// Returns image string.
public getImageString ( ) returns string;
// Returns is GD lib installed or not.
public isGDLibInstalled ( ) returns bool;
// Output current image to output stream.
public outToStream ( ) returns bool;
// Setting custom option.
public setGenerateOption ( string $name, string $value ) returns void;
  • string $name
    Name of option
  • string $value
    Option's value
// Setting string of symbols to generate image.
public setImageString ( string $string ) returns void;
  • string $string
    String
// Setting number of symbols in image.
public setNumSymbols ( [ int $numSymbols = 4 ] ) returns void;
  • int $numSymbols
    How many symbols