diff --git a/library/org/auto.php b/library/org/auto.php index f1f78257..8c3e66a4 100644 --- a/library/org/auto.php +++ b/library/org/auto.php @@ -9,7 +9,7 @@ // | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +namespace org; class Auto { diff --git a/library/org/crypt.php b/library/org/crypt.php index 4d536e48..52a8e0e7 100644 --- a/library/org/crypt.php +++ b/library/org/crypt.php @@ -9,7 +9,7 @@ // | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +namespace org; class Crypt { diff --git a/library/org/image.php b/library/org/image.php index a6bb34a7..b742b5bb 100644 --- a/library/org/image.php +++ b/library/org/image.php @@ -9,7 +9,7 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think; +namespace org; /* 缩略图相关常量定义 */ define('THINKIMAGE_THUMB_SCALING', 1); //常量,标识缩略图等比例缩放类型 diff --git a/library/org/image/driver/gd.php b/library/org/image/driver/gd.php index 8424a852..712c5f50 100644 --- a/library/org/image/driver/gd.php +++ b/library/org/image/driver/gd.php @@ -9,7 +9,7 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\image\driver; +namespace org\image\driver; use Exception; @@ -17,21 +17,26 @@ class Gd { /** * 图像资源对象 + * * @var resource */ private $im; + /** - * @var $git \think\image\driver\Gif -*/ + * @var $git org\image\driver\Gif + */ private $gif; + /** - * 图像信息,包括width,height,type,mime,size + * 图像信息,包括 width, height, type, mime, size + * * @var array */ private $info; /** * 构造方法,可用于打开一张图像 + * * @param string $imgname 图像路径 */ public function __construct($imgname = null) @@ -322,8 +327,8 @@ class Gd //设置缩略图的坐标及宽度和高度 $neww = $w * $scale; $newh = $h * $scale; - $x = $this->info['width'] - $w; - $y = $this->info['height'] - $h; + $x = $this->info['width'] - $w; + $y = $this->info['height'] - $h; $posx = ($width - $w * $scale) / 2; $posy = ($height - $h * $scale) / 2; diff --git a/library/org/image/driver/gif.php b/library/org/image/driver/gif.php index 0b50b258..462e594b 100644 --- a/library/org/image/driver/gif.php +++ b/library/org/image/driver/gif.php @@ -9,23 +9,27 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\image\driver; +namespace org\image\driver; + class Gif { /** * GIF帧列表 + * * @var array */ private $frames = []; /** * 每帧等待时间列表 + * * @var array */ private $delays = []; /** * 构造方法,用于解码GIF图片 + * * @param string $src GIF图片数据 * @param string $mod 图片数据类型 */ @@ -49,6 +53,7 @@ class Gif /** * 设置或获取当前帧的数据 + * * @param string $stream 二进制数据流 * @return mixed 获取到的数据 */ @@ -57,13 +62,13 @@ class Gif if (is_null($stream)) { $current = current($this->frames); return false === $current ? reset($this->frames) : $current; - } else { - $this->frames[key($this->frames)] = $stream; } + $this->frames[key($this->frames)] = $stream; } /** * 将当前帧移动到下一帧 + * * @return string 当前帧数据 */ public function nextImage() @@ -73,6 +78,7 @@ class Gif /** * 编码并保存当前GIF图片 + * * @param string $gifname 图片名称 */ public function save($gifname) @@ -141,7 +147,7 @@ class GIFEncode $this->LOP = ($GIF_lop > -1) ? $GIF_lop : 0; $this->DIS = ($GIF_dis > -1) ? (($GIF_dis < 3) ? $GIF_dis : 3) : 2; $this->COL = ($GIF_red > -1 && $GIF_grn > -1 && $GIF_blu > -1) ? - ($GIF_red | ($GIF_grn << 8) | ($GIF_blu << 16)) : -1; + ($GIF_red | ($GIF_grn << 8) | ($GIF_blu << 16)) : -1; for ($i = 0; $i < count($GIF_src); $i++) { if (strToLower($GIF_mod) == "url") { @@ -158,15 +164,15 @@ class GIFEncode } 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; } } } @@ -201,7 +207,7 @@ class GIFEncode */ public function GIFAddFrames($i, $d) { - $Locals_img=''; + $Locals_img = ''; $Locals_str = 13 + 3 * (2 << (ord($this->BUF[$i]{10}) & 0x07)); $Locals_end = strlen($this->BUF[$i]) - $Locals_str - 1; @@ -211,12 +217,12 @@ class GIFEncode $Locals_len = 2 << (ord($this->BUF[$i]{10}) & 0x07); $Global_rgb = substr($this->BUF[0], 13, - 3 * (2 << (ord($this->BUF[0]{10}) & 0x07))); + 3 * (2 << (ord($this->BUF[0]{10}) & 0x07))); $Locals_rgb = substr($this->BUF[$i], 13, - 3 * (2 << (ord($this->BUF[$i]{10}) & 0x07))); + 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"; + 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++) { @@ -226,23 +232,23 @@ class GIFEncode ord($Locals_rgb{3 * $j + 2}) == (($this->COL >> 0) & 0xFF) ) { $Locals_ext = "!\xF9\x04" . chr(($this->DIS << 2) + 1) . - chr(($d >> 0) & 0xFF) . chr(($d >> 8) & 0xFF) . chr($j) . "\x0"; + chr(($d >> 0) & 0xFF) . chr(($d >> 8) & 0xFF) . chr($j) . "\x0"; break; } } } 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) { diff --git a/library/org/image/driver/imagick.php b/library/org/image/driver/imagick.php index c85d941f..3e7060a2 100644 --- a/library/org/image/driver/imagick.php +++ b/library/org/image/driver/imagick.php @@ -9,7 +9,7 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\image\driver; +namespace org\image\driver; use think\Lang; @@ -17,18 +17,21 @@ class Imagick { /** * 图像资源对象 + * * @var resource */ private $im; /** - * 图像信息,包括width,height,type,mime,size + * 图像信息,包括 width, height, type, mime, size + * * @var array */ private $info; /** * 构造方法,可用于打开一张图像 + * * @param string $imgname 图像路径 */ public function __construct($imgname = null) @@ -41,6 +44,7 @@ class Imagick /** * 打开一张图像 + * * @param string $imgname 图像路径 */ public function open($imgname) @@ -67,6 +71,7 @@ class Imagick /** * 保存图像 + * * @param string $imgname 图像保存名称 * @param string $type 图像类型 * @param boolean $interlace 是否对JPEG类型图像设置隔行扫描 @@ -104,6 +109,7 @@ class Imagick /** * 返回图像宽度 + * * @return integer 图像宽度 */ public function width() @@ -117,6 +123,7 @@ class Imagick /** * 返回图像高度 + * * @return integer 图像高度 */ public function height() @@ -130,6 +137,7 @@ class Imagick /** * 返回图像类型 + * * @return string 图像类型 */ public function type() @@ -143,6 +151,7 @@ class Imagick /** * 返回图像MIME类型 + * * @return string 图像MIME类型 */ public function mime() @@ -156,6 +165,7 @@ class Imagick /** * 返回图像尺寸数组 0 - 图像宽度,1 - 图像高度 + * * @return array 图像尺寸 */ public function size() @@ -169,6 +179,7 @@ class Imagick /** * 裁剪图像 + * * @param integer $w 裁剪区域宽度 * @param integer $h 裁剪区域高度 * @param integer $x 裁剪区域x坐标 @@ -204,7 +215,10 @@ class Imagick } } - /* 裁剪图片,内部调用 */ + /** + * 裁剪图片,内部调用 + * + */ private function _crop($w, $h, $x, $y, $width, $height, $img = null) { is_null($img) && $img = $this->im; @@ -228,6 +242,7 @@ class Imagick /** * 生成缩略图 + * * @param integer $width 缩略图最大宽度 * @param integer $height 缩略图最大高度 * @param integer $type 缩略图裁剪类型 @@ -364,7 +379,10 @@ class Imagick $this->crop($w, $h, $x, $y, $width, $height); } - /* 填充指定图像,内部使用 */ + /** + * 填充指定图像,内部使用 + * + */ private function _fill($newimg, $posx, $posy, $neww, $newh, $img = null) { is_null($img) && $img = $this->im; @@ -381,6 +399,7 @@ class Imagick /** * 添加水印 + * * @param string $source 水印图片路径 * @param integer $locate 水印位置 * @param integer $alpha 水印透明度 @@ -493,6 +512,7 @@ class Imagick /** * 图像添加文字 + * * @param string $text 添加的文字 * @param string $font 字体路径 * @param integer $size 字号 @@ -633,9 +653,11 @@ class Imagick /** * 析构方法,用于销毁图像资源 + * */ public function __destruct() { empty($this->im) || $this->im->destroy(); } + } diff --git a/library/org/oauth.php b/library/org/oauth.php index 7d307bd3..0221d9ce 100644 --- a/library/org/oauth.php +++ b/library/org/oauth.php @@ -9,7 +9,7 @@ // | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +namespace org; // oauth登录接口 // diff --git a/library/org/oauth/driver.php b/library/org/oauth/driver.php index 5180863c..33c3c892 100644 --- a/library/org/oauth/driver.php +++ b/library/org/oauth/driver.php @@ -9,7 +9,7 @@ // | Author: liu21st // +---------------------------------------------------------------------- -namespace think\oauth; +namespace org\oauth; abstract class Driver { diff --git a/library/org/oauth/driver/baidu.php b/library/org/oauth/driver/baidu.php index 56823f14..3cf67bbd 100644 --- a/library/org/oauth/driver/baidu.php +++ b/library/org/oauth/driver/baidu.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Baidu extends Driver { diff --git a/library/org/oauth/driver/diandian.php b/library/org/oauth/driver/diandian.php index 4553d2be..fe60f1d6 100644 --- a/library/org/oauth/driver/diandian.php +++ b/library/org/oauth/driver/diandian.php @@ -9,9 +9,9 @@ // | Author: 杨维杰 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Diandian extends Driver { diff --git a/library/org/oauth/driver/douban.php b/library/org/oauth/driver/douban.php index 88f157f3..9b839cf9 100644 --- a/library/org/oauth/driver/douban.php +++ b/library/org/oauth/driver/douban.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Douban extends Driver { diff --git a/library/org/oauth/driver/github.php b/library/org/oauth/driver/github.php index bbe1cad6..4fffb542 100644 --- a/library/org/oauth/driver/github.php +++ b/library/org/oauth/driver/github.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Github extends Driver { diff --git a/library/org/oauth/driver/google.php b/library/org/oauth/driver/google.php index c3628754..2b5d90cc 100644 --- a/library/org/oauth/driver/google.php +++ b/library/org/oauth/driver/google.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Google extends Driver { diff --git a/library/org/oauth/driver/kaixin.php b/library/org/oauth/driver/kaixin.php index dc638349..63ab828c 100644 --- a/library/org/oauth/driver/kaixin.php +++ b/library/org/oauth/driver/kaixin.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Kaixin extends Driver { diff --git a/library/org/oauth/driver/msn.php b/library/org/oauth/driver/msn.php index 6e52f2d0..50217086 100644 --- a/library/org/oauth/driver/msn.php +++ b/library/org/oauth/driver/msn.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Msn extends Driver { diff --git a/library/org/oauth/driver/qq.php b/library/org/oauth/driver/qq.php index d82488cf..5aa0f402 100644 --- a/library/org/oauth/driver/qq.php +++ b/library/org/oauth/driver/qq.php @@ -9,9 +9,9 @@ // | Author: liu21st // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Qq extends Driver { diff --git a/library/org/oauth/driver/renren.php b/library/org/oauth/driver/renren.php index 1633ed3b..846ad0bd 100644 --- a/library/org/oauth/driver/renren.php +++ b/library/org/oauth/driver/renren.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Renren extends Driver { diff --git a/library/org/oauth/driver/sina.php b/library/org/oauth/driver/sina.php index 497f074d..0b2738e3 100644 --- a/library/org/oauth/driver/sina.php +++ b/library/org/oauth/driver/sina.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Sina extends Driver { diff --git a/library/org/oauth/driver/sohu.php b/library/org/oauth/driver/sohu.php index e4d349b4..ca59ec25 100644 --- a/library/org/oauth/driver/sohu.php +++ b/library/org/oauth/driver/sohu.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Sohu extends Driver { diff --git a/library/org/oauth/driver/t163.php b/library/org/oauth/driver/t163.php index c6949706..6c07facf 100644 --- a/library/org/oauth/driver/t163.php +++ b/library/org/oauth/driver/t163.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class T163 extends Driver { diff --git a/library/org/oauth/driver/taobao.php b/library/org/oauth/driver/taobao.php index 5fdee677..dcafc89a 100644 --- a/library/org/oauth/driver/taobao.php +++ b/library/org/oauth/driver/taobao.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Taobao extends Driver { diff --git a/library/org/oauth/driver/tencent.php b/library/org/oauth/driver/tencent.php index 6ba9f3a9..107d2cbd 100644 --- a/library/org/oauth/driver/tencent.php +++ b/library/org/oauth/driver/tencent.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class Tencent extends Driver { diff --git a/library/org/oauth/driver/x360.php b/library/org/oauth/driver/x360.php index 20e24c93..0619c141 100644 --- a/library/org/oauth/driver/x360.php +++ b/library/org/oauth/driver/x360.php @@ -9,9 +9,9 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\oauth\driver; +namespace org\oauth\driver; -use think\oauth\Driver; +use org\oauth\Driver; class X360 extends Driver { diff --git a/library/org/parser.php b/library/org/parser.php index 0928137b..594e08d2 100644 --- a/library/org/parser.php +++ b/library/org/parser.php @@ -9,7 +9,7 @@ // | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +namespace org; // 内容解析类 class Parser diff --git a/library/org/parser/driver/markdown.php b/library/org/parser/driver/markdown.php index ddd0a88a..39634b61 100644 --- a/library/org/parser/driver/markdown.php +++ b/library/org/parser/driver/markdown.php @@ -13,7 +13,7 @@ # 应用到ThinkPHP中,因而修改为ThinkPHP规范的命名空间 # namespace Michelf; -namespace think\parser\driver; +namespace org\parser\driver; # # The following two constants are deprecated: avoid using them, they'll diff --git a/library/org/parser/driver/ubb.php b/library/org/parser/driver/ubb.php index 1f071c74..a5b31c01 100644 --- a/library/org/parser/driver/ubb.php +++ b/library/org/parser/driver/ubb.php @@ -11,7 +11,7 @@ // | Ubb.php 2013-04-03 // +---------------------------------------------------------------------- -namespace think\parser\driver; +namespace org\parser\driver; class Ubb { diff --git a/library/org/transform.php b/library/org/transform.php index bcd3c5c2..e01e0b23 100644 --- a/library/org/transform.php +++ b/library/org/transform.php @@ -9,7 +9,7 @@ // | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +namespace org; // 内容解析类 use think\Exception as Exception; diff --git a/library/org/transform/driver/json.php b/library/org/transform/driver/json.php index 25186344..ddbbbd06 100644 --- a/library/org/transform/driver/json.php +++ b/library/org/transform/driver/json.php @@ -9,7 +9,7 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\transform\driver; +namespace org\transform\driver; class Json { diff --git a/library/org/transform/driver/xml.php b/library/org/transform/driver/xml.php index 012e5894..e5aec7d2 100644 --- a/library/org/transform/driver/xml.php +++ b/library/org/transform/driver/xml.php @@ -9,7 +9,7 @@ // | Author: 麦当苗儿 // +---------------------------------------------------------------------- -namespace think\transform\driver; +namespace org\transform\driver; class Xml { diff --git a/library/org/upload.php b/library/org/upload.php index 285fa645..34549fb0 100644 --- a/library/org/upload.php +++ b/library/org/upload.php @@ -9,9 +9,9 @@ // | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +namespace org; -use think\Image; +use org\Image; class Upload { diff --git a/library/org/validate.php b/library/org/validate.php index 66ad7161..2ba66ea9 100644 --- a/library/org/validate.php +++ b/library/org/validate.php @@ -9,7 +9,7 @@ // | Author: liu21st // +---------------------------------------------------------------------- -namespace think; +namespace org; use think\Lang;