Constants

ADDON_PATH

ADDON_PATH = \ROOT_PATH . 'addons' . \DS

APP_PATH

APP_PATH = ROOT_PATH . 'application' . DIRECTORY_SEPARATOR

APP_PATH

APP_PATH = ROOT_PATH . 'application' . DIRECTORY_SEPARATOR

APP_PATH

APP_PATH = ROOT_PATH . 'application' . DIRECTORY_SEPARATOR

APP_PATH

APP_PATH = ROOT_PATH . 'application' . DIRECTORY_SEPARATOR

APP_PATH

APP_PATH = ROOT_PATH . 'application' . DIRECTORY_SEPARATOR

CACHE_EXPIRE_TIME

CACHE_EXPIRE_TIME = 3600

ENABLE_HTTP_PROXY

ENABLE_HTTP_PROXY = \false

FILTER_VALIDATE_BOOL

FILTER_VALIDATE_BOOL = \FILTER_VALIDATE_BOOLEAN

HTTP_PROXY_IP

HTTP_PROXY_IP = '127.0.0.1'

HTTP_PROXY_PORT

HTTP_PROXY_PORT = '8888'

IDNA_ALLOW_UNASSIGNED

IDNA_ALLOW_UNASSIGNED = 1

IDNA_ALLOW_UNASSIGNED

IDNA_ALLOW_UNASSIGNED = 1

IDNA_CHECK_BIDI

IDNA_CHECK_BIDI = 4

IDNA_CHECK_BIDI

IDNA_CHECK_BIDI = 4

IDNA_CHECK_CONTEXTJ

IDNA_CHECK_CONTEXTJ = 8

IDNA_CHECK_CONTEXTJ

IDNA_CHECK_CONTEXTJ = 8

IDNA_DEFAULT

IDNA_DEFAULT = 0

IDNA_DEFAULT

IDNA_DEFAULT = 0

IDNA_ERROR_BIDI

IDNA_ERROR_BIDI = 2048

IDNA_ERROR_BIDI

IDNA_ERROR_BIDI = 2048

IDNA_ERROR_CONTEXTJ

IDNA_ERROR_CONTEXTJ = 4096

IDNA_ERROR_CONTEXTJ

IDNA_ERROR_CONTEXTJ = 4096

IDNA_ERROR_DISALLOWED

IDNA_ERROR_DISALLOWED = 128

IDNA_ERROR_DISALLOWED

IDNA_ERROR_DISALLOWED = 128

IDNA_ERROR_DOMAIN_NAME_TOO_LONG

IDNA_ERROR_DOMAIN_NAME_TOO_LONG = 4

IDNA_ERROR_DOMAIN_NAME_TOO_LONG

IDNA_ERROR_DOMAIN_NAME_TOO_LONG = 4

IDNA_ERROR_EMPTY_LABEL

IDNA_ERROR_EMPTY_LABEL = 1

IDNA_ERROR_EMPTY_LABEL

IDNA_ERROR_EMPTY_LABEL = 1

IDNA_ERROR_HYPHEN_3_4

IDNA_ERROR_HYPHEN_3_4 = 32

IDNA_ERROR_HYPHEN_3_4

IDNA_ERROR_HYPHEN_3_4 = 32

IDNA_ERROR_INVALID_ACE_LABEL

IDNA_ERROR_INVALID_ACE_LABEL = 1024

IDNA_ERROR_INVALID_ACE_LABEL

IDNA_ERROR_INVALID_ACE_LABEL = 1024

IDNA_ERROR_LABEL_HAS_DOT

IDNA_ERROR_LABEL_HAS_DOT = 512

IDNA_ERROR_LABEL_HAS_DOT

IDNA_ERROR_LABEL_HAS_DOT = 512

IDNA_ERROR_LABEL_TOO_LONG

IDNA_ERROR_LABEL_TOO_LONG = 2

IDNA_ERROR_LABEL_TOO_LONG

IDNA_ERROR_LABEL_TOO_LONG = 2

IDNA_ERROR_LEADING_COMBINING_MARK

IDNA_ERROR_LEADING_COMBINING_MARK = 64

IDNA_ERROR_LEADING_COMBINING_MARK

IDNA_ERROR_LEADING_COMBINING_MARK = 64

IDNA_ERROR_LEADING_HYPHEN

IDNA_ERROR_LEADING_HYPHEN = 8

IDNA_ERROR_LEADING_HYPHEN

IDNA_ERROR_LEADING_HYPHEN = 8

IDNA_ERROR_PUNYCODE

IDNA_ERROR_PUNYCODE = 256

IDNA_ERROR_PUNYCODE

IDNA_ERROR_PUNYCODE = 256

IDNA_ERROR_TRAILING_HYPHEN

IDNA_ERROR_TRAILING_HYPHEN = 16

IDNA_ERROR_TRAILING_HYPHEN

IDNA_ERROR_TRAILING_HYPHEN = 16

IDNA_NONTRANSITIONAL_TO_ASCII

IDNA_NONTRANSITIONAL_TO_ASCII = 16

IDNA_NONTRANSITIONAL_TO_ASCII

IDNA_NONTRANSITIONAL_TO_ASCII = 16

IDNA_NONTRANSITIONAL_TO_UNICODE

IDNA_NONTRANSITIONAL_TO_UNICODE = 32

IDNA_NONTRANSITIONAL_TO_UNICODE

IDNA_NONTRANSITIONAL_TO_UNICODE = 32

IDNA_USE_STD3_RULES

IDNA_USE_STD3_RULES = 2

IDNA_USE_STD3_RULES

IDNA_USE_STD3_RULES = 2

IF_PUBLIC

IF_PUBLIC = true

IN_ADMIN

IN_ADMIN = true

INSTALL_PATH

INSTALL_PATH = APP_PATH . 'admin' . DS . 'command' . DS . 'Install' . DS

INTL_IDNA_VARIANT_2003

INTL_IDNA_VARIANT_2003 = 0

INTL_IDNA_VARIANT_UTS46

INTL_IDNA_VARIANT_UTS46 = 1

INTL_IDNA_VARIANT_UTS46

INTL_IDNA_VARIANT_UTS46 = 1

IS_ROOT

IS_ROOT = $this->auth->isAdministrator()

LOCATION_SERVICE_DESCRIBE_ENDPOINT_ACTION

LOCATION_SERVICE_DESCRIBE_ENDPOINT_ACTION = "DescribeEndpoints"

LOCATION_SERVICE_DOMAIN

LOCATION_SERVICE_DOMAIN = "location.aliyuncs.com"

LOCATION_SERVICE_PRODUCT_NAME

LOCATION_SERVICE_PRODUCT_NAME = "Location"

LOCATION_SERVICE_REGION

LOCATION_SERVICE_REGION = "cn-hangzhou"

LOCATION_SERVICE_VERSION

LOCATION_SERVICE_VERSION = "2015-06-12"

MB_CASE_LOWER

MB_CASE_LOWER = 1

MB_CASE_LOWER

MB_CASE_LOWER = 1

MB_CASE_TITLE

MB_CASE_TITLE = 2

MB_CASE_TITLE

MB_CASE_TITLE = 2

MB_CASE_UPPER

MB_CASE_UPPER = 0

MB_CASE_UPPER

MB_CASE_UPPER = 0

OS_TYPE_LINUX

OS_TYPE_LINUX = 'linux'

OS_TYPE_WINDOWS

OS_TYPE_WINDOWS = 'windows'

PHP_FLOAT_DIG

PHP_FLOAT_DIG = 15

PHP_FLOAT_EPSILON

PHP_FLOAT_EPSILON = 2.2204460492503E-16

PHP_FLOAT_MAX

PHP_FLOAT_MAX = 1.7976931348623157E+308

PHP_FLOAT_MIN

PHP_FLOAT_MIN = 2.2250738585072E-308

PHP_OS_FAMILY

PHP_OS_FAMILY = \Symfony\Polyfill\Php72\Php72::php_os_family()

PINYIN_ASCII_TONE

PINYIN_ASCII_TONE = 8

PINYIN_DEFAULT

PINYIN_DEFAULT = 4096

PINYIN_KEEP_ENGLISH

PINYIN_KEEP_ENGLISH = 64

PINYIN_KEEP_NUMBER

PINYIN_KEEP_NUMBER = 32

PINYIN_KEEP_PUNCTUATION

PINYIN_KEEP_PUNCTUATION = 256

PINYIN_NAME

PINYIN_NAME = 16

PINYIN_NO_TONE

PINYIN_NO_TONE = 4

PINYIN_TONE

PINYIN_TONE = 2

PINYIN_UMLAUT_V

PINYIN_UMLAUT_V = 128

QINIU_FUNCTIONS_VERSION

QINIU_FUNCTIONS_VERSION = \Qiniu\Config::SDK_VER

ROOT_PATH

ROOT_PATH = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR

ROOT_PATH

ROOT_PATH = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR

ROOT_PATH

ROOT_PATH = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR

ROOT_PATH

ROOT_PATH = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR

ROOT_PATH

ROOT_PATH = __DIR__ . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR

ROOT_URL

ROOT_URL = \think\facade\Request::rootUrl() . '/'

TEMPLATE_PATH

TEMPLATE_PATH = \ROOT_PATH . 'templates' . \DS

TEST_PATH

TEST_PATH = __DIR__ . '/'

U_IDNA_ACE_PREFIX_ERROR

U_IDNA_ACE_PREFIX_ERROR = 66564

U_IDNA_ACE_PREFIX_ERROR

U_IDNA_ACE_PREFIX_ERROR = 66564

U_IDNA_CHECK_BIDI_ERROR

U_IDNA_CHECK_BIDI_ERROR = 66562

U_IDNA_CHECK_BIDI_ERROR

U_IDNA_CHECK_BIDI_ERROR = 66562

U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR

U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR = 66568

U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR

U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR = 66568

U_IDNA_ERROR_LIMIT

U_IDNA_ERROR_LIMIT = 66569

U_IDNA_ERROR_LIMIT

U_IDNA_ERROR_LIMIT = 66569

U_IDNA_ERROR_START

U_IDNA_ERROR_START = 66560

U_IDNA_ERROR_START

U_IDNA_ERROR_START = 66560

U_IDNA_LABEL_TOO_LONG_ERROR

U_IDNA_LABEL_TOO_LONG_ERROR = 66566

U_IDNA_LABEL_TOO_LONG_ERROR

U_IDNA_LABEL_TOO_LONG_ERROR = 66566

U_IDNA_PROHIBITED_ERROR

U_IDNA_PROHIBITED_ERROR = 66560

U_IDNA_PROHIBITED_ERROR

U_IDNA_PROHIBITED_ERROR = 66560

U_IDNA_STD3_ASCII_RULES_ERROR

U_IDNA_STD3_ASCII_RULES_ERROR = 66563

U_IDNA_STD3_ASCII_RULES_ERROR

U_IDNA_STD3_ASCII_RULES_ERROR = 66563

U_IDNA_UNASSIGNED_ERROR

U_IDNA_UNASSIGNED_ERROR = 66561

U_IDNA_UNASSIGNED_ERROR

U_IDNA_UNASSIGNED_ERROR = 66561

U_IDNA_VERIFICATION_ERROR

U_IDNA_VERIFICATION_ERROR = 66565

U_IDNA_VERIFICATION_ERROR

U_IDNA_VERIFICATION_ERROR = 66565

U_IDNA_ZERO_LENGTH_LABEL_ERROR

U_IDNA_ZERO_LENGTH_LABEL_ERROR = 66567

U_IDNA_ZERO_LENGTH_LABEL_ERROR

U_IDNA_ZERO_LENGTH_LABEL_ERROR = 66567

U_STRINGPREP_CHECK_BIDI_ERROR

U_STRINGPREP_CHECK_BIDI_ERROR = 66562

U_STRINGPREP_CHECK_BIDI_ERROR

U_STRINGPREP_CHECK_BIDI_ERROR = 66562

U_STRINGPREP_PROHIBITED_ERROR

U_STRINGPREP_PROHIBITED_ERROR = 66560

U_STRINGPREP_PROHIBITED_ERROR

U_STRINGPREP_PROHIBITED_ERROR = 66560

U_STRINGPREP_UNASSIGNED_ERROR

U_STRINGPREP_UNASSIGNED_ERROR = 66561

U_STRINGPREP_UNASSIGNED_ERROR

U_STRINGPREP_UNASSIGNED_ERROR = 66561

UID

UID = (int) $this->auth->id

WORKERMAN_CONNECT_FAIL

WORKERMAN_CONNECT_FAIL = 1

WORKERMAN_SEND_FAIL

WORKERMAN_SEND_FAIL = 2

Functions

abort()

abort(int|\Response  $code, string  $message = null, array  $header = []) : mixed

抛出HTTP异常

Parameters

int|\Response $code

状态码 或者 Response对象实例

string $message

错误信息

array $header

参数

Returns

mixed —

action()

action(string  $url, string|array  $vars = [], string  $layer = 'controller', bool  $appendSuffix = false) : mixed

调用模块的操作方法 参数格式 [模块/控制器/]操作

Parameters

string $url

调用地址

string|array $vars

调用参数 支持字符串和数组

string $layer

要调用的控制层名称

bool $appendSuffix

是否添加类名后缀

Returns

mixed —

addon_url()

addon_url(string  $url, array  $vars = [], bool|string  $suffix = true, bool|string  $domain = false) : bool|string

插件显示内容里生成访问插件的url

Parameters

string $url

地址 格式:插件名/控制器/方法

array $vars

变量参数

bool|string $suffix

生成的URL后缀

bool|string $domain

域名

Returns

bool|string —

app()

app(string  $name = 'think\App', array  $args = [], bool  $newInstance = false) : mixed|\think\App

快速获取容器中的实例 支持依赖注入

Parameters

string $name

类名或标识 默认获取当前应用实例

array $args

参数

bool $newInstance

是否每次创建新的实例

Returns

mixed|\think\App —

arr2str()

arr2str(array  $arr, string  $glue = ',') : string

数组转换为字符串,主要用于把分隔符调整到第二个参数

Parameters

array $arr

要连接的数组

string $glue

分割符

Returns

string —

arraycopy()

arraycopy(mixed  $srcArray, mixed  $srcPos, mixed  $destArray, mixed  $destPos, mixed  $length) : mixed

Parameters

mixed $srcArray
mixed $srcPos
mixed $destArray
mixed $destPos
mixed $length

Returns

mixed —

arraySearchField()

arraySearchField(mixed  $array, mixed  $id, string  $field = "title") : void

搜索二位数组id返回指定字段

Parameters

mixed $array
mixed $id
string $field

返回字段

behavior()

behavior(mixed  $behavior, mixed  $args = null) : mixed

执行某个行为(run方法) 支持依赖注入

Parameters

mixed $behavior

行为类名或者别名

mixed $args

参数

Returns

mixed —

bind()

bind(string  $abstract, mixed  $concrete = null) : \Container

绑定一个类到容器

Parameters

string $abstract

类标识、接口

mixed $concrete

要绑定的类、闭包或者实例

Returns

\Container —

build_suffix_image()

build_suffix_image(string  $suffix, null  $background = null) : string

生成文件后缀图片

Parameters

string $suffix

后缀

null $background

Returns

string —

buildCatUrl()

buildCatUrl(mixed  $cat, mixed  $url = '', mixed  $suffix = true, mixed  $domain = false) : mixed

生成栏目URL

Parameters

mixed $cat
mixed $url
mixed $suffix
mixed $domain

Returns

mixed —

buildContentUrl()

buildContentUrl(mixed  $cat, mixed  $id, mixed  $url = '', mixed  $suffix = true, mixed  $domain = false) : mixed

Parameters

mixed $cat
mixed $id
mixed $url
mixed $suffix
mixed $domain

Returns

mixed —

cache()

cache(mixed  $name, mixed  $value = '', mixed  $options = null) : mixed

系统缓存缓存管理 cache('model') 获取model缓存 cache('model',null) 删除model缓存

Parameters

mixed $name

缓存名称

mixed $value

缓存值

mixed $options

缓存参数

Returns

mixed —

cache()

cache(mixed  $name, mixed  $value = '', mixed  $options = null, string  $tag = null) : mixed

缓存管理

Parameters

mixed $name

缓存名称,如果为数组表示进行缓存设置

mixed $value

缓存值

mixed $options

缓存参数

string $tag

缓存标签

Returns

mixed —

call()

call(mixed  $callable, array  $args = []) : mixed

调用反射执行callable 支持依赖注入

Parameters

mixed $callable

支持闭包等callable写法

array $args

参数

Returns

mixed —

callcache()

callcache(mixed  $name, callable|null  $callback = null) : void

缓存闭包函数

Parameters

mixed $name
callable|null $callback

captcha()

captcha(string  $config = null) : \think\Response

Parameters

string $config

Returns

\think\Response —

captcha_check()

captcha_check(string  $value) : bool

Parameters

string $value

Returns

bool —

captcha_img()

captcha_img( $id = '', mixed  $domid = '') : mixed

Parameters

$id
mixed $domid

Returns

mixed —

captcha_src()

captcha_src( $config = null) : string

Parameters

$config

Returns

string —

catpos()

catpos( $catid, mixed  $title,  $symbol = ' > ') : mixed

当前路径 返回指定栏目路径层级

Parameters

$catid

栏目id

mixed $title
$symbol

栏目间隔符

Returns

mixed —

cdnurl()

cdnurl(string  $url, bool  $domain = false) : string

获取上传资源的CDN的地址

Parameters

string $url

资源相对地址

bool $domain

是否显示域名 或者直接传入域名

Returns

string —

check_cors_request()

check_cors_request() : mixed

跨域检测

Returns

mixed —

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 —

classLoader()

classLoader(mixed  $class) : mixed

Parameters

mixed $class

Returns

mixed —

classLoader()

classLoader(mixed  $class) : mixed

Parameters

mixed $class

Returns

mixed —

collect()

collect(mixed  $value = null) : \Collection

Create a collection from the given value.

Parameters

mixed $value

Returns

\Collection —

composerRequire7e4001803221d40018da1f3864421aa3()

composerRequire7e4001803221d40018da1f3864421aa3(string  $fileIdentifier, string  $file) : void

Parameters

string $fileIdentifier
string $file

config()

config(string|array  $name = '', mixed  $value = null) : mixed

获取和设置配置参数

Parameters

string|array $name

参数名

mixed $value

参数值

Returns

mixed —

console()

console() : void

控制台输出

container()

container() : \Container

获取容器对象实例

Returns

\Container —

controller()

controller(string  $name, string  $layer = 'controller', bool  $appendSuffix = false) : \think\Controller

实例化控制器 格式:[模块/]控制器

Parameters

string $name

资源地址

string $layer

控制层名称

bool $appendSuffix

是否添加类名后缀

Returns

\think\Controller —

cookie()

cookie(string|array  $name, mixed  $value = '', mixed  $option = null) : mixed

Cookie管理

Parameters

string|array $name

cookie名称,如果为数组表示进行cookie设置

mixed $value

cookie值

mixed $option

参数

Returns

mixed —

copyObject()

copyObject(\OssClient  $ossClient, string  $bucket) : null

Copy object When the source object is same as the target one, copy operation will just update the metadata.

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

createBucket()

createBucket(\OssClient  $ossClient, string  $bucket) : null

Create a new bucket acl indicates the access permission of a bucket, including: private, public-read-only/private-read-write, and public read-write.

Private indicates that only the bucket owner or authorized users can access the data.. The three permissions are separately defined by (OssClient::OSS_ACL_TYPE_PRIVATE,OssClient::OSS_ACL_TYPE_PUBLIC_READ, OssClient::OSS_ACL_TYPE_PUBLIC_READ_WRITE)

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

Name of the bucket to create

Returns

null —

createObjectDir()

createObjectDir(\OssClient  $ossClient, string  $bucket) : null

Create a 'virtual' folder

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

ctype_alnum()

ctype_alnum(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_alnum()

ctype_alnum(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

ctype_alpha()

ctype_alpha(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_alpha()

ctype_alpha(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

ctype_cntrl()

ctype_cntrl(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_cntrl()

ctype_cntrl(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

ctype_digit()

ctype_digit(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_digit()

ctype_digit(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

ctype_graph()

ctype_graph(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_graph()

ctype_graph(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

ctype_lower()

ctype_lower(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_lower()

ctype_lower(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

ctype_print()

ctype_print(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_print()

ctype_print(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

ctype_punct()

ctype_punct(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_punct()

ctype_punct(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

ctype_space()

ctype_space(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_space()

ctype_space(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

ctype_upper()

ctype_upper(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_upper()

ctype_upper(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

ctype_xdigit()

ctype_xdigit(mixed  $text) : mixed

Parameters

mixed $text

Returns

mixed —

ctype_xdigit()

ctype_xdigit(mixed  $text) : bool

Parameters

mixed $text

Returns

bool —

data_fill()

data_fill(mixed  $target, string|array  $key, mixed  $value) : mixed

Fill in data where it's missing.

Parameters

mixed $target
string|array $key
mixed $value

Returns

mixed —

data_get()

data_get(mixed  $target, string|array|int  $key, mixed  $default = null) : mixed

Get an item from an array or object using "dot" notation.

Parameters

mixed $target
string|array|int $key
mixed $default

Returns

mixed —

data_set()

data_set(mixed  $target, string|array  $key, mixed  $value, bool  $overwrite = true) : mixed

Set an item on an array or object using dot notation.

Parameters

mixed $target
string|array $key
mixed $value
bool $overwrite

Returns

mixed —

db()

db(string  $name = '', array|string  $config = [], bool  $force = true) : \think\db\Query

实例化数据库类

Parameters

string $name

操作的数据表名称(不含前缀)

array|string $config

数据库配置参数

bool $force

是否强制重新连接

Returns

\think\db\Query —

debug()

debug(string  $start, string  $end = '', int|string  $dec = 6) : mixed

记录时间(微秒)和内存使用情况

Parameters

string $start

开始标签

string $end

结束标签

int|string $dec

小数位 如果是m 表示统计内存占用

Returns

mixed —

deleteBucket()

deleteBucket(\OssClient  $ossClient, string  $bucket) : null

Delete a bucket. If the bucket is not empty, the deletion fails.

A bucket which is not empty indicates that it does not contain any objects or parts that are not completely uploaded during multipart upload

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

Name of the bucket to delete

Returns

null —

deleteBucketCors()

deleteBucketCors(\OssClient  $ossClient, string  $bucket) : null

Delete all cors configuraiton of a bucket

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

deleteBucketLifecycle()

deleteBucketLifecycle(\OssClient  $ossClient, string  $bucket) : null

Delete bucket lifecycle configuration

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

deleteBucketLogging()

deleteBucketLogging(\OssClient  $ossClient, string  $bucket) : null

Delete bucket logging configuration

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

deleteBucketReferer()

deleteBucketReferer(\OssClient  $ossClient, string  $bucket) : null

Delete bucket referer configuration Referer whitelist cannot be directly deleted. So use a empty one to overwrite it.

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

deleteBucketWebsite()

deleteBucketWebsite(\OssClient  $ossClient, string  $bucket) : null

Delete bucket static website configuration

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

deleteObject()

deleteObject(\OssClient  $ossClient, string  $bucket) : null

Delete an object

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

deleteObjects()

deleteObjects(\OssClient  $ossClient, string  $bucket) : null

Delete multiple objects in batch

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

doesBucketExist()

doesBucketExist(\OssClient  $ossClient, string  $bucket) : mixed

Check whether a bucket exists.

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

mixed —

doesObjectExist()

doesObjectExist(\OssClient  $ossClient, string  $bucket) : null

Check whether an object exists

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

download()

download(string  $filename, string  $name = '', bool  $content = false, int  $expire = 360, mixed  $openinBrowser = false) : \think\response\Download

获取\think\response\Download对象实例

Parameters

string $filename

要下载的文件

string $name

显示文件名

bool $content

是否为内容

int $expire

有效期(秒)

mixed $openinBrowser

Returns

\think\response\Download —

dump()

dump(mixed  $var, bool  $echo = true, string  $label = null) : void|string

浏览器友好的变量输出

Parameters

mixed $var

变量

bool $echo

是否输出 默认为true 如果为false 则返回输出字符串

string $label

标签 默认为空

Returns

void|string —

encrypt_password()

encrypt_password( $password,  $encrypt = '') : mixed

对用户的密码进行加密

Parameters

$password
$encrypt

//传入加密串,在修改密码时做认证

Returns

mixed —

env()

env(string  $name = null, string  $default = null) : mixed

获取环境变量值

Parameters

string $name

环境变量名(支持二级 .号分割)

string $default

默认值

Returns

mixed —

exception()

exception(string  $msg, int  $code, string  $exception = '') : mixed

抛出异常处理

Parameters

string $msg

异常消息

int $code

异常代码 默认为0

string $exception

异常类

Throws

\Exception

Returns

mixed —

fdiv()

fdiv(float  $num1, float  $num2) : float

Parameters

float $num1
float $num2

Returns

float —

fill_array()

fill_array(mixed  $index, mixed  $count, mixed  $value) : mixed

Parameters

mixed $index
mixed $count
mixed $value

Returns

mixed —

filters()

filters(mixed  $modelid, mixed  $catid) : mixed

生成分类信息中的筛选菜单

Parameters

mixed $modelid
mixed $catid

Returns

mixed —

floatToIntBits()

floatToIntBits(mixed  $float_val) : mixed

Parameters

mixed $float_val

Returns

mixed —

format_bytes()

format_bytes(\number  $size, string  $delimiter = '') : string

格式化字节大小

Parameters

\number $size

字节数

string $delimiter

数字和单位分隔符

Returns

string —

格式化后的带单位的大小

fun()

fun(mixed  $fun) : mixed

加载其他模块函数

Parameters

mixed $fun

Returns

mixed —

genRandomString()

genRandomString(\type  $len = 6) : string

产生一个指定长度的随机字符串,并返回给用户

Parameters

\type $len

产生字符串的长度

Returns

string —

随机字符串

get_addon_autoload_config()

get_addon_autoload_config(bool  $truncate = false) : array

获得插件自动加载的配置.

Parameters

bool $truncate

是否清除手动配置的钩子

Returns

array —

get_addon_class()

get_addon_class( $name, string  $type = 'hook', string  $class = null) : string

获取插件类的类名

Parameters

$name

插件名

string $type

返回命名空间类型

string $class

当前类名

Returns

string —

get_addon_config()

get_addon_config(string  $name) : array

获取插件类的配置值值

Parameters

string $name

插件名

Returns

array —

get_addon_fullconfig()

get_addon_fullconfig(string  $name) : array

获取插件类的配置数组.

Parameters

string $name

插件名

Returns

array —

get_addon_info()

get_addon_info(string  $name) : array

读取插件的基础信息

Parameters

string $name

插件名

Returns

array —

get_addon_instance()

get_addon_instance( $name) : mixed|null

获取插件的单例

Parameters

$name

Returns

mixed|null —

get_addon_list()

get_addon_list() : array

获得插件列表

Returns

array —

get_addon_tables()

get_addon_tables(string  $name) : array

获取插件创建的表

Parameters

string $name

插件名

Returns

array —

get_banner_description()

get_banner_description( $parentid,  $description = '') : mixed|string

获取banner简介

Parameters

$parentid
$description

Returns

mixed|string —

get_banner_image()

get_banner_image( $parentid,  $image = '') : bool|int|mixed|string

获取banner图片

Parameters

$parentid
$image

Returns

bool|int|mixed|string —

get_banner_title()

get_banner_title( $parentid,  $title = '') : bool|int|mixed|string

banner标题

Parameters

$parentid
$title

Returns

bool|int|mixed|string —

get_debug_type()

get_debug_type(mixed  $value) : string

Parameters

mixed $value

Returns

string —

get_filters_field()

get_filters_field(mixed  $modelid) : mixed

Parameters

mixed $modelid

Returns

mixed —

get_resource_id()

get_resource_id(mixed  $resource) : int

Parameters

mixed $resource

Returns

int —

getallheaders()

getallheaders() : mixed

Get all HTTP header key/values as an associative array for the current request.

Returns

mixed —

getBucketAcl()

getBucketAcl(\OssClient  $ossClient, string  $bucket) : null

Get bucket ACL

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

getBucketCors()

getBucketCors(\OssClient  $ossClient, string  $bucket) : null

Get and print the cors configuration of a bucket

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

getBucketLifecycle()

getBucketLifecycle(\OssClient  $ossClient, string  $bucket) : null

Get bucket lifecycle configuration

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

getBucketLogging()

getBucketLogging(\OssClient  $ossClient, string  $bucket) : null

Get bucket logging configuration

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

getBucketReferer()

getBucketReferer(\OssClient  $ossClient, string  $bucket) : null

Get bucket referer configuration

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

getBucketWebsite()

getBucketWebsite(\OssClient  $ossClient, string  $bucket) : null

Get bucket static website configuration

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

getCategory()

getCategory(mixed  $cat, mixed  $fields = '', \type  $newCache = false) : bool

获取栏目相关信息

Parameters

mixed $cat
mixed $fields
\type $newCache

是否强制刷新

Returns

bool —

getCatid()

getCatid( $catdir) : mixed

标识获取id

Parameters

$catdir

Returns

mixed —

getLevelId()

getLevelId(mixed  $arrparentid, int  $level) : void

级别获取id

Parameters

mixed $arrparentid
int $level

getListOrder()

getListOrder( $catid) : mixed|string

配置列表页全局配许

Parameters

$catid

Returns

mixed|string —

getModel()

getModel(\type  $modelid, \type  $name = '') : bool

获取模型数据

Parameters

\type $modelid

模型ID

\type $name

返回的字段,默认返回全部,数组

Returns

bool —

getObject()

getObject(\OssClient  $ossClient, string  $bucket) : null

Get the content of an object.

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

getObjectMeta()

getObjectMeta(\OssClient  $ossClient, string  $bucket) : null

Get object meta, that is, getObjectMeta

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

getObjectToLocalFile()

getObjectToLocalFile(\OssClient  $ossClient, string  $bucket) : null

Get_object_to_local_file

Get object Download object to a specified file.

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

getshowdir()

getshowdir(mixed  $id, mixed  $cat) : mixed

Parameters

mixed $id
mixed $cat

Returns

mixed —

getSignedUrlForGettingObject()

getSignedUrlForGettingObject( $ossClient,  $bucket) : null

Generate the signed url for getObject() to control read accesses under private privilege

Parameters

$ossClient

OssClient OssClient instance

$bucket

string bucket name

Returns

null —

getSignedUrlForPuttingObject()

getSignedUrlForPuttingObject(\OssClient  $ossClient, string  $bucket) : null

Generate the signed url for PutObject to control write accesses under private privilege.

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Throws

\OssException

Returns

null —

getSignedUrlForPuttingObjectFromFile()

getSignedUrlForPuttingObjectFromFile(\OssClient  $ossClient, string  $bucket) : mixed

Generate the signed url for PutObject's signed url. User could use the signed url to upload file directly.

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Throws

\OssException

Returns

mixed —

getSymlink()

getSymlink(\OssClient  $ossClient, string  $bucket) : null

Get symlink

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

halt()

halt(mixed  $var) : mixed

调试变量并且中断输出

Parameters

mixed $var

调试变量或者信息

Returns

mixed —

hashCode()

hashCode(mixed  $s) : mixed

Parameters

mixed $s

Returns

mixed —

hook()

hook(string  $hook, mixed  $params = [], bool  $is_return = false, bool  $once = false) : void

处理插件钩子

Parameters

string $hook

钩子名称

mixed $params

传入参数

bool $is_return

是否返回(true:返回值,false:直接输入)

bool $once

只获取一个有效返回值

hsv2rgb()

hsv2rgb(mixed  $h, mixed  $s, mixed  $v) : mixed

Parameters

mixed $h
mixed $s
mixed $v

Returns

mixed —

http_down()

http_down(string  $url, string  $filename = "", int  $timeout = 60) : string

下载远程文件,默认保存在temp下

Parameters

string $url

网址

string $filename

保存文件名

int $timeout

过期时间

Returns

string —

本地文件名

human_date()

human_date(int  $time, int  $local = null) : string

获取语义化时间

Parameters

int $time

时间

int $local

本地时间

Returns

string —

hypo()

hypo(mixed  $a, mixed  $b) : float

Pythagorean Theorem:.

a = 3 b = 4 r = sqrt(square(a) + square(b)) r = 5

r = sqrt(a^2 + b^2) without under/overflow.

Parameters

mixed $a
mixed $b

Returns

float —

idn_to_ascii()

idn_to_ascii(mixed  $domain, mixed  $flags, mixed  $variant = INTL_IDNA_VARIANT_UTS46, mixed  $idna_info = null) : mixed

Parameters

mixed $domain
mixed $flags
mixed $variant
mixed $idna_info

Returns

mixed —

idn_to_ascii()

idn_to_ascii(?string  $domain, ?int  $flags = IDNA_DEFAULT, ?int  $variant = INTL_IDNA_VARIANT_UTS46, mixed  $idna_info = null) : string|false

Parameters

?string $domain
?int $flags
?int $variant
mixed $idna_info

Returns

string|false —

idn_to_utf8()

idn_to_utf8(mixed  $domain, mixed  $flags, mixed  $variant = INTL_IDNA_VARIANT_UTS46, mixed  $idna_info = null) : mixed

Parameters

mixed $domain
mixed $flags
mixed $variant
mixed $idna_info

Returns

mixed —

idn_to_utf8()

idn_to_utf8(?string  $domain, ?int  $flags = IDNA_DEFAULT, ?int  $variant = INTL_IDNA_VARIANT_UTS46, mixed  $idna_info = null) : string|false

Parameters

?string $domain
?int $flags
?int $variant
mixed $idna_info

Returns

string|false —

imageantialias()

imageantialias(mixed  ...$args) : mixed

Parameters

mixed $args variadic

Returns

mixed —

input()

input(string  $key = '', mixed  $default = null, string  $filter = '') : mixed

获取输入数据 支持默认值和过滤

Parameters

string $key

获取的变量名

mixed $default

默认值

string $filter

过滤方法

Returns

mixed —

int_to_string()

int_to_string(mixed  $data, array  $map = array('status' => array(1 => '正常', -1 => '删除', 0 => '禁用', 2 => '未审核', 3 => '草稿'))) : array

select返回的数组进行整数映射转换

Parameters

mixed $data
array $map

映射关系二维数组 array( '字段名1'=>array(映射关系数组), '字段名2'=>array(映射关系数组), ...... )

Returns

array —

array( array('id'=>1,'title'=>'标题','status'=>'1','status_text'=>'正常') .... )

intval32bits()

intval32bits(mixed  $value) : mixed

Parameters

mixed $value

Returns

mixed —

isChina()

isChina() : bool

判断ip是否是中国

Returns

bool —

json()

json(mixed  $data = [], int  $code = 200, array  $header = [], array  $options = []) : \think\response\Json

获取\think\response\Json对象实例

Parameters

mixed $data

返回的数据

int $code

状态码

array $header

头部

array $options

参数

Returns

\think\response\Json —

jsonp()

jsonp(mixed  $data = [], int  $code = 200, array  $header = [], array  $options = []) : \think\response\Jsonp

获取\think\response\Jsonp对象实例

Parameters

mixed $data

返回的数据

int $code

状态码

array $header

头部

array $options

参数

Returns

\think\response\Jsonp —

lang()

lang(string  $name, array  $vars = [], string  $lang = '') : mixed

获取语言变量值

Parameters

string $name

语言变量名

array $vars

动态变量值

string $lang

语言

Returns

mixed —

letter_avatar()

letter_avatar( $text) : string

首字母头像

Parameters

$text

Returns

string —

list_sort_by()

list_sort_by(array  $list, string  $field, array  $sortby = 'asc') : array

对查询结果集进行排序

Parameters

array $list

查询结果

string $field

排序的字段名

array $sortby

排序类型 asc正向排序 desc逆向排序 nat自然排序

Returns

array —

list_to_tree()

list_to_tree(array  $list, mixed  $pk = 'id', string  $pid = 'parentid', mixed  $child = '_child', mixed  $root) : array

把返回的数据集转换成Tree

Parameters

array $list

要转换的数据集

mixed $pk
string $pid

parent标记字段

mixed $child
mixed $root

Returns

array —

listAllObjects()

listAllObjects(\OssClient  $ossClient, string  $bucket) : null

Lists all folders and files under the bucket. Use nextMarker repeatedly to get all objects.

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

listBuckets()

listBuckets(\OssClient  $ossClient) : null

List all buckets

Parameters

\OssClient $ossClient

OssClient instance

Returns

null —

listMultipartUploads()

listMultipartUploads( $ossClient,  $bucket) : mixed

Get ongoing multipart uploads

Parameters

$ossClient

OssClient

$bucket

string

Returns

mixed —

listObjects()

listObjects(\OssClient  $ossClient, string  $bucket) : null

Lists all files and folders in the bucket.

Note if there's more items than the max-keys specified, the caller needs to use the nextMarker returned as the value for the next call's maker paramter. Loop through all the items returned from ListObjects.

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

mb_check_encoding()

mb_check_encoding(mixed  $value = null, mixed  $encoding = null) : mixed

Parameters

mixed $value
mixed $encoding

Returns

mixed —

mb_check_encoding()

mb_check_encoding(array|string|null  $value = null, ?string  $encoding = null) : bool

Parameters

array|string|null $value
?string $encoding

Returns

bool —

mb_chr()

mb_chr(mixed  $codepoint, mixed  $encoding = null) : mixed

Parameters

mixed $codepoint
mixed $encoding

Returns

mixed —

mb_chr()

mb_chr(?int  $codepoint, ?string  $encoding = null) : string|false

Parameters

?int $codepoint
?string $encoding

Returns

string|false —

mb_chr()

mb_chr(mixed  $codepoint, mixed  $encoding = null) : mixed

Parameters

mixed $codepoint
mixed $encoding

Returns

mixed —

mb_convert_case()

mb_convert_case(mixed  $string, mixed  $mode, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $mode
mixed $encoding

Returns

mixed —

mb_convert_case()

mb_convert_case(?string  $string, ?int  $mode, ?string  $encoding = null) : string

Parameters

?string $string
?int $mode
?string $encoding

Returns

string —

mb_convert_encoding()

mb_convert_encoding(mixed  $string, mixed  $to_encoding, mixed  $from_encoding = null) : mixed

Parameters

mixed $string
mixed $to_encoding
mixed $from_encoding

Returns

mixed —

mb_convert_encoding()

mb_convert_encoding(array|string|null  $string, ?string  $to_encoding, array|string|null  $from_encoding = null) : array|string|false

Parameters

array|string|null $string
?string $to_encoding
array|string|null $from_encoding

Returns

array|string|false —

mb_convert_variables()

mb_convert_variables(mixed  $to_encoding, mixed  $from_encoding, mixed  ...$vars) : mixed

Parameters

mixed $to_encoding
mixed $from_encoding
mixed $vars variadic

Returns

mixed —

mb_convert_variables()

mb_convert_variables(?string  $to_encoding, array|string|null  $from_encoding, mixed  $var, mixed  ...$vars) : string|false

Parameters

?string $to_encoding
array|string|null $from_encoding
mixed $var
mixed $vars variadic

Returns

string|false —

mb_decode_mimeheader()

mb_decode_mimeheader(mixed  $string) : mixed

Parameters

mixed $string

Returns

mixed —

mb_decode_mimeheader()

mb_decode_mimeheader(?string  $string) : string

Parameters

?string $string

Returns

string —

mb_decode_numericentity()

mb_decode_numericentity(mixed  $string, mixed  $map, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $map
mixed $encoding

Returns

mixed —

mb_decode_numericentity()

mb_decode_numericentity(?string  $string, array  $map, ?string  $encoding = null) : string

Parameters

?string $string
array $map
?string $encoding

Returns

string —

mb_detect_encoding()

mb_detect_encoding(mixed  $string, mixed  $encodings = null, mixed  $strict = false) : mixed

Parameters

mixed $string
mixed $encodings
mixed $strict

Returns

mixed —

mb_detect_encoding()

mb_detect_encoding(?string  $string, array|string|null  $encodings = null, ?bool  $strict = false) : string|false

Parameters

?string $string
array|string|null $encodings
?bool $strict

Returns

string|false —

mb_detect_order()

mb_detect_order(mixed  $encoding = null) : mixed

Parameters

mixed $encoding

Returns

mixed —

mb_detect_order()

mb_detect_order(array|string|null  $encoding = null) : array|bool

Parameters

array|string|null $encoding

Returns

array|bool —

mb_encode_mimeheader()

mb_encode_mimeheader(mixed  $string, mixed  $charset = null, mixed  $transfer_encoding = null, mixed  $newline = "
", mixed  $indent) : mixed

Parameters

mixed $string
mixed $charset
mixed $transfer_encoding
mixed $newline
mixed $indent

Returns

mixed —

mb_encode_mimeheader()

mb_encode_mimeheader(?string  $string, ?string  $charset = null, ?string  $transfer_encoding = null, ?string  $newline = "
", ?int  $indent) : string

Parameters

?string $string
?string $charset
?string $transfer_encoding
?string $newline
?int $indent

Returns

string —

mb_encode_numericentity()

mb_encode_numericentity(mixed  $string, mixed  $map, mixed  $encoding = null, mixed  $hex = false) : mixed

Parameters

mixed $string
mixed $map
mixed $encoding
mixed $hex

Returns

mixed —

mb_encode_numericentity()

mb_encode_numericentity(?string  $string, array  $map, ?string  $encoding = null, ?bool  $hex = false) : string

Parameters

?string $string
array $map
?string $encoding
?bool $hex

Returns

string —

mb_encoding_aliases()

mb_encoding_aliases(mixed  $encoding) : mixed

Parameters

mixed $encoding

Returns

mixed —

mb_encoding_aliases()

mb_encoding_aliases(?string  $encoding) : array

Parameters

?string $encoding

Returns

array —

mb_get_info()

mb_get_info(mixed  $type = 'all') : mixed

Parameters

mixed $type

Returns

mixed —

mb_get_info()

mb_get_info(?string  $type = 'all') : array|string|int|false

Parameters

?string $type

Returns

array|string|int|false —

mb_http_input()

mb_http_input(mixed  $type = null) : mixed

Parameters

mixed $type

Returns

mixed —

mb_http_input()

mb_http_input(?string  $type = null) : array|string|false

Parameters

?string $type

Returns

array|string|false —

mb_http_output()

mb_http_output(mixed  $encoding = null) : mixed

Parameters

mixed $encoding

Returns

mixed —

mb_http_output()

mb_http_output(?string  $encoding = null) : string|bool

Parameters

?string $encoding

Returns

string|bool —

mb_internal_encoding()

mb_internal_encoding(mixed  $encoding = null) : mixed

Parameters

mixed $encoding

Returns

mixed —

mb_internal_encoding()

mb_internal_encoding(?string  $encoding = null) : string|bool

Parameters

?string $encoding

Returns

string|bool —

mb_language()

mb_language(mixed  $language = null) : mixed

Parameters

mixed $language

Returns

mixed —

mb_language()

mb_language(?string  $language = null) : string|bool

Parameters

?string $language

Returns

string|bool —

mb_list_encodings()

mb_list_encodings() : mixed

Returns

mixed —

mb_list_encodings()

mb_list_encodings() : array

Returns

array —

mb_ord()

mb_ord(mixed  $string, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $encoding

Returns

mixed —

mb_ord()

mb_ord(?string  $string, ?string  $encoding = null) : int|false

Parameters

?string $string
?string $encoding

Returns

int|false —

mb_ord()

mb_ord(mixed  $string, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $encoding

Returns

mixed —

mb_output_handler()

mb_output_handler(mixed  $string, mixed  $status) : mixed

Parameters

mixed $string
mixed $status

Returns

mixed —

mb_output_handler()

mb_output_handler(?string  $string, ?int  $status) : string

Parameters

?string $string
?int $status

Returns

string —

mb_parse_str()

mb_parse_str(mixed  $string, mixed  $result = []) : mixed

Parameters

mixed $string
mixed $result

Returns

mixed —

mb_parse_str()

mb_parse_str(?string  $string, mixed  $result = []) : bool

Parameters

?string $string
mixed $result

Returns

bool —

mb_scrub()

mb_scrub(mixed  $string, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $encoding

Returns

mixed —

mb_scrub()

mb_scrub(?string  $string, ?string  $encoding = null) : string

Parameters

?string $string
?string $encoding

Returns

string —

mb_scrub()

mb_scrub(mixed  $string, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $encoding

Returns

mixed —

mb_str_split()

mb_str_split(mixed  $string, mixed  $length = 1, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $length
mixed $encoding

Returns

mixed —

mb_str_split()

mb_str_split(?string  $string, ?int  $length = 1, ?string  $encoding = null) : array

Parameters

?string $string
?int $length
?string $encoding

Returns

array —

mb_stripos()

mb_stripos(mixed  $haystack, mixed  $needle, mixed  $offset, mixed  $encoding = null) : mixed

Parameters

mixed $haystack
mixed $needle
mixed $offset
mixed $encoding

Returns

mixed —

mb_stripos()

mb_stripos(?string  $haystack, ?string  $needle, ?int  $offset, ?string  $encoding = null) : int|false

Parameters

?string $haystack
?string $needle
?int $offset
?string $encoding

Returns

int|false —

mb_stristr()

mb_stristr(mixed  $haystack, mixed  $needle, mixed  $before_needle = false, mixed  $encoding = null) : mixed

Parameters

mixed $haystack
mixed $needle
mixed $before_needle
mixed $encoding

Returns

mixed —

mb_stristr()

mb_stristr(?string  $haystack, ?string  $needle, ?bool  $before_needle = false, ?string  $encoding = null) : string|false

Parameters

?string $haystack
?string $needle
?bool $before_needle
?string $encoding

Returns

string|false —

mb_strlen()

mb_strlen(mixed  $string, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $encoding

Returns

mixed —

mb_strlen()

mb_strlen(?string  $string, ?string  $encoding = null) : int

Parameters

?string $string
?string $encoding

Returns

int —

mb_strpos()

mb_strpos(mixed  $haystack, mixed  $needle, mixed  $offset, mixed  $encoding = null) : mixed

Parameters

mixed $haystack
mixed $needle
mixed $offset
mixed $encoding

Returns

mixed —

mb_strpos()

mb_strpos(?string  $haystack, ?string  $needle, ?int  $offset, ?string  $encoding = null) : int|false

Parameters

?string $haystack
?string $needle
?int $offset
?string $encoding

Returns

int|false —

mb_strrchr()

mb_strrchr(mixed  $haystack, mixed  $needle, mixed  $before_needle = false, mixed  $encoding = null) : mixed

Parameters

mixed $haystack
mixed $needle
mixed $before_needle
mixed $encoding

Returns

mixed —

mb_strrchr()

mb_strrchr(?string  $haystack, ?string  $needle, ?bool  $before_needle = false, ?string  $encoding = null) : string|false

Parameters

?string $haystack
?string $needle
?bool $before_needle
?string $encoding

Returns

string|false —

mb_strrichr()

mb_strrichr(mixed  $haystack, mixed  $needle, mixed  $before_needle = false, mixed  $encoding = null) : mixed

Parameters

mixed $haystack
mixed $needle
mixed $before_needle
mixed $encoding

Returns

mixed —

mb_strrichr()

mb_strrichr(?string  $haystack, ?string  $needle, ?bool  $before_needle = false, ?string  $encoding = null) : string|false

Parameters

?string $haystack
?string $needle
?bool $before_needle
?string $encoding

Returns

string|false —

mb_strripos()

mb_strripos(mixed  $haystack, mixed  $needle, mixed  $offset, mixed  $encoding = null) : mixed

Parameters

mixed $haystack
mixed $needle
mixed $offset
mixed $encoding

Returns

mixed —

mb_strripos()

mb_strripos(?string  $haystack, ?string  $needle, ?int  $offset, ?string  $encoding = null) : int|false

Parameters

?string $haystack
?string $needle
?int $offset
?string $encoding

Returns

int|false —

mb_strrpos()

mb_strrpos(mixed  $haystack, mixed  $needle, mixed  $offset, mixed  $encoding = null) : mixed

Parameters

mixed $haystack
mixed $needle
mixed $offset
mixed $encoding

Returns

mixed —

mb_strrpos()

mb_strrpos(?string  $haystack, ?string  $needle, ?int  $offset, ?string  $encoding = null) : int|false

Parameters

?string $haystack
?string $needle
?int $offset
?string $encoding

Returns

int|false —

mb_strstr()

mb_strstr(mixed  $haystack, mixed  $needle, mixed  $before_needle = false, mixed  $encoding = null) : mixed

Parameters

mixed $haystack
mixed $needle
mixed $before_needle
mixed $encoding

Returns

mixed —

mb_strstr()

mb_strstr(?string  $haystack, ?string  $needle, ?bool  $before_needle = false, ?string  $encoding = null) : string|false

Parameters

?string $haystack
?string $needle
?bool $before_needle
?string $encoding

Returns

string|false —

mb_strtolower()

mb_strtolower(mixed  $string, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $encoding

Returns

mixed —

mb_strtolower()

mb_strtolower(?string  $string, ?string  $encoding = null) : string

Parameters

?string $string
?string $encoding

Returns

string —

mb_strtoupper()

mb_strtoupper(mixed  $string, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $encoding

Returns

mixed —

mb_strtoupper()

mb_strtoupper(?string  $string, ?string  $encoding = null) : string

Parameters

?string $string
?string $encoding

Returns

string —

mb_strwidth()

mb_strwidth(mixed  $string, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $encoding

Returns

mixed —

mb_strwidth()

mb_strwidth(?string  $string, ?string  $encoding = null) : int

Parameters

?string $string
?string $encoding

Returns

int —

mb_substitute_character()

mb_substitute_character(mixed  $substitute_character = null) : mixed

Parameters

mixed $substitute_character

Returns

mixed —

mb_substitute_character()

mb_substitute_character(string|int|null  $substitute_character = null) : string|int|bool

Parameters

string|int|null $substitute_character

Returns

string|int|bool —

mb_substr()

mb_substr(mixed  $string, mixed  $start, mixed  $length = 2147483647, mixed  $encoding = null) : mixed

Parameters

mixed $string
mixed $start
mixed $length
mixed $encoding

Returns

mixed —

mb_substr()

mb_substr(?string  $string, ?int  $start, ?int  $length = null, ?string  $encoding = null) : string

Parameters

?string $string
?int $start
?int $length
?string $encoding

Returns

string —

mb_substr_count()

mb_substr_count(mixed  $haystack, mixed  $needle, mixed  $encoding = null) : mixed

Parameters

mixed $haystack
mixed $needle
mixed $encoding

Returns

mixed —

mb_substr_count()

mb_substr_count(?string  $haystack, ?string  $needle, ?string  $encoding = null) : int

Parameters

?string $haystack
?string $needle
?string $encoding

Returns

int —

md_unserialize()

md_unserialize(mixed  $content) : mixed

Parameters

mixed $content

Returns

mixed —

model()

model(string  $name = '', string  $layer = 'model', bool  $appendSuffix = false) : \think\Model

实例化Model

Parameters

string $name

Model名称

string $layer

业务层名称

bool $appendSuffix

是否添加类名后缀

Returns

\think\Model —

modifyMetaForObject()

modifyMetaForObject(\OssClient  $ossClient, string  $bucket) : null

Update Object Meta it leverages the feature of copyObject: when the source object is just the target object, the metadata could be updated via copy

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

multiuploadFile()

multiuploadFile(\OssClient  $ossClient, string  $bucket) : null

Upload files using multipart upload

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

normalizer_is_normalized()

normalizer_is_normalized(mixed  $string, mixed  $form = pNormalizer::FORM_C) : mixed

Parameters

mixed $string
mixed $form

Returns

mixed —

normalizer_is_normalized()

normalizer_is_normalized(?string  $string, ?int  $form = pNormalizer::FORM_C) : bool

Parameters

?string $string
?int $form

Returns

bool —

normalizer_normalize()

normalizer_normalize(mixed  $string, mixed  $form = pNormalizer::FORM_C) : mixed

Parameters

mixed $string
mixed $form

Returns

mixed —

normalizer_normalize()

normalizer_normalize(?string  $string, ?int  $form = pNormalizer::FORM_C) : string|false

Parameters

?string $string
?int $form

Returns

string|false —

numberOfTrailingZeros()

numberOfTrailingZeros(mixed  $i) : mixed

Parameters

mixed $i

Returns

mixed —

overflow32()

overflow32(mixed  $value) : mixed

Parameters

mixed $value

Returns

mixed —

paramencode()

paramencode(mixed  $arr) : mixed

Parameters

mixed $arr

Returns

mixed —

parse_attr()

parse_attr(string  $value = '') : array|string

解析配置

Parameters

string $value

配置值

Returns

array|string —

parse_name()

parse_name(string  $name, int  $type, bool  $ucfirst = true) : string

字符串命名风格转换 type 0 将Java风格转换为C的风格 1 将C风格转换为Java的风格

Parameters

string $name

字符串

int $type

转换类型

bool $ucfirst

首字母是否大写(驼峰规则)

Returns

string —

preg_last_error_msg()

preg_last_error_msg() : string

Returns

string —

printImage()

printImage(mixed  $func, mixed  $imageFile) : mixed

Parameters

mixed $func
mixed $imageFile

Returns

mixed —

putBucketAcl()

putBucketAcl(\OssClient  $ossClient, string  $bucket) : null

Set bucket ACL

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

putBucketCors()

putBucketCors(\OssClient  $ossClient, string  $bucket) : null

Set bucket cores

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

putBucketLifecycle()

putBucketLifecycle(\OssClient  $ossClient, string  $bucket) : null

Set bucket lifecycle configuration

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

putBucketLogging()

putBucketLogging(\OssClient  $ossClient, string  $bucket) : null

Set bucket logging configuration

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

putBucketReferer()

putBucketReferer(\OssClient  $ossClient, string  $bucket) : null

Set bucket referer configuration

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

putBucketWebsite()

putBucketWebsite( $ossClient,  $bucket) : null

Sets bucket static website configuration

Parameters

$ossClient

OssClient

$bucket

string bucket name

Returns

null —

putObject()

putObject(\OssClient  $ossClient, string  $bucket) : null

Upload in-memory data to oss

Simple upload---upload specified in-memory data to an OSS object

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

putObjectByRawApis()

putObjectByRawApis(\OssClient  $ossClient, string  $bucket) : mixed

Use basic multipart upload for file upload.

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Throws

\OssException

Returns

mixed —

putSymlink()

putSymlink(\OssClient  $ossClient, string  $bucket) : null

Put symlink

Parameters

\OssClient $ossClient

The Instance of OssClient

string $bucket

bucket name

Returns

null —

queue()

queue( $job, string  $data = '', int  $delay, null  $queue = null) : mixed

添加到队列

Parameters

$job
string $data
int $delay
null $queue

Returns

mixed —

rangetime()

rangetime(mixed  $time) : void

时间戳算出距今多久

Parameters

mixed $time

redirect()

redirect(mixed  $url = [], array|int  $params = [], int  $code = 302) : \think\response\Redirect

获取\think\response\Redirect对象实例

Parameters

mixed $url

重定向地址 支持Url::build方法的地址

array|int $params

额外参数

int $code

状态码

Returns

\think\response\Redirect —

request()

request() : \Request

获取当前Request对象实例

Returns

\Request —

response()

response(mixed  $data = '', int|string  $code = 200, array  $header = [], string  $type = 'html') : \Response

创建普通 Response 对象实例

Parameters

mixed $data

输出数据

int|string $code

状态码

array $header

头信息

string $type

Returns

\Response —

route()

route(string  $rule, mixed  $route, array  $option = [], array  $pattern = []) : \RuleItem

路由注册

Parameters

string $rule

路由规则

mixed $route

路由地址

array $option

路由参数

array $pattern

变量规则

Returns

\RuleItem —

safe_replace()

safe_replace( $string) : string

安全过滤函数

Parameters

$string

Returns

string —

sapi_windows_vt100_support()

sapi_windows_vt100_support(mixed  $stream, mixed  $enable = null) : mixed

Parameters

mixed $stream
mixed $enable

Returns

mixed —

sdvig3()

sdvig3(mixed  $a, mixed  $b) : mixed

Parameters

mixed $a
mixed $b

Returns

mixed —

second_time()

second_time( $second) : bool|string

秒数转换:年 天 小时 分钟 秒

Parameters

$second

Returns

bool|string —

seo()

seo( $catid = '',  $title = '',  $description = '',  $keyword = '') : mixed

生成SEO

Parameters

$catid

栏目ID

$title

标题

$description

描述

$keyword

关键词

Returns

mixed —

session()

session(string|array  $name, mixed  $value = '', string  $prefix = null) : mixed

Session管理

Parameters

string|array $name

session名称,如果为数组表示进行session设置

mixed $value

session值

string $prefix

前缀

Returns

mixed —

set_addon_config()

set_addon_config(string  $name, array  $config, bool  $writefile = true) : bool

写入配置文件

Parameters

string $name

插件名

array $config

配置数据

bool $writefile

是否写入配置文件

Throws

\Exception

Returns

bool —

set_addon_fullconfig()

set_addon_fullconfig(string  $name, array  $array) : bool

写入配置文件.

Parameters

string $name

插件名

array $array

配置数据

Throws

\Exception

Returns

bool —

set_addon_info()

set_addon_info(string  $name, array  $array) : bool

设置基础配置信息.

Parameters

string $name

插件名

array $array

配置数据

Throws

\Exception

Returns

bool —

setGray()

setGray() : void

控制网站黑白

spl_object_id()

spl_object_id(mixed  $object) : mixed

Parameters

mixed $object

Returns

mixed —

str2arr()

str2arr(string  $str, string  $glue = ',') : array

字符串转换为数组,主要用于把分隔符调整到第二个参数

Parameters

string $str

要分割的字符串

string $glue

分割符

Returns

array —

str_contains()

str_contains(?string  $haystack, ?string  $needle) : bool

Parameters

?string $haystack
?string $needle

Returns

bool —

str_cut()

str_cut(mixed  $sourcestr,  $length,  $dot = '...') : mixed

字符截取

Parameters

mixed $sourcestr
$length

长度

$dot

Returns

mixed —

str_ends_with()

str_ends_with(?string  $haystack, ?string  $needle) : bool

Parameters

?string $haystack
?string $needle

Returns

bool —

str_split_unicode()

str_split_unicode( $str,  $l) : array|false|string[]

拆分字符逐个打印

Parameters

$str

拆分文字

$l

拆分量

Returns

array|false|string[] —

str_starts_with()

str_starts_with(?string  $haystack, ?string  $needle) : bool

Parameters

?string $haystack
?string $needle

Returns

bool —

str_sym()

str_sym(mixed  $str, string  $sym = "span") : void

给文字包裹span

Parameters

mixed $str
string $sym

包裹元素

stream_isatty()

stream_isatty(mixed  $stream) : mixed

Parameters

mixed $stream

Returns

mixed —

structure_filters_sql()

structure_filters_sql(mixed  $modelid) : mixed

Parameters

mixed $modelid

Returns

mixed —

sys_auth()

sys_auth(mixed  $string, string  $operation = 'ENCODE', string  $key = '', string  $expiry) : string

字符串加密、解密函数

Parameters

mixed $string
string $operation

ENCODE为加密,DECODE为解密,可选参数,默认为ENCODE,

string $key

密钥:数字、字母、下划线

string $expiry

过期时间

Returns

string —

tap()

tap(mixed  $value, callable|null  $callback = null) : mixed

对一个值调用给定的闭包,然后返回该值

Parameters

mixed $value
callable|null $callback

Returns

mixed —

throw_if()

throw_if(mixed  $condition, \Throwable|string  $exception, array  ...$parameters) : mixed

按条件抛异常

Parameters

mixed $condition
\Throwable|string $exception
array $parameters variadic

Throws

\Throwable

Returns

mixed —

throw_unless()

throw_unless(mixed  $condition, \Throwable|string  $exception, array  ...$parameters) : mixed

按条件抛异常

Parameters

mixed $condition
\Throwable|string $exception
array $parameters variadic

Throws

\Throwable

Returns

mixed —

thumb()

thumb(\type  $imgurl, \type  $width = 100, \type  $height = 100, \type  $thumbType = 1, \type  $smallpic = 'none.png') : \type

生成缩略图

Parameters

\type $imgurl

图片地址

\type $width

缩略图宽度

\type $height

缩略图高度

\type $thumbType

缩略图生成方式

\type $smallpic

图片不存在时显示默认图片

Returns

\type —

time_format()

time_format(int  $timestamp = null, mixed  $type) : string

时间戳格式化

Parameters

int $timestamp
mixed $type

Returns

string —

完整的时间显示

to_guid_string()

to_guid_string(mixed  $mix) : string

根据PHP各种类型变量生成唯一标识号

Parameters

mixed $mix

变量

Returns

string —

to_ip()

to_ip(array  $arr, string  $field = 'ip') : mixed

ip转换

Parameters

array $arr

传入数组

string $field

字段名

Returns

mixed —

to_time()

to_time(array  $arr, string  $field = 'time', string  $format = 'Y-m-d H:i:s') : mixed

时间转换

Parameters

array $arr

传入数组

string $field

字段名

string $format

格式

Returns

mixed —

token()

token(string  $name = '__token__', mixed  $type = 'md5') : string

生成表单令牌

Parameters

string $name

令牌名称

mixed $type

令牌生成方法

Returns

string —

trace()

trace(mixed  $log = '[think]', string  $level = 'log') : array|void

记录日志信息

Parameters

mixed $log

log信息 支持字符串和数组

string $level

日志级别

Returns

array|void —

trait_uses_recursive()

trait_uses_recursive(string  $trait) : array

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

Parameters

string $trait

Returns

array —

transpose()

transpose(mixed  $value) : mixed

Parameters

mixed $value

Returns

mixed —

trigger_deprecation()

trigger_deprecation(string  $package, string  $version, string  $message, mixed  ...$args) : void

Triggers a silenced deprecation notice.

Parameters

string $package

The name of the Composer package that is triggering the deprecation

string $version

The version of the package that introduced the deprecation

string $message

The message of the deprecation

mixed $args variadic

Values to insert in the message using printf() formatting

uploadDir()

uploadDir(\OssClient  $ossClient, string  $bucket) : mixed

Upload by directories

Parameters

\OssClient $ossClient

OssClient

string $bucket

bucket name

Returns

mixed —

uploadFile()

uploadFile(\OssClient  $ossClient, string  $bucket) : null

Uploads a local file to OSS

Parameters

\OssClient $ossClient

OssClient instance

string $bucket

bucket name

Returns

null —

url()

url(string  $url = '', string|array  $vars = '', bool|string  $suffix = true, bool|string  $domain = false) : string

Url生成

Parameters

string $url

路由地址

string|array $vars

变量

bool|string $suffix

生成的URL后缀

bool|string $domain

域名

Returns

string —

uRShift()

uRShift(mixed  $a, mixed  $b) : mixed

Parameters

mixed $a
mixed $b

Returns

mixed —

utf8_decode()

utf8_decode(mixed  $string) : mixed

Parameters

mixed $string

Returns

mixed —

utf8_encode()

utf8_encode(mixed  $string) : mixed

Parameters

mixed $string

Returns

mixed —

validate()

validate(string  $name = '', string  $layer = 'validate', bool  $appendSuffix = false) : \think\Validate

实例化验证器

Parameters

string $name

验证器名称

string $layer

业务层名称

bool $appendSuffix

是否添加类名后缀

Returns

\think\Validate —

value()

value(mixed  $value) : mixed

Return the default value of the given value.

Parameters

mixed $value

Returns

mixed —

var_export_short()

var_export_short(mixed  $data, bool  $return = true) : string

使用短标签打印或返回数组结构

Parameters

mixed $data
bool $return

是否返回数据

Returns

string —

view()

view(string  $template = '', array  $vars = [], int  $code = 200, callable  $filter = null) : \think\response\View

渲染模板输出

Parameters

string $template

模板文件

array $vars

模板变量

int $code

状态码

callable $filter

内容过滤

Returns

\think\response\View —

whatsapp()

whatsapp(mixed  $phone, string  $text = "Hello") : void

WhatsApp pc和手机输出

Parameters

mixed $phone
string $text

输出文字

widget()

widget(string  $name, array  $data = []) : mixed

渲染输出Widget

Parameters

string $name

Widget名称

array $data

传入的参数

Returns

mixed —

xml()

xml(mixed  $data = [], int  $code = 200, array  $header = [], array  $options = []) : \think\response\Xml

获取\think\response\Xml对象实例

Parameters

mixed $data

返回的数据

int $code

状态码

array $header

头部

array $options

参数

Returns

\think\response\Xml —

yaconf()

yaconf(string  $name, mixed  $default = null) : mixed

获取yaconf配置

Parameters

string $name

配置参数名

mixed $default

默认值

Returns

mixed —