Constants

APP_PATH

APP_PATH = __DIR__ . '/../application/'

EFFECTED_INIT

EFFECTED_INIT = 1

OS_TYPE_LINUX

OS_TYPE_LINUX = 'linux'

OS_TYPE_WINDOWS

OS_TYPE_WINDOWS = 'windows'

ROOT

ROOT = $_SERVER['DOCUMENT_ROOT']

TEST_PATH

TEST_PATH = __DIR__ . '/'

WORKERMAN_CONNECT_FAIL

WORKERMAN_CONNECT_FAIL = 1

WORKERMAN_SEND_FAIL

WORKERMAN_SEND_FAIL = 2

Functions

captcha()

captcha(string  $id = "", array  $config = array()) : \think\Response

Parameters

string $id
array $config

Returns

\think\Response

captcha_check()

captcha_check(  $value, string  $id = "", array  $config = array()) : boolean

Parameters

$value
string $id
array $config

Returns

boolean

captcha_img()

captcha_img(  $id = "") : mixed

Parameters

$id

Returns

mixed

captcha_src()

captcha_src(  $id = "") : string

Parameters

$id

Returns

string

class_basename()

class_basename(string|object  $class) : string

获取类名(不包含命名空间)

Parameters

string|object $class

Returns

string

class_uses_recursive()

class_uses_recursive(  $class) : array

获取一个类里所有用到的trait,包括父类的

Parameters

$class

Returns

array

classnames()

classnames() 

css样式名生成器 classnames("foo", "bar"); // => "foo bar" classnames("foo", [ "bar"=> true ]); // => "foo bar" classnames([ "foo-bar"=> true ]); // => "foo-bar" classnames([ "foo-bar"=> false ]); // => " classnames([ "foo" => true ], [ "bar"=> true ]); // => "foo bar" classnames([ "foo" => true, "bar"=> true ]); // => "foo bar" classnames("foo", [ "bar"=> true, "duck"=> false ], "baz", [ "quux"=> true ]); // => "foo bar baz quux" classnames(null, false, "bar", 0, 1, [ "baz"=> null ]); // => "bar 1"

composerRequire2bc4f313dba415539e266f7ac2c87dcd()

composerRequire2bc4f313dba415539e266f7ac2c87dcd(  $fileIdentifier,   $file) 

Parameters

$fileIdentifier
$file

createPassword()

createPassword(  $password,   $encrypt = '') 

Parameters

$password
$encrypt

createRandom()

createRandom(  $length,   $chars = '0123456789') 

Parameters

$length
$chars

createRandomStr()

createRandomStr(  $lenth = 6) 

Parameters

$lenth

delDir()

delDir(  $dirpath) 

Parameters

$dirpath

echo_menu()

echo_menu(  $menus) 

Parameters

$menus

is_admin()

is_admin(  $uid = null) : boolean

检测当前用户是否为超级管理员

Parameters

$uid

Returns

boolean —

true-管理员,false-非管理员

Is_Auth()

Is_Auth(  $Auth_Rule) : boolean

权限认证

Parameters

$Auth_Rule

Returns

boolean —

true-有权限,false-没有权限

load()

load(  $key) 

Parameters

$key

LogWirte()

LogWirte(  $field,   $Astring) 

Parameters

$field
$Astring

queue()

queue(  $job, string  $data = '', integer  $delay, null  $queue = null) 

添加到队列

Parameters

$job
string $data
integer $delay
null $queue

trait_uses_recursive()

trait_uses_recursive(string  $trait) : array

获取一个trait里所有引用到的trait

Parameters

string $trait

Returns

array