public function __construct($height = null, $width = null, $options = null) { parent::__construct(); $this->height = !empty($height) ? $height : $this->height; $this->width = !empty($width) ? $width : $this->width; $this->imgDir = !empty($options['imgDir']) ? $options['imgDir'] : $this->imgDir; $this->imgUrl = !empty($options['imgUrl']) ? $options['imgUrl'] : $this->imgUrl; $this->font = !empty($options['font']) ? $options['font'] : $this->font; $this->fsize = !empty($options['fsize']) ? $options['fsize'] : $this->fsize; $this->wordlen = !empty($options['wordlen']) ? $options['wordlen'] : $this->wordlen; $this->dotNoiseLevel = !empty($options['dotNoiseLevel']) ? $options['dotNoiseLevel'] : $this->dotNoiseLevel; $this->lineNoiseLevel = !empty($options['lineNoiseLevel']) ? $options['lineNoiseLevel'] : $this->lineNoiseLevel; $this->expiration = !empty($options['expiration']) ? $options['expiration'] : $this->expiration; $this->setImgDir($this->imgDir); $this->setImgUrl($this->imgUrl); $this->setFont($this->font); $this->setFontSize($this->fsize); $this->setWordlen($this->wordlen); $this->setWidth($this->width); $this->setHeight($this->height); $this->setDotNoiseLevel($this->dotNoiseLevel); $this->setLineNoiseLevel($this->lineNoiseLevel); $this->setExpiration($this->expiration); // parent::$VN = array("t"); // parent::$CN = array("r"); $this->generate(); }
public function __construct() { $laFonts = array('Starjout.ttf', 'Sofia-Regular.ttf'); $lnFont = mt_rand(0, count($laFonts) - 1); $laBg = array('nature.png'); $lnBg = mt_rand(0, count($laBg) - 1); $lsLayoutDir = BASE_DIR . DS . 'layout' . DS . 'theme' . DS . 'captcha'; $laOptions = array('font' => $lsLayoutDir . DS . 'font' . DS . $laFonts[$lnFont], 'width' => 200, 'height' => 100, 'dotNoiseLevel' => 80, 'lineNoiseLevel' => 5, 'imgDir' => CLIENT_DIR . DS . 'data' . DS . 'temp', 'imgUrl' => '/data/temp', 'startImage' => $lsLayoutDir . DS . 'img' . DS . $laBg[$lnBg]); parent::__construct($laOptions); }
public function __construct($options = array('width' => '350', 'height' => '100', 'dotNoiseLevel' => '60', 'lineNoiseLevel' => 3, 'expiration' => '360')) { parent::__construct($options); }