CI框架中引入外部的验证码注意事项

引入外部验证码类的时候需要在引入的外部验证码类文件中作修改。
修改如下:
 
 
public function __construct($arr = array()) {

    $width = '';
    $height = '';
    $codeLen = '';
    $fontSize = '';
    $bgColor = '';
    $fontColor = '';

    if(!empty($arr)){
       extract($arr); 
    } 
    $this->font = BASEPATH . "fonts/font.ttf";       
    if (!is_file($this->font)) {
        error("验证码字体文件不存在");
    }
    $this->width = empty($width) ? $this->width : $width;
    $this->height = empty($height) ? $this->height : $height;
    $this->bgColor = empty($bgColor) ? $this->bgColor : $bgColor;
    $this->codeLen = empty($codeLen) ? $this->codeLen : $codeLen;
    $this->fontSize = empty($fontSize) ? $this->fontSize : $fontSize;
    $this->fontColor = empty($fontColor) ? $this->fontColor : $fontColor;
    $this->create();//生成验证码 }

你可能感兴趣的:(CI框架中引入外部的验证码注意事项)