Skip to content

Commit

Permalink
PHPCBF自动修复
Browse files Browse the repository at this point in the history
  • Loading branch information
kinosang committed Dec 16, 2015
1 parent 4a9e788 commit bc1b5f7
Show file tree
Hide file tree
Showing 56 changed files with 340 additions and 223 deletions.
1 change: 0 additions & 1 deletion thinkphp/library/org/crypt.php
Expand Up @@ -233,5 +233,4 @@ protected static function compareString($known, $input)
}
return $result === 0;
}

}
17 changes: 12 additions & 5 deletions thinkphp/library/org/image/driver/gd.php
Expand Up @@ -17,7 +17,7 @@ class Gd
{
/**
* 图像资源对象
*
*
* @var resource
*/
private $im;
Expand All @@ -29,14 +29,14 @@ class Gd

/**
* 图像信息,包括 width, height, type, mime, size
*
*
* @var array
*/
private $info;

/**
* 构造方法,可用于打开一张图像
*
*
* @param string $imgname 图像路径
*/
public function __construct($imgname = null)
Expand Down Expand Up @@ -495,8 +495,15 @@ public function water($source, $locate = THINKIMAGE_WATER_SOUTHEAST)
* @return $this
* @throws Exception
*/
public function text($text, $font, $size, $color = '#00000000',
$locate = THINKIMAGE_WATER_SOUTHEAST, $offset = 0, $angle = 0) {
public function text(
$text,
$font,
$size,
$color = '#00000000',
$locate = THINKIMAGE_WATER_SOUTHEAST,
$offset = 0,
$angle = 0
) {
//资源检测
if (empty($this->im)) {
throw new Exception('没有可以被写入文字的图像资源');
Expand Down
77 changes: 43 additions & 34 deletions thinkphp/library/org/image/driver/gif.php
Expand Up @@ -53,7 +53,7 @@ public function __construct($src = null, $mod = 'url')

/**
* 设置或获取当前帧的数据
*
*
* @param string $stream 二进制数据流
* @return mixed 获取到的数据
*/
Expand All @@ -68,7 +68,7 @@ public function image($stream = null)

/**
* 将当前帧移动到下一帧
*
*
* @return string 当前帧数据
*/
public function nextImage()
Expand All @@ -78,15 +78,14 @@ public function nextImage()

/**
* 编码并保存当前GIF图片
*
*
* @param string $gifname 图片名称
*/
public function save($gifname)
{
$gif = new GIFEncoder($this->frames, $this->delays, 0, 2, 0, 0, 0, 'bin');
file_put_contents($gifname, $gif->GetAnimation());
}

}
/*
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
Expand Down Expand Up @@ -137,8 +136,14 @@ class GIFEncode
::
*/
public function GIFEncoder(
$GIF_src, $GIF_dly, $GIF_lop, $GIF_dis,
$GIF_red, $GIF_grn, $GIF_blu, $GIF_mod
$GIF_src,
$GIF_dly,
$GIF_lop,
$GIF_dis,
$GIF_red,
$GIF_grn,
$GIF_blu,
$GIF_mod
) {
if (!is_array($GIF_src)) {
printf("%s: %s", $this->VER, $this->ERR['ERR00']);
Expand All @@ -164,15 +169,15 @@ public function GIFEncoder(
}
for ($j = (13 + 3 * (2 << (ord($this->BUF[$i]{10}) & 0x07))), $k = true; $k; $j++) {
switch ($this->BUF[$i]{ $j}) {
case "!":
if ((substr($this->BUF[$i], ($j + 3), 8)) == "NETSCAPE") {
printf("%s: %s ( %s source )!", $this->VER, $this->ERR['ERR03'], ($i + 1));
exit(0);
}
break;
case ";":
$k = false;
break;
case "!":
if ((substr($this->BUF[$i], ($j + 3), 8)) == "NETSCAPE") {
printf("%s: %s ( %s source )!", $this->VER, $this->ERR['ERR03'], ($i + 1));
exit(0);
}
break;
case ";":
$k = false;
break;
}
}
}
Expand Down Expand Up @@ -216,18 +221,23 @@ public function GIFAddFrames($i, $d)
$Global_len = 2 << (ord($this->BUF[0]{10}) & 0x07);
$Locals_len = 2 << (ord($this->BUF[$i]{10}) & 0x07);

$Global_rgb = substr($this->BUF[0], 13,
3 * (2 << (ord($this->BUF[0]{10}) & 0x07)));
$Locals_rgb = substr($this->BUF[$i], 13,
3 * (2 << (ord($this->BUF[$i]{10}) & 0x07)));
$Global_rgb = substr(
$this->BUF[0],
13,
3 * (2 << (ord($this->BUF[0]{10}) & 0x07))
);
$Locals_rgb = substr(
$this->BUF[$i],
13,
3 * (2 << (ord($this->BUF[$i]{10}) & 0x07))
);

$Locals_ext = "!\xF9\x04" . chr(($this->DIS << 2) + 0) .
chr(($d >> 0) & 0xFF) . chr(($d >> 8) & 0xFF) . "\x0\x0";

if ($this->COL > -1 && ord($this->BUF[$i]{10}) & 0x80) {
for ($j = 0; $j < (2 << (ord($this->BUF[$i]{10}) & 0x07)); $j++) {
if (
ord($Locals_rgb{3 * $j + 0}) == (($this->COL >> 16) & 0xFF) &&
if (ord($Locals_rgb{3 * $j + 0}) == (($this->COL >> 16) & 0xFF) &&
ord($Locals_rgb{3 * $j + 1}) == (($this->COL >> 8) & 0xFF) &&
ord($Locals_rgb{3 * $j + 2}) == (($this->COL >> 0) & 0xFF)
) {
Expand All @@ -238,17 +248,17 @@ public function GIFAddFrames($i, $d)
}
}
switch ($Locals_tmp{0}) {
case "!":
/**
* @var string $Locals_img;
*/
$Locals_img = substr($Locals_tmp, 8, 10);
$Locals_tmp = substr($Locals_tmp, 18, strlen($Locals_tmp) - 18);
break;
case ",":
$Locals_img = substr($Locals_tmp, 0, 10);
$Locals_tmp = substr($Locals_tmp, 10, strlen($Locals_tmp) - 10);
break;
case "!":
/**
* @var string $Locals_img;
*/
$Locals_img = substr($Locals_tmp, 8, 10);
$Locals_tmp = substr($Locals_tmp, 18, strlen($Locals_tmp) - 18);
break;
case ",":
$Locals_img = substr($Locals_tmp, 0, 10);
$Locals_tmp = substr($Locals_tmp, 10, strlen($Locals_tmp) - 10);
break;
}
if (ord($this->BUF[$i]{10}) & 0x80 && $this->IMG > -1) {
if ($Global_len == $Locals_len) {
Expand Down Expand Up @@ -295,8 +305,7 @@ public function GIFBlockCompare($GlobalBlock, $LocalBlock, $Len)
{

for ($i = 0; $i < $Len; $i++) {
if (
$GlobalBlock{3 * $i + 0} != $LocalBlock{3 * $i + 0} ||
if ($GlobalBlock{3 * $i + 0} != $LocalBlock{3 * $i + 0} ||
$GlobalBlock{3 * $i + 1} != $LocalBlock{3 * $i + 1} ||
$GlobalBlock{3 * $i + 2} != $LocalBlock{3 * $i + 2}
) {
Expand Down
12 changes: 9 additions & 3 deletions thinkphp/library/org/image/driver/imagick.php
Expand Up @@ -521,8 +521,15 @@ public function water($source, $locate = THINKIMAGE_WATER_SOUTHEAST)
* @param integer $offset 文字相对当前位置的偏移量
* @param integer $angle 文字倾斜角度
*/
public function text($text, $font, $size, $color = '#00000000',
$locate = THINKIMAGE_WATER_SOUTHEAST, $offset = 0, $angle = 0) {
public function text(
$text,
$font,
$size,
$color = '#00000000',
$locate = THINKIMAGE_WATER_SOUTHEAST,
$offset = 0,
$angle = 0
) {
//资源检测
if (empty($this->im)) {
throw new \Exception('没有可以被写入文字的图像资源');
Expand Down Expand Up @@ -659,5 +666,4 @@ public function __destruct()
{
empty($this->im) || $this->im->destroy();
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/baidu.php
Expand Up @@ -99,5 +99,4 @@ public function getOauthInfo()
throw new \Exception("获取百度用户信息失败:{$data['error_msg']}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/diandian.php
Expand Up @@ -99,5 +99,4 @@ public function getOauthInfo()
E("获取点点用户信息失败:{$data}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/douban.php
Expand Up @@ -97,5 +97,4 @@ public function getOauthInfo()
E("获取豆瓣用户信息失败:{$data['msg']}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/github.php
Expand Up @@ -98,5 +98,4 @@ public function getOauthInfo()
E("获取Github用户信息失败:{$data}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/google.php
Expand Up @@ -104,5 +104,4 @@ public function getOauthInfo()
E("获取Google用户信息失败:{$data}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/kaixin.php
Expand Up @@ -99,5 +99,4 @@ public function getOauthInfo()
E("获取开心网用户信息失败:{$data['error']}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/msn.php
Expand Up @@ -105,5 +105,4 @@ public function getOauthInfo()
E("获取msn用户信息失败:{$data}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/sina.php
Expand Up @@ -99,5 +99,4 @@ public function getOauthInfo()
E("获取人人网用户信息失败:{$data['error_msg']}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/sohu.php
Expand Up @@ -99,5 +99,4 @@ public function getOauthInfo()
E("获取搜狐用户信息失败:{$data['message']}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/t163.php
Expand Up @@ -100,5 +100,4 @@ public function getOauthInfo()
E("获取网易微博用户信息失败:{$data['error']}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/taobao.php
Expand Up @@ -103,5 +103,4 @@ public function getOauthInfo()
E("获取淘宝网用户信息失败:{$data['error_response']['msg']}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/tencent.php
Expand Up @@ -104,5 +104,4 @@ public function getOauthInfo()
E("获取人人网用户信息失败:{$data['error_msg']}");
}
}

}
1 change: 0 additions & 1 deletion thinkphp/library/org/oauth/driver/x360.php
Expand Up @@ -99,5 +99,4 @@ public function getOauthInfo()
E("获取360用户信息失败:{$data['error']}");
}
}

}

0 comments on commit bc1b5f7

Please sign in to comment.