PHP 클래스 Swoole\Tool

저자: Tianfeng.Han
파일 보기 프로젝트 열기: matyhtf/swoole_framework 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$number
$url_add_end
$url_key_join
$url_param_join
$url_prefix

공개 메소드들

메소드 설명
array_fullness ( $array ) : unknown_type 数组饱满度
array_iconv ( $in_charset, $out_charset, $data ) 数组编码转换
combine_query ( $urls ) : string 合并URL字串,parse_query的反向函数
dir_copy ( $fdir, $tdir ) 复制目录
dump ( $var ) : mixed 打印数组
endchar ( $string ) : mixed 获取字符串最后一位
export ( mixed $var ) : string 将PHP变量到处为文件内容
fileAppend ( $log, $file = '' )
getHumanSize ( $n, $round = 3 )
getServer ( array $servers ) : mixed 从Server列表中随机选出一个,使用status配置可以实现上线下线管理,weight(0-100)配置权重
get_age ( integer $birth_year, integer $birth_month, integer $birth_date ) : integer 根据生日来计算年龄
get_animal ( integer $birth_year, $format = '1' ) : string 根据生日中的年份来计算所属生肖
get_constellation ( integer $birth_month, integer $birth_date ) : string 根据生日中的月份和日期来计算所属星座*
howLongAgo ( $datetime ) : unknown_type 多久之前
httpExpire ( $lastModifyTime, $expire = 1800 )
num2han ( $num_str ) : mixed 数字转为汉字
num2week ( $num, boolean $two = true ) : string 数字转星期
readFile ( $file, boolean $exclusive = false ) : boolean | string 加锁读取文件
scandir ( $dir )
sendUDP ( $server_ip, $server_port, $data, $timeout = 30 ) : unknown_type 发送一个UDP包
showCost ( $func )
uri ( string $url ) : array 解析URI
urlAppend ( $url, $array )
url_merge ( $key, $value, $ignore = null, $urls = null ) : string URL合并
url_parse_into ( $url, &$request ) : unknown_type URL解析到REQUEST

메소드 상세

array_fullness() 정적인 공개 메소드

数组饱满度
static public array_fullness ( $array ) : unknown_type
$array
리턴 unknown_type

array_iconv() 정적인 공개 메소드

数组编码转换
static public array_iconv ( $in_charset, $out_charset, $data )
$in_charset
$out_charset
$data

combine_query() 정적인 공개 메소드

合并URL字串,parse_query的反向函数
static public combine_query ( $urls ) : string
$urls
리턴 string

dir_copy() 정적인 공개 메소드

复制目录
static public dir_copy ( $fdir, $tdir )

dump() 정적인 공개 메소드

打印数组
static public dump ( $var ) : mixed
$var
리턴 mixed

endchar() 정적인 공개 메소드

获取字符串最后一位
static public endchar ( $string ) : mixed
$string
리턴 mixed

export() 정적인 공개 메소드

将PHP变量到处为文件内容
static public export ( mixed $var ) : string
$var mixed
리턴 string

fileAppend() 정적인 공개 메소드

static public fileAppend ( $log, $file = '' )

getHumanSize() 정적인 공개 메소드

static public getHumanSize ( $n, $round = 3 )

getServer() 정적인 공개 메소드

从Server列表中随机选出一个,使用status配置可以实现上线下线管理,weight(0-100)配置权重
static public getServer ( array $servers ) : mixed
$servers array
리턴 mixed

get_age() 정적인 공개 메소드

用Unix时间戳计算是最准确的,但不太好处理1970年之前出生的情况 而且还要考虑闰年的问题,所以就暂时放弃这种方式的开发,保留思想
static public get_age ( integer $birth_year, integer $birth_month, integer $birth_date ) : integer
$birth_year integer
$birth_month integer
$birth_date integer
리턴 integer

get_animal() 정적인 공개 메소드

根据生日中的年份来计算所属生肖
static public get_animal ( integer $birth_year, $format = '1' ) : string
$birth_year integer
리턴 string

get_constellation() 정적인 공개 메소드

根据生日中的月份和日期来计算所属星座*
static public get_constellation ( integer $birth_month, integer $birth_date ) : string
$birth_month integer
$birth_date integer
리턴 string

howLongAgo() 정적인 공개 메소드

多久之前
static public howLongAgo ( $datetime ) : unknown_type
$datetime
리턴 unknown_type

httpExpire() 정적인 공개 메소드

static public httpExpire ( $lastModifyTime, $expire = 1800 )

num2han() 정적인 공개 메소드

数字转为汉字
static public num2han ( $num_str ) : mixed
$num_str
리턴 mixed

num2week() 정적인 공개 메소드

数字转星期
static public num2week ( $num, boolean $two = true ) : string
$num
$two boolean
리턴 string

readFile() 정적인 공개 메소드

加锁读取文件
static public readFile ( $file, boolean $exclusive = false ) : boolean | string
$file
$exclusive boolean
리턴 boolean | string

scandir() 정적인 공개 메소드

static public scandir ( $dir )

sendUDP() 정적인 공개 메소드

发送一个UDP包
static public sendUDP ( $server_ip, $server_port, $data, $timeout = 30 ) : unknown_type
리턴 unknown_type

showCost() 정적인 공개 메소드

static public showCost ( $func )

uri() 공개 정적인 메소드

解析URI
public static uri ( string $url ) : array
$url string
리턴 array $return

urlAppend() 정적인 공개 메소드

static public urlAppend ( $url, $array )

url_merge() 정적인 공개 메소드

URL合并
static public url_merge ( $key, $value, $ignore = null, $urls = null ) : string
$key
$value
$ignore
리턴 string

url_parse_into() 정적인 공개 메소드

URL解析到REQUEST
static public url_parse_into ( $url, &$request ) : unknown_type
$url
$request
리턴 unknown_type

프로퍼티 상세

$number 정적으로 공개적으로 프로퍼티

static public $number

$url_add_end 공개적으로 정적으로 프로퍼티

public static $url_add_end

$url_key_join 공개적으로 정적으로 프로퍼티

public static $url_key_join

$url_param_join 공개적으로 정적으로 프로퍼티

public static $url_param_join

$url_prefix 공개적으로 정적으로 프로퍼티

public static $url_prefix