찾다

 >  Q&A  >  본문

java - 七牛 取指定的空间下面的文件条目,报错

发现部分空间是可以
部分空间不可以,报下面的错误
{ResponseInfo:com.qiniu.http.Response@74d25d10,status:631, reqId:OUgAAEnJhJQ3MY4U, xlog:CFGG:3/612;ZONEPROXY:12/631, xvia:, adress:rsf.qbox.me/183.136.139.24:80, duration:0.000000 s, error:no such bucket}

PHPzPHPz2863일 전1176

모든 응답(1)나는 대답할 것이다

  • 梦想无需昭告天下

    梦想无需昭告天下2017-09-26 23:14:44

    <?php

    /**

    * 인증코드 카테고리

    */

    $code= new Code();

    $code->outImage();

    class Code

    {

    protected $number;

    protected $codeType;

    protected $width;

    protected $height;

    protected $image;

    protected $code;

    공개 함수 __construct($number=4,$codeType=2,$width= 100,$height=30)

    {

    $this->number=$number;

    $this->codeType=$codeType;

    $this->width=$width;

    $this ->height=$height;

    $this->code=$this->createCode();

    }

    공개 함수 __get($name){

    if ($name=='code' ) {

    return $this->code;

    }else{

    return false;

    }

    }

    공개 함수 __destruct(){

    imagedestroy($this->image);

    }

    보호 함수 createCode(){

    스위치 ($this->codeType) {

    케이스 '0':

    $code=$this->getNumberCode();

    break;

    케이스 ' 1':

    $code=$this->getCharCode();

    break;

    케이스 '2':

    $code=$this->getNumberCharCode();

    break;

    기본값:

    die("对不起,不支持该验证码类型!!!");

    }

    return $code;

    }

    보호 함수 getNumberCode(){

    $str=join('',range (0, 9));

    return substr(str_shuffle($str), 0,$this->number);

    }

    보호 함수 getCharCode(){

    $str=join('',range) (a, z));

    $str=$str.strtoupper($str);

    return substr(str_shuffle($str), 0,$this->number);

    }

    보호 함수 getNumberCharCode (){

    $str1=join('',range(0, 9));

    $str=join('',range(a, z));

    $str=$str1.$str. strtoupper($str);

    return substr(str_shuffle($str), 0,$this->number);

    }

    공개 함수 outImage(){

    $this->createImage();

    $this->fillBack();

    $this->drawChar();

    $this->drawDistrub();

    $this->show();

    }

    보호 함수 createImage(){

    $this->image=imagecreatetruecolor($this->width, $this->height);

    }

    보호 함수 fillBack(){

    imagefill($this-> image, 0, 0, $this->lightColor());

    }

    보호 함수  lightColor(){

            return  imagecolorallocate($this->image, mt_rand(130,255), mt_rand(130,255), mt_rand (130,255));

    }

    보호된 함수 darkColor(){

    return  imagecolorallocate($this->image, mt_rand(0,120), mt_rand(0,120), mt_rand(0,120));

    }

    protected 함수 drawChar(){

    for ($i=0; $i <$this->번호; $i++) { 

    $Width=$this->너비/$this->number;

    $x=mt_rand($i*$Width+10,($i+1)*$Width-15);

    $y=mt_rand(0,$this->height-18);

    imagechar( $this->image, 6, $x, $y, $this->code[$i], $this->darkColor());

    }

    }

    보호 함수 drawDistrub(){

    for ($i=0; $i < 300; $i++) { 

    $x=mt_rand(0,$this->width);

    $y=mt_rand(0,$this-> height);

    imagesetpixel($this->image, $x, $y, $this->lightColor());

    }

    }

    보호 함수 show(){

    header("콘텐츠 -유형:이미지/png");

    imagepng($this->image);

    }

    }

    ?>


    회신하다
    0
  • 취소회신하다