Example #1
0
 /**
  * Generate captcha
  *
  * @return string captcha ID
  */
 public function generate()
 {
     $id = parent::generate();
     $tries = 5;
     // If there's already such file, try creating a new ID
     while ($tries-- && file_exists($this->getImgDir() . $id . $this->getSuffix())) {
         $id = $this->_generateRandomId();
         $this->_setId($id);
     }
     $this->_generateImage($id, $this->getWord());
     if (mt_rand(1, $this->getGcFreq()) == 1) {
         $this->_gc();
     }
     return $id;
 }
Example #2
0
 /**
  * Generate new captcha
  *
  * @return string
  */
 public function generate()
 {
     $this->useNumbers = false;
     return parent::generate();
 }