Documentation

Application

Table of Contents

Interfaces

ClientInterface
Client interface for sending HTTP requests.
CookieJarInterface
Stores HTTP cookies.
GuzzleException
CurlFactoryInterface
PromiseInterface
A promise represents the eventual result of an asynchronous operation.
PromisorInterface
Interface used with classes that return a promise.
TaskQueueInterface
MessageInterface
HTTP messages consist of requests from a client to a server and responses from a server to a client. This interface defines the methods common to each.
RequestInterface
Representation of an outgoing, client-side request.
ResponseInterface
Representation of an outgoing, server-side response.
ServerRequestInterface
Representation of an incoming, server-side HTTP request.
StreamInterface
Describes a data stream.
UploadedFileInterface
Value object representing a file uploaded through an HTTP request.
UriInterface
Value object representing a URI.
SessionUpdateTimestampHandlerInterface

Classes

Build
Clear
MultiApp
多应用模式支持
Service
Url
路由地址生成
GoogleAuthenticator
PHP Class for handling Google Authenticator 2-factor authentication.
CleanSafeCode
Hello
Auth
Config
Index
Login
Logout
Media
Member
Upload
Users
Welcome
User
cache
weixin
ApiKf
ApiNotify
Comment
Doc
Login
Qr
Sms
Upload
User
ApiComment
ApiFollow
ApiLike
ApiOpen
Blog
Comment
Member
Open
Weibo
Blog
Auth
CCK
ApiContent
Auth
Autocomplate
Content
Index
Node
Test
Data
Node
Setting
ContentType
用于验证表单中的validate
Validate
https://doc.thinkphp.cn/v8_0/validate_error.html
FormValidate
用于验证表单中的validate
City
Builder
City
AdminController
控制器基础类 不要单独继承此类使用 必须使用ApiController或AdminController
AdminWithController
用户兼容管理员\门店\连锁店使用同一个控制器的情况
ApiController
控制器基础类 不要单独继承此类使用 必须使用ApiController或AdminController
BaseController
控制器基础类 不要单独继承此类使用 必须使用ApiController或AdminController
ShopController
用户兼容管理员\门店\连锁店使用同一个控制器的情况
StoreController
控制器基础类 不要单独继承此类使用 必须使用ApiController或AdminController
Index
SyncTalk
Admin
Assets
Menu
Open
Qr
Reply
Menu
Qr
Reply
ComposerAutoloaderInit5f0a856db0eb13be86d63b013a8d9e03
ComposerStaticInit5f0a856db0eb13be86d63b013a8d9e03
ClassLoader
ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
InstalledVersions
This class is copied in every Composer installed project and available to all
Client
CookieJar
Cookie jar that stores cookies as an array
FileCookieJar
Persists non-session cookies using a JSON formatted file
SessionCookieJar
Persists cookies in the client session
SetCookie
Set-Cookie object
BadResponseException
Exception when an HTTP error occurs (4xx or 5xx error)
ClientException
Exception when a client error is encountered (4xx codes)
ConnectException
Exception thrown when a connection cannot be established.
InvalidArgumentException
RequestException
HTTP Request exception
SeekException
Exception thrown when a seek fails on a stream.
ServerException
Exception when a server error is encountered (5xx codes)
TooManyRedirectsException
HTTP Request exception
TransferException
CurlFactory
Creates curl resources from a request
CurlHandler
HTTP handler that uses cURL easy handles as a transport layer.
CurlMultiHandler
Returns an asynchronous response using curl_multi_* functions.
MockHandler
Handler that returns responses or throw exceptions from a queue.
Proxy
Provides basic proxies for handlers.
StreamHandler
HTTP handler that uses PHP's HTTP stream wrapper.
HandlerStack
Creates a composed Guzzle handler function by stacking middlewares on top of an HTTP handler function.
MessageFormatter
Formats log messages using variable substitutions for requests, responses, and other transactional data.
Middleware
Functions used to create and wrap handlers with handler middleware.
Pool
Sends an iterator of requests concurrently using a capped pool size.
PrepareBodyMiddleware
Prepares requests that contain a body, adding the Content-Length, Content-Type, and Expect headers.
RedirectMiddleware
Request redirect middleware.
RequestOptions
This class contains a list of built-in Guzzle request options.
RetryMiddleware
Middleware that retries requests based on the boolean result of invoking the provided "decider" function.
TransferStats
Represents data at the point after it was transferred either successfully or after a network error.
UriTemplate
Expands URI templates. Userland implementation of PECL uri_template.
Utils
AggregateException
Exception thrown when too many errors occur in the some() or any() methods.
CancellationException
Exception that is set as the reason for a promise that has been cancelled.
Coroutine
Creates a promise that is resolved using a generator that yields values or promises (somewhat similar to C#'s async keyword).
Create
Each
EachPromise
Represents a promise that iterates over many promises and invokes side-effect functions in the process.
FulfilledPromise
A promise that has been fulfilled.
Is
Promise
Promises/A+ implementation that avoids recursion when possible.
RejectedPromise
A promise that has been rejected.
RejectionException
A special exception that is thrown when waiting on a rejected promise.
TaskQueue
A task queue that executes tasks in a FIFO order.
Utils
AppendStream
Reads from multiple streams, one after the other.
BufferStream
Provides a buffer stream that can be written to to fill a buffer, and read from to remove bytes from the buffer.
CachingStream
Stream decorator that can cache previously read bytes from a sequentially read stream.
DroppingStream
Stream decorator that begins dropping data once the size of the underlying stream becomes too full.
FnStream
Compose stream implementations based on a hash of functions.
Header
InflateStream
Uses PHP's zlib.inflate filter to inflate deflate or gzipped content.
LazyOpenStream
Lazily reads or writes to a file that is opened only after an IO operation take place on the stream.
LimitStream
Decorator used to return only a subset of a stream.
Message
MimeType
MultipartStream
Stream that when read returns bytes for a streaming multipart or multipart/form-data stream.
NoSeekStream
Stream decorator that prevents a stream from being seeked.
PumpStream
Provides a read only stream that pumps data from a PHP callable.
Query
Request
PSR-7 request implementation.
Response
PSR-7 response implementation.
Rfc7230
ServerRequest
Server-side HTTP request
Stream
PHP stream implementation.
StreamWrapper
Converts Guzzle streams into PHP stream resources.
UploadedFile
Uri
PSR-7 URI implementation.
UriComparator
Provides methods to determine if a modified URL should be considered cross-origin.
UriNormalizer
Provides methods to normalize and compare URIs.
UriResolver
Resolves a URI reference in the context of a base URI and the opposite way.
Utils
Error
TypeError
GetAllHeadersTest
Normalizer
ArithmeticError
AssertionError
DivisionByZeroError
Error
ParseError
TypeError
BaiduPan
开放平台 https://pan.baidu.com/union/doc/il5284nct
Wps
开放平台 https://open.wps.cn/
ApiWps
ApiIndex
ApiLogin
ApiWps
Alipay
Base
Weixin
微信支付 支付方式 //JSAPI--JSAPI支付(或小程序支付)、NATIVE--Native支付、APP--app支付,MWEB--H5支付, 使用composer: https://easywechat.com/6.x/pay/index.html 微信官方: https://pay.weixin.qq.com/wiki/doc/apiv3/index.shtml
AlipayTransfer
Weixin
Alipay
/rpc/payment/Alipay 具体查看API接口参数
ContentReviewBaidu
DocToPdf
文档转PDF
Flysystem
Drive
IdPhoto
ImageBackground
图片移除背景
ImgToPaper
图片放到纸上
Map
Ocr
OssAli
composer require aliyuncs/oss-sdk-php https://github.com/aliyun/aliyun-oss-php-sdk
OssAliBase
OssAmazonS3
OssAzureBlob
OssBaidu
OssCos
https://github.com/tencentyun/cos-php-sdk-v5
OssHuawei
OssJd
OssQiniu
OssUpyun
PdfFree
PdfToImage
文档转图片
Pinyin
汉字转拼音
PrinterLiankeBase
链科打印机硬件接口 官网 https://cloud.wisiyilink.com/ 手册 https://documenter.getpostman.com/view/1758872/SWE83H6u?version=latest
Printer
统一处理打印功能 且统一了参数
PrinterGx
PrinterLianke
SensitiveWords
过滤敏感词
SerTextin
textin平台 https://www.textin.com/
Sms
UniPush1
unipush 1 推送 https://dev.dcloud.net.cn/pages/app/push/info
WebDAV
WeMinProgram
微信小程序
WeProgram
微信公众号 小程序 共用部分
CleanFile
Commands
DownloadWebDav
Printer
PrinterClose
UploadWebDav
Admin
ApiContentReviewBaidu
ApiImageBackground
ApiImgToPaper
ApiMap
ApiOcr
ApiOss
ApiPdf
ApiPdfFree
ApiPhoto
ApiPinyin
ApiPrinterGx
ApiPrinterGxCall
ApiPrinterLianke
ApiPrinterLiankeCall
ApiSensitiveWords
ApiSms
ApiWeMinProgram
ContentReviewBaidu
/rpc/webtool/PrinterLianke 具体查看API接口参数
ImageBackground
/rpc/webtool/ImageBackground $url = 'http://tool/rpc/webtool/ImageBackground'; $client = rpc_client($url);
ImgToPaper
/rpc/webtool/ImgToPaper $url = 'http://tool/rpc/webtool/ImgToPaper'; $client = rpc_client($url);
Map
/rpc/webtool/Map $url = 'http://tool/rpc/webtool/Map'; $client = rpc_client($url);
Ocr
/rpc/webtool/Ocr $url = 'http://tool/rpc/webtool/Ocr'; $client = rpc_client($url);
OcrTx
/rpc/webtool/OcrTx $url = 'http://tool/rpc/webtool/OcrTx'; $client = rpc_client($url);
Oss
/rpc/webtool/Oss $url = 'http://tool/rpc/webtool/Oss'; $client = rpc_client($url);
Pdf
/rpc/webtool/Pdf $url = 'http://tool/rpc/webtool/Pdf'; $client = rpc_client($url);
PdfFree
/rpc/webtool/PdfFree $url = 'http://tool/rpc/webtool/PdfFree'; $client = rpc_client($url);
Photo
/rpc/webtool/Photo $url = 'http://tool/rpc/webtool/Photo'; $client = rpc_client($url);
Pinyin
/rpc/webtool/Pinyin
Printer
/rpc/webtool/Printer
PrinterGx
/rpc/webtool/PrinterGx 具体查看API接口参数
PrinterLianke
/rpc/webtool/PrinterLianke 具体查看API接口参数
SensitiveWords
/rpc/webtool/SensitiveWords 具体查看API接口参数
Sms
/rpc/webtool/Sms $url = 'http://tool/rpc/webtool/Sms'; $client = rpc_client($url);
UniPush1
/rpc/webtool/UniPush1 $url = 'http://tool/rpc/webtool/UniPush1'; $client = rpc_client($url);
WebDav
/rpc/webtool/WebDav 具体查看API接口参数
WeMinProgram
/rpc/webtool/WeMinProgram $url = 'http://tool/rpc/webtool/WeMinProgram'; $client = rpc_client($url);
Tencent
base
filter
form
pager
table
di
global $di; $di = new di(); $di->adapter = new adapter();
Block
Csv
Form
表单token $token = helper_v3\Form::create_token(); 在vue form中添加<?= $token['input']?> 提交数据前 this.form.__TOKEN__ = '" . $token['data'] . "'; 服务端检测token, helper_v3\Form::check_token(); 判断value值,需要在配置文件中配置 form_token_value 的值 表单的token名称也可以通过配置 form_token_name 来修改,默认为__TOKEN__
Ftp
FtpClient
Image
Lock
https://symfony.com/doc/current/components/lock.html global $redis_lock; $redis_lock = [ 'host'=>'', 'port'=>'', 'auth'=>'', ];
Pdf
Pusher
Rpc
Sms
Xls
SCSS
rpc_php
id
生成唯一ID
Aes
Arr
Mail
发送邮件 composer require symfony/mailer https://symfony.com/components/Mailer
Map
Mime
Rsa
Session
Str
Time
Validate
$lang = 'zh-cn'; lib\Validate::lang($lang); lib\Validate::langDir(__DIR__.'/validator_lang');
model
Vue
用于生成vue2或vue3的JS代码

Traits

RPC_START
RPC trait
MessageTrait
Trait implementing functionality common to requests and responses.
StreamDecoratorTrait
Stream decorator trait

Constants

APP_FORM_PATH  = \VEN_ELEMENT_FORM_PATH
DS  = \DIRECTORY_SEPARATOR
HELPER_DIR  = __DIR__
IDNA_ALLOW_UNASSIGNED  = 1
IDNA_CHECK_BIDI  = 4
IDNA_CHECK_CONTEXTJ  = 8
IDNA_DEFAULT  = 0
IDNA_ERROR_BIDI  = 2048
IDNA_ERROR_CONTEXTJ  = 4096
IDNA_ERROR_DISALLOWED  = 128
IDNA_ERROR_DOMAIN_NAME_TOO_LONG  = 4
IDNA_ERROR_EMPTY_LABEL  = 1
IDNA_ERROR_HYPHEN_3_4  = 32
IDNA_ERROR_INVALID_ACE_LABEL  = 1024
IDNA_ERROR_LABEL_HAS_DOT  = 512
IDNA_ERROR_LABEL_TOO_LONG  = 2
IDNA_ERROR_LEADING_COMBINING_MARK  = 64
IDNA_ERROR_LEADING_HYPHEN  = 8
IDNA_ERROR_PUNYCODE  = 256
IDNA_ERROR_TRAILING_HYPHEN  = 16
IDNA_NONTRANSITIONAL_TO_ASCII  = 16
IDNA_NONTRANSITIONAL_TO_UNICODE  = 32
IDNA_USE_STD3_RULES  = 2
INTL_IDNA_VARIANT_2003  = 0
INTL_IDNA_VARIANT_UTS46  = 1
PHP_FLOAT_DIG  = 15
PHP_FLOAT_EPSILON  = 2.2204460492503E-16
PHP_FLOAT_MAX  = 1.7976931348623157E+308
PHP_FLOAT_MIN  = 2.2250738585072E-308
PHP_INT_MIN  = ~\PHP_INT_MAX
PHP_OS_FAMILY  = \Symfony\Polyfill\Php72\Php72::php_os_family()
PHP_VERSION_ID  = $RandomCompatversion[0] * 10000 + $RandomCompatversion[1] * 100 + $RandomCompatversion[2]
RANDOM_COMPAT_READ_BUFFER  = 8
RANDOM_COMPAT_READ_BUFFER  = 8
thefunpower_mongo_dir  = __DIR__
U_IDNA_ACE_PREFIX_ERROR  = 66564
U_IDNA_CHECK_BIDI_ERROR  = 66562
U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR  = 66568
U_IDNA_ERROR_LIMIT  = 66569
U_IDNA_ERROR_START  = 66560
U_IDNA_LABEL_TOO_LONG_ERROR  = 66566
U_IDNA_PROHIBITED_ERROR  = 66560
U_IDNA_STD3_ASCII_RULES_ERROR  = 66563
U_IDNA_UNASSIGNED_ERROR  = 66561
U_IDNA_VERIFICATION_ERROR  = 66565
U_IDNA_ZERO_LENGTH_LABEL_ERROR  = 66567
U_STRINGPREP_CHECK_BIDI_ERROR  = 66562
U_STRINGPREP_PROHIBITED_ERROR  = 66560
U_STRINGPREP_UNASSIGNED_ERROR  = 66561
VEN_ELEMENT_FORM_PATH  = __DIR__ . '/form'

Functions

in_api()  : mixed
判断在api接口中
get_app_header()  : mixed
取header
is_app_req()  : mixed
使用header判断是app接口请求
get_m_c_a()  : mixed
取模块、控制器、动作
get_module_list()  : mixed
模块列表
has_module()  : mixed
是否存在模块
is_app_api_req()  : mixed
是否是api控制器请求
index_url()  : mixed
index_url().'/scrm/site/index' 配置 index_url 如 $config['index_url'] = 'index.php';
set_menu_group()  : mixed
get_login_cid()  : mixed
获取unipush的cid 用于推送
create_user_by_openid()  : mixed
用openid创建帐号
get_user_by_phone()  : mixed
根据手机号获取帐号,如不存在支持创建帐号
set_user_token()  : mixed
获取手机号后设置token
set_user_openid()  : mixed
记录用户的openid
get_user_openid()  : mixed
取用户OPENID
get_user_avatar_url()  : mixed
处理用户头像、昵称
get_comment_status()  : mixed
get_comment_status_color()  : mixed
get_comment()  : mixed
取一条评论信息
get_comments()  : mixed
获取评论
get_comment_row()  : mixed
comment row
add_comment()  : mixed
添加评论
update_comment()  : mixed
更新评论
get_media_by_url()  : mixed
取资源信息
applet_image_init()  : mixed
https://image.intervention.io/v2/introduction/installation
get_notify()  : mixed
获取提醒
read_notify()  : mixed
已读
get_notify_count()  : mixed
获取未读数量
add_notify()  : mixed
添加提醒
applet_image_resize()  : mixed
图片缩放
applet_create_qr()  : mixed
生成二维码 content title logo name brower 其中 brower=>1时不生成文件 applet_create_qr([ 'title'=>'', 'content'=>'', 'brower'=>1, 'size'=>100, //不用CDN地址,直接返回本地相对地址 'no_cdn'=>1, ]);
get_rand_jp()  : mixed
用户抽奖 $prize_arr = array( array('node_id'=>1,'prize'=>'平板电脑','v'=>10,'num'=>3), array('node_id'=>2,'prize'=>'数码相机','v'=>10,'num'=>1), ); $nid = 1; pr(get_rand_jp(100,$nid,$prize_arr));
_get_rand_jp()  : mixed
get_pf_amount()  : mixed
平分金额
get_rand_amount()  : mixed
随机金额
applet_qr_parse()  : mixed
applet_barcode()  : mixed
条形码 composer require picqer/php-barcode-generator
applet_check_captch_tencent()  : mixed
腾讯云验证码
applet_use_captch_tencent()  : mixed
get_phone_send_vue()  : mixed
VUE 验证 腾讯验证码或者图形验证码
get_phone_send_form()  : mixed
get_blog_status()  : mixed
get_blog_status_color()  : mixed
get_blog()  : mixed
get_blog_row()  : mixed
get_like_pager()  : mixed
get_like_blog()  : mixed
是否是我喜欢的 当user_id为空,且limit>1时,返回blog被喜欢的数组
get_like_blog_pager()  : mixed
对动态点赞的会员
get_like_blog_count()  : mixed
喜欢数量
like_blog()  : mixed
喜欢或取消喜欢
get_follow_blog_count()  : mixed
关注数量
get_blog_follow_user()  : mixed
就否关注
follow_blog()  : mixed
关注
blog_antiporn()  : mixed
文本+图片审核
del_node()  : mixed
删除node
get_nodes()  : mixed
多条记录
get_node()  : mixed
一条记录
get_cck_field()  : mixed
get_cck_field_by_builder()  : mixed
update_node()  : mixed
强制更新数据
save_node()  : mixed
保存node
get_node_more_field()  : mixed
追回其他字段
get_node_data_filter()  : mixed
数据处理
get_node_pager()  : mixed
cck分页
get_node_tree()  : mixed
cck tree
get_cck_table()  : mixed
node 表名 ,添加 node_
remove_cck_table()  : mixed
node 表名,移除node_
get_init_cck()  : mixed
cck init
get_node_where()  : mixed
分页、列表统一处理where
get_cck_author_where()  : mixed
仅操作自己
form_builder_field()  : mixed
$filed = form_builder_field('fn or name',$old_field); set_field_allow('scrm_customer',$field);
form_builder()  : mixed
构建表单 使用 /form/builder
form_create()  : mixed
form_field_type()  : mixed
builder 字段
merge_form_field()  : mixed
合并原字段及自定义字段
get_city_area()  : mixed
省市区 由命令行 php think get_city --ansi 生成
form_get_city()  : mixed
同 get_city_area()
__()  : mixed
think_validate https://github.com/vlucas/valitron
cache()  : mixed
缓存 加前缀 CACHE_PRE
table_sortable()  : mixed
host()  : mixed
is_admin()  : mixed
判断是超管
is_admin_login()  : mixed
判断是普通管理员
get_admin_user()  : mixed
取管理员信息
get_user()  : mixed
取用户信息
admin_header()  : mixed
admin_footer()  : mixed
admin_access_to_yunyin()  : mixed
管理员权限同步给运营
admin_access()  : mixed
管理员权限
add_admin_access()  : mixed
get_admin_access_table()  : mixed
get_admin_access()  : mixed
get_admin_access_menu()  : mixed
think_vue_media_button()  : mixed
think_vue_media_one_button()  : mixed
think_vue_media()  : mixed
app_boot()  : mixed
order_num()  : mixed
insert_trace()  : mixed
记录日志
get_trace()  : mixed
获取操作记录
star_phone()  : mixed
手机号显示 ****
vue_add_media_muit()  : mixed
多图上传
vue_add_media()  : mixed
单图上传
rpc_server_auth()  : mixed
检测RPC服务是否可用 $client = rpc_client($url); $info = $client->get_info([ 'device_id'=>'', 'device_key'=>'', ]);
rpc()  : mixed
调用远程RPC服务,如果远程的应用模块需要放在本地,可以把远程的模块复制到本项目下。 然后把数据库中对应的RPC URL删除,不需要改动其他代码,就可以不发起远程调用,而直接调用本地函数
format_money()  : mixed
格式化数字 因mongodb对字段类型要求严格
rand_password()  : mixed
生成安全的随机密码函数
view()  : mixed
view
common_init()  : mixed
初始化RPC请求参数及Redis
get_allow_mime()  : mixed
获取允许上传的mime
file_upload_button()  : mixed
文件上传 不同于图片上传,文件上传仅支持点击按钮直接上传,不支持从文件库中选择文件
google_authenticator()  : mixed
GOOGLE验证器 验证
google_authenticator_create()  : mixed
GOOGLE验证器 生成secret
set_record()  : mixed
记录
get_record()  : mixed
获取记录
load_app_php()  : mixed
加载 app/目录/app.php文件
load_hook_php()  : mixed
加载 hook/目录/hook.php文件
get_node_fav_is()  : mixed
处理常用的主题收藏等类似操作。 是否收藏
get_node_favs()  : mixed
收藏列表
get_node_fav_count()  : mixed
主题 收藏数量
set_node_fav()  : mixed
收藏或取消收藏
get_user_tag()  : mixed
cdn_url()  : mixed
add_cdn_url()  : mixed
设置CDN # CDN 激活 active_cdn = 1 # CDN 地址 支持以,分隔 CDN_URL = https://mac1.qihetaiji.com,https://mac.qihetaiji.com
get_admin_tag()  : mixed
llc_encode()  : mixed
使用公钥加密
llc_decode()  : mixed
使用私钥解密 用户只保留了私钥。
llc_powerby()  : mixed
mp_jieba()  : mixed
分词
mp_init()  : mixed
get_mp_config()  : mixed
mp_create_qr()  : mixed
二维码 QR_SCENE 临时二维码 QR_LIMIT_SCENE永久二维码
mp_get_user_info()  : mixed
获取用户基本信息(UnionID机制) https://developers.weixin.qq.com/doc/offiaccount/User_Management/Get_users_basic_information_UnionID.html#UinonId openid、subscribe、unionid、qr_scene、qr_scene_str subscribe 1已关注
get_oauth2_wps_title()  : mixed
get_oauth2_page_header()  : mixed
get_oauth2_page_footer()  : mixed
publish_oauth2_img()  : mixed
get_oauth2_access_token()  : mixed
get_oauth2_access_token_by_state()  : mixed
MyXpanfileprecreate()  : bool|Fileprecreateresponse
MyPcssuperfile2()  : mixed
MyXpanfilecreate()  : mixed
fileupload()  : mixed
filemeta()  : mixed
MyXpanfileimagelist()  : mixed
MyXpanfiledoclist()  : mixed
MyXpanfilesearch()  : mixed
MyXpanfilelist()  : mixed
userinfo()  : mixed
MyApiQuota()  : mixed
MyXpannasuinfo()  : mixed
multimediafile()  : mixed
MyXpanmultimediafilemetas()  : mixed
MyXpanfilelistall()  : mixed
auth()  : mixed
MyOauthTokenAuthorizationCode()  : bool|OauthTokenAuthorizationCodeResponse
MyOauthTokenRefreshToken()  : mixed
MyOauthTokenDeviceCode()  : mixed
MyOauthTokenDeviceToken()  : mixed
filemanager()  : mixed
MyFilemanagercopy()  : mixed
MyFilemanagermove()  : mixed
MyFilemanagerrename()  : mixed
MyFilemanagerdelete()  : mixed
composerRequire5f0a856db0eb13be86d63b013a8d9e03()  : void
includeFile()  : void
Scope isolated include.
uri_template()  : string
Expands a URI template
describe_type()  : string
Debug function used to describe the provided value type and class.
headers_from_lines()  : array<string|int, mixed>
Parses an array of header lines into an associative array of headers.
debug_resource()  : resource
Returns a debug stream based on the provided variable.
choose_handler()  : callable
Chooses and creates a default handler to use based on the environment.
default_user_agent()  : string
Get the default User-Agent string to use with Guzzle
default_ca_bundle()  : string
Returns the default cacert bundle for the current system.
normalize_header_keys()  : array<string|int, mixed>
Creates an associative array of lowercase header names to the actual header casing.
is_host_in_noproxy()  : bool
Returns true if the provided host matches any of the no proxy areas.
json_decode()  : mixed
Wrapper for json_decode that throws when an error occurs.
json_encode()  : string
Wrapper for JSON encoding that throws when an error occurs.
queue()  : TaskQueueInterface
Get the global task queue used for promise resolution.
task()  : PromiseInterface
Adds a function to run in the task queue when it is next `run()` and returns a promise that is fulfilled or rejected with the result.
promise_for()  : PromiseInterface
Creates a promise for a value if the value is not a promise.
rejection_for()  : PromiseInterface
Creates a rejected promise for a reason if the reason is not a promise. If the provided reason is a promise, then it is returned as-is.
exception_for()  : Exception|Throwable
Create an exception for a rejected promise value.
iter_for()  : Iterator
Returns an iterator for the given value.
inspect()  : array<string|int, mixed>
Synchronously waits on a promise to resolve and returns an inspection state array.
inspect_all()  : array<string|int, mixed>
Waits on all of the provided promises, but does not unwrap rejected promises as thrown exception.
unwrap()  : array<string|int, mixed>
Waits on all of the provided promises and returns the fulfilled values.
all()  : PromiseInterface
Given an array of promises, return a promise that is fulfilled when all the items in the array are fulfilled.
some()  : PromiseInterface
Initiate a competitive race between multiple promises or values (values will become immediately fulfilled promises).
any()  : PromiseInterface
Like some(), with 1 as count. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly.
settle()  : PromiseInterface
Returns a promise that is fulfilled when all of the provided promises have been fulfilled or rejected.
each()  : PromiseInterface
Given an iterator that yields promises or values, returns a promise that is fulfilled with a null value when the iterator has been consumed or the aggregate promise has been fulfilled or rejected.
each_limit()  : PromiseInterface
Like each, but only allows a certain number of outstanding promises at any given time.
each_limit_all()  : PromiseInterface
Like each_limit, but ensures that no promise in the given $iterable argument is rejected. If any promise is rejected, then the aggregate promise is rejected with the encountered rejection.
is_fulfilled()  : bool
Returns true if a promise is fulfilled.
is_rejected()  : bool
Returns true if a promise is rejected.
is_settled()  : bool
Returns true if a promise is fulfilled or rejected.
coroutine()  : PromiseInterface
Create a new coroutine.
str()  : string
Returns the string representation of an HTTP message.
uri_for()  : UriInterface
Returns a UriInterface for the given value.
stream_for()  : StreamInterface
Create a new stream based on the input type.
parse_header()  : array<string|int, mixed>
Parse an array of header values containing ";" separated data into an array of associative arrays representing the header key value pair data of the header. When a parameter does not contain a value, but just contains a key, this function will inject a key with a '' string value.
normalize_header()  : array<string|int, mixed>
Converts an array of header values that may contain comma separated headers into an array of headers with no comma separated values.
modify_request()  : RequestInterface
Clone and modify a request with the given changes.
rewind_body()  : mixed
Attempts to rewind a message body and throws an exception on failure.
try_fopen()  : resource
Safely opens a PHP stream resource using a filename.
copy_to_string()  : string
Copy the contents of a stream into a string until the given number of bytes have been read.
copy_to_stream()  : mixed
Copy the contents of a stream into another stream until the given number of bytes have been read.
hash()  : string
Calculate a hash of a stream.
readline()  : string
Read a line from the stream up to the maximum allowed buffer length.
parse_request()  : Request
Parses a request message string into a request object.
parse_response()  : Response
Parses a response message string into a response object.
parse_query()  : array<string|int, mixed>
Parse a query string into an associative array.
build_query()  : string
Build a query string from an array of key value pairs.
mimetype_from_filename()  : string|null
Determines the mimetype of a file by looking at its extension.
mimetype_from_extension()  : string|null
Maps a file extensions to a mimetype.
get_message_body_summary()  : string|null
Get a short summary of the message body.
RandomCompat_strlen()  : int
strlen() implementation that isn't brittle to mbstring.func_overload
RandomCompat_substr()  : string
substr() implementation that isn't brittle to mbstring.func_overload
RandomCompat_intval()  : float|int
Cast to an integer if we can, safely.
random_bytes()  : string
We don't have any more options, so let's throw an exception right now and hope the developer won't let it fail silently.
random_bytes()  : string
Windows with PHP < 5.3.0 will not have the function openssl_random_pseudo_bytes() available, so let's use CAPICOM to work around this deficiency.
random_bytes()  : string
Unless open_basedir is enabled, use /dev/urandom for random numbers in accordance with best practices
random_bytes()  : string
If the libsodium PHP extension is loaded, we'll use it above any other solution.
random_bytes()  : string
If the libsodium PHP extension is loaded, we'll use it above any other solution.
random_bytes()  : string
Powered by ext/mcrypt (and thankfully NOT libmcrypt)
random_int()  : int
Fetch a random integer between $min and $max inclusive
getallheaders()  : mixed
Get all HTTP header key/values as an associative array for the current request.
idn_to_ascii()  : mixed
idn_to_utf8()  : mixed
normalizer_is_normalized()  : mixed
normalizer_normalize()  : mixed
intdiv()  : mixed
preg_replace_callback_array()  : mixed
error_clear_last()  : mixed
sapi_windows_vt100_support()  : mixed
stream_isatty()  : mixed
utf8_encode()  : mixed
utf8_decode()  : mixed
spl_object_id()  : mixed
mb_ord()  : mixed
mb_chr()  : mixed
mb_scrub()  : mixed
get_api_payment_weixin_query()  : mixed
微信订单查寻 在订单中要调用,用户检测是否支付成功 如果需要支付宝,那么要实现 get_api_payment_alipay_query
payment_weixin_refund()  : mixed
微信支付退款 如果需要支付宝,那么要实现 payment_alipay_refund
payemnt_insert_base()  : mixed
写入支付信息
get_payment_base()  : mixed
获取支付信息
get_payment_base_by_id()  : mixed
获取支付信息
update_payment_base()  : mixed
更新支付信息
insert_payment_refund_info()  : mixed
写入退款信息
get_webtool_wx()  : mixed
add_webtool_cmd_job()  : mixed
create_oss_remote_url()  : mixed
add_oss_info()  : mixed
webtool_log()  : mixed
update_webtool_log()  : mixed
set_webtool_printer_finish()  : mixed
close_webtool_printer_job()  : mixed
get_captcha_drive()  : mixed
get_captcha_check()  : mixed
get_captcha_init()  : mixed
element()  : mixed
element_to_str()  : mixed
element_vue()  : mixed
element_open_pdf()  : mixed
element_open_office()  : mixed
predis()  : mixed
redis
predis_add_geo()  : mixed
添加位置信息 predis_add_geo('places',[ [ 'lng'=>'116.397128', 'lat'=>'39.916527', 'title'=>'北京天安门' ], ]);
predis_delete_geo()  : mixed
删除位置信息
predis_get_pager()  : mixed
返回附近的地理位置 pr(predis_get_pager('places', 116.403958, 39.915049)); http://redisdoc.com/geo/georadius.html
predis_geo_pos()  : mixed
取lat lng
array_to_pager()  : mixed
分组分页
get_url_remove_http()  : mixed
返回URL路径,不含有域名部分
get_ext_by_url()  : mixed
取后缀 add_action("get_ext_by_url",function(&$data){ $url = $data['url']; $data['ext'] = 'pdf'; });
get_mime()  : mixed
通过URL取mime
get_mime_content()  : mixed
取mime
get_remote_file()  : mixed
获取远程URL内容
remove_host()  : mixed
移除主域名部分
download_file()  : mixed
下载文件 建议使用 download_file_safe
download_file_safe()  : mixed
下载资源文件到本地
download_remote_file()  : mixed
下载远程文件 global $remote_to_local_path; $remote_to_local_path = '/uploads/saved/'.date("Y-m-d");
curl_aliyun()  : mixed
调用阿里云
success_data()  : mixed
返回成功的json信息
error_data()  : mixed
返回失败的json信息
get_path_info()  : mixed
pathinfo /index.php/admin/auth/index?code=2 返回 admin/auth/index 数组时返回 ['admin','auth','index']
router_pathinfo()  : mixed
支持pathinfo路由 未找到请用 pathinfo_not_find 函数
make_rand_code()  : mixed
生成数字随机数 一般用于核销 需要表名 rand_code 字段 nid code status默认0
update_make_rand_code()  : mixed
核销后需要释放核销码
set_lock()  : mixed
锁功能已替代 lock_call('k',functon(){
get_lock()  : mixed
获取是否锁定
del_lock()  : mixed
释放锁定
json_replace()  : mixed
json数据替换
remove_php_notes()  : mixed
去除PHP代码注释
online_view_office()  : mixed
在线查看office文件
printfs()  : mixed
格式化输出金额 强制输出数字类型
float_noup()  : mixed
float不进位,如3.145 返回3.14 进位的有默认round(3.145) 或sprintf("%.2f",3.145);
float_up()  : mixed
四舍五入
load_xls()  : mixed
加载xlsx load_xls([ 'file' => $xls, 'config'=>[ '序号' =>'index', ], 'title_line'=>1, 'call'=>function($i,$row,&$d){} ]);
get_lines()  : mixed
获取文件行数,不包空行
get_request_top()  : mixed
返回请求中是http还是https
get_request_host()  : mixed
返回请求域名及URL部分,不包含http://
auto_jump()  : mixed
自动跳转到https网站
get_http_full_url()  : mixed
get_index_array_valule()  : mixed
从数组中搜索
gbk_substr()  : mixed
get_gbk_len()  : mixed
GBK长宽 2个字符
get_text_c()  : mixed
文字居中
get_text_lr()  : mixed
文字排版 左 中 右 左 右
allow_cross_origin()  : mixed
处理跨域
to_utf8()  : mixed
csv_reader()  : mixed
csv_writer()  : mixed
lock_call()  : mixed
基于redis锁
lock_start()  : mixed
开始锁
lock_end()  : mixed
释放锁
compare_date()  : mixed
redis_pub()  : mixed
发布消息 redis_pub("demo","welcome man"); redis_pub("demo",['title'=>'yourname']);
redis_sub()  : mixed
取订阅消息 redis_sub("demo",function($channel,$message){ echo "channel ".$channel."\n"; print_r($message); });
send_pusher()  : mixed
think_check_sign()  : mixed
think_create_sign()  : mixed
get_str_ord()  : mixed
gz_encode()  : mixed
gz_decode()  : mixed
html_to_pdf()  : mixed
get_barcode()  : mixed
https://github.com/picqer/php-barcode-generator/blob/main/src/BarcodeGenerator.php C128 C128A C128B C128C C93 EAN13 EAN8 EAN2
text_add_br()  : mixed
get_server_headers()  : mixed
output_js_css()  : mixed
file_parse()  : mixed
解析文件内容
show_number()  : mixed
优化数量显示 1.10显示为1.1 1.05显示为1.05 1.00显示为1
get_str_number()  : mixed
取字符中的数字
line_bezier()  : mixed
贝塞尔
num_to_chinese()  : mixed
数字转中文,非金额读法
get_video_time()  : mixed
获取本地音视频时长 https://github.com/JamesHeinrich/getID3 composer require james-heinrich/getid3
copy_dir()  : mixed
目录 复制到 另一个目录
unzip_tar()  : mixed
解压zip、7z、gz、tar、bz2包 yum -y install p7zip unar unzip
think_exec()  : mixed
exec
xml2array()  : mixed
_xml2array_node()  : mixed
array2xml()  : mixed
is_image_ext()  : mixed
是否是图片
is_video_ext()  : mixed
是否是视频
is_audio_ext()  : mixed
是否是音频
copy_base64_data()  : mixed
set_scss_path()  : mixed
scss()  : mixed
get_ws_js()  : mixed
HTML端收消息 wss://yourdomain/wss ws://ip:port
create_node_ws_server()  : mixed
生成node js ws服务 需要把返回的内容写入server.js中 依赖 ioredis
xis_ssl()  : mixed
xcookie()  : mixed
xcookie_delete()  : mixed
rpc_client()  : mixed
rpc_server()  : mixed
rpc_token()  : mixed
call_retry()  : mixed
尝试多次运行 $times 运行次数 $usleep_time 毫秒
array_to_tree()  : mixed
数组转tree
pr()  : mixed
数组或字符输出,方便查看
add_action()  : mixed
do_action()  : mixed
is_cli()  : mixed
is_post()  : mixed
is_json()  : mixed
array_to_object()  : mixed
object_to_array()  : mixed
get_dir()  : mixed
get_ext()  : mixed
get_name()  : mixed
create_dir_if_not_exists()  : mixed
is_local()  : mixed
get_ip()  : mixed
now()  : mixed
get_distance()  : mixed
get_deep_dir()  : mixed
price_format()  : mixed
json()  : mixed
json_error()  : mixed
json_success()  : mixed
yaml_load()  : mixed
yaml_dump()  : mixed
yaml()  : mixed
aes_encode()  : mixed
aes_decode()  : mixed
string_to_array()  : mixed
get_dates()  : mixed
get_date_china()  : mixed
timeago()  : mixed
is_ajax()  : mixed
import()  : mixed
get_reffer()  : mixed
get_root_domain()  : mixed
get_sub_domain()  : mixed
sign_by_secret()  : mixed
zip_extract()  : mixed
zip_create()  : mixed
is_json_request()  : mixed
array_to_el_select()  : mixed
echats()  : mixed
echats_reload()  : mixed
echarts()  : mixed
echarts_reload()  : mixed
set_field_allow()  : mixed
设置允许字段
get_field_allow()  : mixed
获取允许字段
get_data_allow()  : mixed
返回允许字段值
is_ssl()  : mixed
think_validate()  : mixed
validate()  : mixed
jump()  : mixed
set_url_use_cdn()  : mixed
对数组添加cdn url
push_task()  : mixed
添加到队列 "topthink/think-queue": "^3" push_task('app\printer\job\Printer',['tt'=>11],'');
loop_tree()  : mixed
向上取递归 如当前分类是3,将返回 123所有的值 $arr = loop_tree("catalog",$v['catalog_id'],true); foreach($arr as $vv){ $title[] = $vv['title']; } id pid 1 0 2 1 3 2
get_loop_tree_ids()  : mixed
向下递归
loop_del()  : mixed
递归删除
el_table_tree()  : mixed
用于tree表格排序 因为tree给的lists字段是用于显示,在排序时得到的index是不正确的, 此时需要lists_sort字段得到正确的index 在交换排序值时才能正确保存并显示
el_cascader()  : mixed
用于cascader字段 public function cascader(){ $catalog = db_get($this->table,"*",[ 'ORDER'=>catalog_default_order_by(), 'status'=>1 ]); $select = el_cascader(array_to_tree($catalog)); json_success(['data'=>$select]); } $catalog = db_get("catalog",[]); $select = el_cascader(array_to_tree($catalog));
_loop_del_tree()  : mixed
内部实现
_loop_tree_deep_inner()  : mixed
内部实现
get_xss_clean_ins()  : mixed
xss_clean_str()  : mixed
xss_clean()  : mixed
global_trim()  : mixed
global_trim_inner()  : mixed
get()  : mixed
get_req_post()  : mixed
g()  : mixed
get_input()  : mixed
guzzle_http()  : mixed
guzzle_http_fake_option()  : mixed
get_template()  : mixed
get_api_data()  : mixed
获取接口请求数据,如果存在将不发起接口请求
api_data_insert()  : mixed
记录接口请求数据
cookie()  : mixed
cookie_delete()  : mixed
get_env()  : mixed
获取ENV
set_env()  : mixed
设置ENV
set_config()  : mixed
get_config()  : mixed
get_id_by_auto_insert()  : mixed
设置或取ID
get_all_or_one()  : mixed
取一条或多条记录 get_all_or_one("novel_book",$where,'get_novel_book_row');
db_set_field_type()  : mixed
db_reset_data_by_filed_type()  : mixed
权限字段类型设置值
db_active()  : mixed
激活数据库连接
db_active_default()  : mixed
使用默认monogo连接
db_get_group()  : mixed
group by 查寻
_db_group_con()  : mixed
mongodb groupby兼容
db_update()  : mixed
数据库更新记录
db_del()  : mixed
数据库删除记录
db_insert()  : mixed
向数据库添加记录
_db_get_when_array()  : mixed
内部调用,处理 where条件是数组的情况
db_get_one()  : mixed
数据库查寻
set_db_cache()  : mixed
设置数据库查寻字段走缓存
get_db_cache_key()  : mixed
取缓存key
get_db_cache_where()  : mixed
取缓存where
db_get_cache()  : mixed
取数据,带缓存
db_get()  : mixed
取数据
db_get_count()  : mixed
数量
db_get_sum()  : mixed
计算SUM
db_pager()  : mixed
数据库分页
db_get_pager()  : mixed
分页
db_action()  : mixed
mongodb事务
mongo_action()  : mixed
db_allow()  : mixed
数据库字段允许
db_allow_set()  : mixed
设置允许字段
vue_get_jidu()  : mixed
季度 返回 k=>{0:开始 1:结束 flag:}
vue_get_jidu_array()  : mixed
每个季度开始、结束时间
vue_get_last_day()  : mixed
某月的最后一天
vue_message()  : mixed
vue message
vue_loading()  : mixed
loading效果
vue_el_table_drag()  : mixed
<el-table class="draggable_video"></el-table>
php_to_js()  : string
Encodes a PHP variable into javascript representation.
yii_quote()  : mixed

Constants

APP_FORM_PATH

public mixed APP_FORM_PATH = \VEN_ELEMENT_FORM_PATH

DS

public mixed DS = \DIRECTORY_SEPARATOR

HELPER_DIR

public mixed HELPER_DIR = __DIR__

IDNA_ALLOW_UNASSIGNED

public mixed IDNA_ALLOW_UNASSIGNED = 1

IDNA_CHECK_BIDI

public mixed IDNA_CHECK_BIDI = 4

IDNA_CHECK_CONTEXTJ

public mixed IDNA_CHECK_CONTEXTJ = 8

IDNA_ERROR_BIDI

public mixed IDNA_ERROR_BIDI = 2048

IDNA_ERROR_CONTEXTJ

public mixed IDNA_ERROR_CONTEXTJ = 4096

IDNA_ERROR_DISALLOWED

public mixed IDNA_ERROR_DISALLOWED = 128

IDNA_ERROR_DOMAIN_NAME_TOO_LONG

public mixed IDNA_ERROR_DOMAIN_NAME_TOO_LONG = 4

IDNA_ERROR_EMPTY_LABEL

public mixed IDNA_ERROR_EMPTY_LABEL = 1

IDNA_ERROR_HYPHEN_3_4

public mixed IDNA_ERROR_HYPHEN_3_4 = 32

IDNA_ERROR_INVALID_ACE_LABEL

public mixed IDNA_ERROR_INVALID_ACE_LABEL = 1024

IDNA_ERROR_LABEL_HAS_DOT

public mixed IDNA_ERROR_LABEL_HAS_DOT = 512

IDNA_ERROR_LABEL_TOO_LONG

public mixed IDNA_ERROR_LABEL_TOO_LONG = 2

IDNA_ERROR_LEADING_COMBINING_MARK

public mixed IDNA_ERROR_LEADING_COMBINING_MARK = 64

IDNA_ERROR_LEADING_HYPHEN

public mixed IDNA_ERROR_LEADING_HYPHEN = 8

IDNA_ERROR_PUNYCODE

public mixed IDNA_ERROR_PUNYCODE = 256

IDNA_ERROR_TRAILING_HYPHEN

public mixed IDNA_ERROR_TRAILING_HYPHEN = 16

IDNA_NONTRANSITIONAL_TO_ASCII

public mixed IDNA_NONTRANSITIONAL_TO_ASCII = 16

IDNA_NONTRANSITIONAL_TO_UNICODE

public mixed IDNA_NONTRANSITIONAL_TO_UNICODE = 32

IDNA_USE_STD3_RULES

public mixed IDNA_USE_STD3_RULES = 2

INTL_IDNA_VARIANT_2003

public mixed INTL_IDNA_VARIANT_2003 = 0

INTL_IDNA_VARIANT_UTS46

public mixed INTL_IDNA_VARIANT_UTS46 = 1

PHP_FLOAT_DIG

public mixed PHP_FLOAT_DIG = 15

PHP_FLOAT_EPSILON

public mixed PHP_FLOAT_EPSILON = 2.2204460492503E-16

PHP_FLOAT_MAX

public mixed PHP_FLOAT_MAX = 1.7976931348623157E+308

PHP_FLOAT_MIN

public mixed PHP_FLOAT_MIN = 2.2250738585072E-308

PHP_INT_MIN

public mixed PHP_INT_MIN = ~\PHP_INT_MAX

PHP_OS_FAMILY

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

PHP_VERSION_ID

public mixed PHP_VERSION_ID = $RandomCompatversion[0] * 10000 + $RandomCompatversion[1] * 100 + $RandomCompatversion[2]

RANDOM_COMPAT_READ_BUFFER

public mixed RANDOM_COMPAT_READ_BUFFER = 8

thefunpower_mongo_dir

public mixed thefunpower_mongo_dir = __DIR__

U_IDNA_ACE_PREFIX_ERROR

public mixed U_IDNA_ACE_PREFIX_ERROR = 66564

U_IDNA_CHECK_BIDI_ERROR

public mixed U_IDNA_CHECK_BIDI_ERROR = 66562

U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR

public mixed U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR = 66568

U_IDNA_ERROR_LIMIT

public mixed U_IDNA_ERROR_LIMIT = 66569

U_IDNA_ERROR_START

public mixed U_IDNA_ERROR_START = 66560

U_IDNA_LABEL_TOO_LONG_ERROR

public mixed U_IDNA_LABEL_TOO_LONG_ERROR = 66566

U_IDNA_PROHIBITED_ERROR

public mixed U_IDNA_PROHIBITED_ERROR = 66560

U_IDNA_STD3_ASCII_RULES_ERROR

public mixed U_IDNA_STD3_ASCII_RULES_ERROR = 66563

U_IDNA_UNASSIGNED_ERROR

public mixed U_IDNA_UNASSIGNED_ERROR = 66561

U_IDNA_VERIFICATION_ERROR

public mixed U_IDNA_VERIFICATION_ERROR = 66565

U_IDNA_ZERO_LENGTH_LABEL_ERROR

public mixed U_IDNA_ZERO_LENGTH_LABEL_ERROR = 66567

U_STRINGPREP_CHECK_BIDI_ERROR

public mixed U_STRINGPREP_CHECK_BIDI_ERROR = 66562

U_STRINGPREP_PROHIBITED_ERROR

public mixed U_STRINGPREP_PROHIBITED_ERROR = 66560

U_STRINGPREP_UNASSIGNED_ERROR

public mixed U_STRINGPREP_UNASSIGNED_ERROR = 66561

VEN_ELEMENT_FORM_PATH

public mixed VEN_ELEMENT_FORM_PATH = __DIR__ . '/form'

Functions

in_api()

判断在api接口中

in_api() : mixed

get_app_header()

取header

get_app_header([mixed $name = '' ]) : mixed
Parameters
$name : mixed = ''

is_app_req()

使用header判断是app接口请求

is_app_req() : mixed

get_m_c_a()

取模块、控制器、动作

get_m_c_a() : mixed

get_module_list()

模块列表

get_module_list() : mixed

has_module()

是否存在模块

has_module(mixed $name) : mixed
Parameters
$name : mixed

is_app_api_req()

是否是api控制器请求

is_app_api_req() : mixed

index_url()

index_url().'/scrm/site/index' 配置 index_url 如 $config['index_url'] = 'index.php';

index_url() : mixed

set_menu_group()

set_menu_group(mixed $name, mixed $arr[, mixed $level = 1 ]) : mixed
Parameters
$name : mixed
$arr : mixed
$level : mixed = 1

get_login_cid()

获取unipush的cid 用于推送

get_login_cid(mixed $user_id) : mixed
Parameters
$user_id : mixed

create_user_by_openid()

用openid创建帐号

create_user_by_openid(mixed $openid[, mixed $type = 'weixin' ]) : mixed
Parameters
$openid : mixed
$type : mixed = 'weixin'

get_user_by_phone()

根据手机号获取帐号,如不存在支持创建帐号

get_user_by_phone(mixed $phone[, mixed $create_if_not_find = false ][, mixed $openid = '' ]) : mixed
Parameters
$phone : mixed
$create_if_not_find : mixed = false
$openid : mixed = ''

set_user_token()

获取手机号后设置token

set_user_token(mixed $one) : mixed
Parameters
$one : mixed

set_user_openid()

记录用户的openid

set_user_openid(mixed $openid[, mixed $data = [] ][, mixed $type = 'weixin' ]) : mixed
Parameters
$openid : mixed
$data : mixed = []
$type : mixed = 'weixin'

get_user_openid()

取用户OPENID

get_user_openid(mixed $openid[, mixed $type = 'weixin' ]) : mixed
Parameters
$openid : mixed
$type : mixed = 'weixin'

get_user_avatar_url()

处理用户头像、昵称

get_user_avatar_url(mixed &$user) : mixed
Parameters
$user : mixed

get_comment_status()

get_comment_status() : mixed

get_comment_status_color()

get_comment_status_color() : mixed

get_comment()

取一条评论信息

get_comment(mixed $id) : mixed
Parameters
$id : mixed

get_comments()

获取评论

get_comments(mixed $type[, mixed $where = [] ]) : mixed
Parameters
$type : mixed
$where : mixed = []

get_comment_row()

comment row

get_comment_row(mixed &$v) : mixed
Parameters
$v : mixed

add_comment()

添加评论

add_comment(mixed $type[, mixed $arr = [] ][, mixed $response_json = false ]) : mixed
Parameters
$type : mixed
$arr : mixed = []
$response_json : mixed = false

update_comment()

更新评论

update_comment(mixed $id[, mixed $where = [] ][, mixed $update_data = [] ][, mixed $response_json = false ]) : mixed
Parameters
$id : mixed
$where : mixed = []
$update_data : mixed = []
$response_json : mixed = false

get_media_by_url()

取资源信息

get_media_by_url(mixed $url) : mixed
Parameters
$url : mixed

applet_image_init()

https://image.intervention.io/v2/introduction/installation

applet_image_init() : mixed

get_notify()

获取提醒

get_notify(mixed $user_id, mixed $type) : mixed
Parameters
$user_id : mixed
$type : mixed

read_notify()

已读

read_notify(mixed $user_id, mixed $type[, mixed $id = '' ]) : mixed
Parameters
$user_id : mixed
$type : mixed
$id : mixed = ''

get_notify_count()

获取未读数量

get_notify_count(mixed $user_id, mixed $type) : mixed
Parameters
$user_id : mixed
$type : mixed

add_notify()

添加提醒

add_notify(mixed $user_id, mixed $type, mixed $title, mixed $body[, mixed $par = [] ]) : mixed
Parameters
$user_id : mixed
$type : mixed
$title : mixed
$body : mixed
$par : mixed = []

applet_image_resize()

图片缩放

applet_image_resize(mixed $url[, mixed $w = '' ][, mixed $h = '' ][, mixed $result_local = false ]) : mixed
Parameters
$url : mixed
$w : mixed = ''
$h : mixed = ''
$result_local : mixed = false

applet_create_qr()

生成二维码 content title logo name brower 其中 brower=>1时不生成文件 applet_create_qr([ 'title'=>'', 'content'=>'', 'brower'=>1, 'size'=>100, //不用CDN地址,直接返回本地相对地址 'no_cdn'=>1, ]);

applet_create_qr([mixed $arr = [] ][, mixed $dir_name = '' ]) : mixed
Parameters
$arr : mixed = []
$dir_name : mixed = ''

get_rand_jp()

用户抽奖 $prize_arr = array( array('node_id'=>1,'prize'=>'平板电脑','v'=>10,'num'=>3), array('node_id'=>2,'prize'=>'数码相机','v'=>10,'num'=>1), ); $nid = 1; pr(get_rand_jp(100,$nid,$prize_arr));

get_rand_jp(mixed $user_id, mixed $nid, mixed $jp_arr) : mixed
Parameters
$user_id : mixed
$nid : mixed
$jp_arr : mixed

_get_rand_jp()

_get_rand_jp(mixed $arr) : mixed
Parameters
$arr : mixed

get_pf_amount()

平分金额

get_pf_amount(mixed $amount, mixed $num) : mixed
Parameters
$amount : mixed
$num : mixed

get_rand_amount()

随机金额

get_rand_amount(mixed $amount, mixed $num[, mixed $is_frist = true ]) : mixed
Parameters
$amount : mixed
$num : mixed
$is_frist : mixed = true

applet_qr_parse()

applet_qr_parse(mixed $input) : mixed
Parameters
$input : mixed

applet_barcode()

条形码 composer require picqer/php-barcode-generator

applet_barcode(mixed $code) : mixed
Parameters
$code : mixed

applet_check_captch_tencent()

腾讯云验证码

applet_check_captch_tencent() : mixed

applet_use_captch_tencent()

applet_use_captch_tencent() : mixed

get_phone_send_vue()

VUE 验证 腾讯验证码或者图形验证码

get_phone_send_vue([mixed $opt = [] ]) : mixed
Parameters
$opt : mixed = []

get_phone_send_form()

get_phone_send_form() : mixed

get_blog_status()

get_blog_status() : mixed

get_blog_status_color()

get_blog_status_color() : mixed

get_blog()

get_blog(mixed $id) : mixed
Parameters
$id : mixed

get_blog_row()

get_blog_row(mixed &$v) : mixed
Parameters
$v : mixed

get_like_pager()

get_like_pager(mixed $user_id) : mixed
Parameters
$user_id : mixed

get_like_blog()

是否是我喜欢的 当user_id为空,且limit>1时,返回blog被喜欢的数组

get_like_blog(mixed $blog_id[, mixed $user_id = '' ][, mixed $limit = 1 ]) : mixed
Parameters
$blog_id : mixed
$user_id : mixed = ''
$limit : mixed = 1

get_like_blog_pager()

对动态点赞的会员

get_like_blog_pager(mixed $blog_id) : mixed
Parameters
$blog_id : mixed

get_like_blog_count()

喜欢数量

get_like_blog_count(mixed $blog_id) : mixed
Parameters
$blog_id : mixed

like_blog()

喜欢或取消喜欢

like_blog(mixed $blog_id, mixed $user_id) : mixed
Parameters
$blog_id : mixed
$user_id : mixed

get_follow_blog_count()

关注数量

get_follow_blog_count(mixed $user_id) : mixed
Parameters
$user_id : mixed

get_blog_follow_user()

就否关注

get_blog_follow_user(mixed $user_id, mixed $my_user_id) : mixed
Parameters
$user_id : mixed
$my_user_id : mixed

follow_blog()

关注

follow_blog(mixed $user_id, mixed $my_user_id) : mixed
Parameters
$user_id : mixed
$my_user_id : mixed

blog_antiporn()

文本+图片审核

blog_antiporn(mixed $content[, mixed $images = [] ]) : mixed
Parameters
$content : mixed
$images : mixed = []

del_node()

删除node

del_node(mixed $cck_name, mixed $where) : mixed
Parameters
$cck_name : mixed
$where : mixed

get_nodes()

多条记录

get_nodes(mixed $cck_name, mixed $where) : mixed
Parameters
$cck_name : mixed
$where : mixed

get_node()

一条记录

get_node(mixed $cck_name, mixed $where) : mixed
Parameters
$cck_name : mixed
$where : mixed

get_cck_field()

get_cck_field(mixed $cck_name) : mixed
Parameters
$cck_name : mixed

get_cck_field_by_builder()

get_cck_field_by_builder(mixed $builder) : mixed
Parameters
$builder : mixed

update_node()

强制更新数据

update_node(mixed $cck_name, mixed $data, mixed $where) : mixed
Parameters
$cck_name : mixed
$data : mixed
$where : mixed

save_node()

保存node

save_node(mixed $cck_name, mixed $input[, mixed $ret_json = false ]) : mixed
Parameters
$cck_name : mixed
$input : mixed
$ret_json : mixed = false

get_node_more_field()

追回其他字段

get_node_more_field(mixed &$field) : mixed
Parameters
$field : mixed

get_node_data_filter()

数据处理

get_node_data_filter(mixed $cck_name, mixed $input) : mixed
Parameters
$cck_name : mixed
$input : mixed

get_node_pager()

cck分页

get_node_pager(mixed $cck_name[, mixed $where = [] ][, mixed $input = '' ]) : mixed
Parameters
$cck_name : mixed
$where : mixed = []
$input : mixed = ''

get_node_tree()

cck tree

get_node_tree(mixed $cck_name[, mixed $where = [] ][, mixed $input = '' ]) : mixed
Parameters
$cck_name : mixed
$where : mixed = []
$input : mixed = ''

get_cck_table()

node 表名 ,添加 node_

get_cck_table(mixed $cck_name) : mixed
Parameters
$cck_name : mixed

remove_cck_table()

node 表名,移除node_

remove_cck_table(mixed $cck_name) : mixed
Parameters
$cck_name : mixed

get_init_cck()

cck init

get_init_cck(mixed $cck_name) : mixed
Parameters
$cck_name : mixed

get_node_where()

分页、列表统一处理where

get_node_where(mixed $builder, mixed &$where) : mixed
Parameters
$builder : mixed
$where : mixed

get_cck_author_where()

仅操作自己

get_cck_author_where(mixed $cck_name, mixed &$where[, mixed $auth_type = 'auth_view' ]) : mixed
Parameters
$cck_name : mixed
$where : mixed
$auth_type : mixed = 'auth_view'

form_builder_field()

$filed = form_builder_field('fn or name',$old_field); set_field_allow('scrm_customer',$field);

form_builder_field(mixed $name, mixed $old_field) : mixed
Parameters
$name : mixed
$old_field : mixed

form_builder()

构建表单 使用 /form/builder

form_builder(mixed $name[, mixed $ret_allow_field = false ]) : mixed
Parameters
$name : mixed
$ret_allow_field : mixed = false

form_create()

form_create(mixed $arr) : mixed
Parameters
$arr : mixed

form_field_type()

builder 字段

form_field_type() : mixed

merge_form_field()

合并原字段及自定义字段

merge_form_field([mixed $field = [] ][, mixed $form = [] ]) : mixed
Parameters
$field : mixed = []
$form : mixed = []

get_city_area()

省市区 由命令行 php think get_city --ansi 生成

get_city_area() : mixed

form_get_city()

同 get_city_area()

form_get_city() : mixed

__()

think_validate https://github.com/vlucas/valitron

__(mixed $str) : mixed
Parameters
$str : mixed

cache()

缓存 加前缀 CACHE_PRE

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

table_sortable()

table_sortable(mixed $id, mixed $vue_method) : mixed
Parameters
$id : mixed
$vue_method : mixed

is_admin()

判断是超管

is_admin([mixed $user_id = '' ]) : mixed
Parameters
$user_id : mixed = ''

is_admin_login()

判断是普通管理员

is_admin_login() : mixed

get_admin_user()

取管理员信息

get_admin_user([mixed $user_id = '' ]) : mixed
Parameters
$user_id : mixed = ''

get_user()

取用户信息

get_user([mixed $user_id = '' ]) : mixed
Parameters
$user_id : mixed = ''

admin_header()

admin_header() : mixed
admin_footer() : mixed

admin_access_to_yunyin()

管理员权限同步给运营

admin_access_to_yunyin([mixed $allow = [] ]) : mixed

admin_access_to_yunyin([ 'replenish', ]); add_admin_access('缺货补货.replenish',[ '查看.view', '编辑.edit', '管理.admin', 'url'=>'selling_machine/replenish' ],100);

Parameters
$allow : mixed = []

admin_access()

管理员权限

admin_access(mixed $name[, mixed $user_id = '' ]) : mixed
Parameters
$name : mixed
$user_id : mixed = ''

add_admin_access()

add_admin_access(mixed $key[, mixed $array = [] ][, mixed $level = 0 ]) : mixed
Parameters
$key : mixed
$array : mixed = []
$level : mixed = 0

get_admin_access_table()

get_admin_access_table() : mixed

get_admin_access()

get_admin_access() : mixed

get_admin_access_menu()

get_admin_access_menu([mixed $user_id = '' ]) : mixed
Parameters
$user_id : mixed = ''

think_vue_media_button()

think_vue_media_button([mixed $name = 'images' ][, mixed $top = 'form' ][, mixed $image_click = '' ]) : mixed
Parameters
$name : mixed = 'images'
$top : mixed = 'form'
$image_click : mixed = ''

think_vue_media_one_button()

think_vue_media_one_button([mixed $name = 'images' ][, mixed $top = 'form' ][, mixed $show_del = false ]) : mixed
Parameters
$name : mixed = 'images'
$top : mixed = 'form'
$show_del : mixed = false

think_vue_media()

think_vue_media(mixed &$vue[, mixed $js = "this.$set(this.form,'image',v);" ][, mixed $check_js = '' ]) : mixed
Parameters
$vue : mixed
$js : mixed = "this.$set(this.form,'image',v);"
$check_js : mixed = ''

app_boot()

app_boot() : mixed

order_num()

order_num() : mixed

insert_trace()

记录日志

insert_trace([mixed $arr = [] ][, mixed $type = 'order' ]) : mixed
Parameters
$arr : mixed = []
$type : mixed = 'order'

get_trace()

获取操作记录

get_trace([mixed $type = 'order' ][, mixed $where = [] ]) : mixed
Parameters
$type : mixed = 'order'
$where : mixed = []

star_phone()

手机号显示 ****

star_phone(mixed $phone) : mixed
Parameters
$phone : mixed

vue_add_media_muit()

多图上传

vue_add_media_muit([mixed $form = 'form.images' ]) : mixed
Parameters
$form : mixed = 'form.images'

vue_add_media()

单图上传

vue_add_media([mixed $form = 'form.images' ]) : mixed
Parameters
$form : mixed = 'form.images'

rpc_server_auth()

检测RPC服务是否可用 $client = rpc_client($url); $info = $client->get_info([ 'device_id'=>'', 'device_key'=>'', ]);

rpc_server_auth() : mixed

rpc()

调用远程RPC服务,如果远程的应用模块需要放在本地,可以把远程的模块复制到本项目下。 然后把数据库中对应的RPC URL删除,不需要改动其他代码,就可以不发起远程调用,而直接调用本地函数

rpc(mixed $url) : mixed
Parameters
$url : mixed

format_money()

格式化数字 因mongodb对字段类型要求严格

format_money(mixed $money) : mixed
Parameters
$money : mixed

rand_password()

生成安全的随机密码函数

rand_password([mixed $length = 12 ]) : mixed
Parameters
$length : mixed = 12

view()

view

view([string $template = '' ][, mixed $vars = [] ]) : mixed
Parameters
$template : string = ''
$vars : mixed = []

common_init()

初始化RPC请求参数及Redis

common_init() : mixed

get_allow_mime()

获取允许上传的mime

get_allow_mime() : mixed

file_upload_button()

文件上传 不同于图片上传,文件上传仅支持点击按钮直接上传,不支持从文件库中选择文件

file_upload_button(mixed $label[, mixed $method = 'file_upload_success' ][, mixed $accept = '' ][, mixed $is_multiple = false ][, mixed $url = '/admin/media/upload' ]) : mixed

file_upload_button('重新上传','file_upload_success','pdf')

$vue->method("file_upload_success(res, file, fileList)"," if(res.data[0]){ _this.$message.success('上传成功'); _this.form.file = res.data[0]; }else{ _this.$message.error('操作异常'); } ");

Parameters
$label : mixed
$method : mixed = 'file_upload_success'
$accept : mixed = ''
$is_multiple : mixed = false
$url : mixed = '/admin/media/upload'

google_authenticator()

GOOGLE验证器 验证

google_authenticator(mixed $google_captcha, mixed $user) : mixed
Parameters
$google_captcha : mixed
$user : mixed

google_authenticator_create()

GOOGLE验证器 生成secret

google_authenticator_create(mixed $name[, mixed $title = null ]) : mixed
Parameters
$name : mixed
$title : mixed = null

set_record()

记录

set_record(mixed $type[, mixed $data = [] ]) : mixed
Parameters
$type : mixed
$data : mixed = []

get_record()

获取记录

get_record(mixed $type[, mixed $where = [] ]) : mixed
Parameters
$type : mixed
$where : mixed = []

load_app_php()

加载 app/目录/app.php文件

load_app_php() : mixed

load_hook_php()

加载 hook/目录/hook.php文件

load_hook_php() : mixed

get_node_fav_is()

处理常用的主题收藏等类似操作。 是否收藏

get_node_fav_is(mixed $nid, mixed $user_id[, mixed $type = 'default' ]) : mixed
Parameters
$nid : mixed
$user_id : mixed
$type : mixed = 'default'

get_node_favs()

收藏列表

get_node_favs(mixed $user_id[, mixed $type = 'default' ]) : mixed
Parameters
$user_id : mixed
$type : mixed = 'default'

get_node_fav_count()

主题 收藏数量

get_node_fav_count(mixed $nid[, mixed $type = 'default' ]) : mixed
Parameters
$nid : mixed
$type : mixed = 'default'

set_node_fav()

收藏或取消收藏

set_node_fav(mixed $nid, mixed $user_id[, mixed $type = 'default' ]) : mixed
Parameters
$nid : mixed
$user_id : mixed
$type : mixed = 'default'

get_user_tag()

get_user_tag([mixed $user_id = '' ]) : mixed
Parameters
$user_id : mixed = ''

cdn_url()

cdn_url() : mixed

add_cdn_url()

设置CDN # CDN 激活 active_cdn = 1 # CDN 地址 支持以,分隔 CDN_URL = https://mac1.qihetaiji.com,https://mac.qihetaiji.com

add_cdn_url(mixed $url[, mixed $resize = '' ]) : mixed
Parameters
$url : mixed
$resize : mixed = ''

get_admin_tag()

get_admin_tag() : mixed

llc_encode()

使用公钥加密

llc_encode(mixed $data) : mixed

pr(llc_encode([ 'url'=>'xda.icu', 'exp_title'=>'永久', 'exp_time'=>'9999-12-31', ]));

Parameters
$data : mixed

llc_decode()

使用私钥解密 用户只保留了私钥。

llc_decode([mixed $data = '' ]) : mixed
Parameters
$data : mixed = ''

llc_powerby()

llc_powerby() : mixed

mp_jieba()

分词

mp_jieba(mixed $text) : mixed
Parameters
$text : mixed

mp_init()

mp_init() : mixed

get_mp_config()

get_mp_config() : mixed

mp_create_qr()

二维码 QR_SCENE 临时二维码 QR_LIMIT_SCENE永久二维码

mp_create_qr(mixed $scene_code[, mixed $action_name = 'QR_LIMIT_SCENE' ]) : mixed
Parameters
$scene_code : mixed
$action_name : mixed = 'QR_LIMIT_SCENE'

mp_get_user_info()

获取用户基本信息(UnionID机制) https://developers.weixin.qq.com/doc/offiaccount/User_Management/Get_users_basic_information_UnionID.html#UinonId openid、subscribe、unionid、qr_scene、qr_scene_str subscribe 1已关注

mp_get_user_info(mixed $openid) : mixed
Parameters
$openid : mixed

get_oauth2_wps_title()

get_oauth2_wps_title(mixed $url) : mixed
Parameters
$url : mixed

get_oauth2_page_header()

get_oauth2_page_header([mixed $title = '' ]) : mixed
Parameters
$title : mixed = ''
get_oauth2_page_footer() : mixed

publish_oauth2_img()

publish_oauth2_img() : mixed

get_oauth2_access_token()

get_oauth2_access_token([mixed $where = [] ]) : mixed
Parameters
$where : mixed = []

get_oauth2_access_token_by_state()

get_oauth2_access_token_by_state([mixed $state = 'weixin:' ]) : mixed
Parameters
$state : mixed = 'weixin:'

MyPcssuperfile2()

MyPcssuperfile2(mixed $uplodidTmp) : mixed
Parameters
$uplodidTmp : mixed

MyXpanfilecreate()

MyXpanfilecreate(mixed $uplodidTmp) : mixed
Parameters
$uplodidTmp : mixed

MyXpanfileimagelist()

MyXpanfileimagelist() : mixed

MyXpanfiledoclist()

MyXpanfiledoclist() : mixed

MyXpanfilesearch()

MyXpanfilesearch() : mixed

MyXpanfilelist()

MyXpanfilelist() : mixed

MyXpannasuinfo()

MyXpannasuinfo() : mixed

multimediafile()

multimediafile() : mixed

MyXpanmultimediafilemetas()

MyXpanmultimediafilemetas() : mixed

MyXpanfilelistall()

MyXpanfilelistall() : mixed

MyOauthTokenRefreshToken()

MyOauthTokenRefreshToken(mixed $rToken) : mixed
Parameters
$rToken : mixed

MyOauthTokenDeviceCode()

MyOauthTokenDeviceCode() : mixed

MyOauthTokenDeviceToken()

MyOauthTokenDeviceToken(mixed $codeTmp) : mixed
Parameters
$codeTmp : mixed

MyFilemanagercopy()

MyFilemanagercopy() : mixed

MyFilemanagermove()

MyFilemanagermove() : mixed

MyFilemanagerrename()

MyFilemanagerrename() : mixed

MyFilemanagerdelete()

MyFilemanagerdelete() : mixed

composerRequire5f0a856db0eb13be86d63b013a8d9e03()

composerRequire5f0a856db0eb13be86d63b013a8d9e03(string $fileIdentifier, string $file) : void
Parameters
$fileIdentifier : string
$file : string

includeFile()

Scope isolated include.

includeFile(string $file) : void

Prevents access to $this/self from included files.

Parameters
$file : string
Tags
private

uri_template()

Expands a URI template

uri_template(string $template, array<string|int, mixed> $variables) : string
Parameters
$template : string

URI template

$variables : array<string|int, mixed>

Template variables

Return values
string

describe_type()

Debug function used to describe the provided value type and class.

describe_type(mixed $input) : string
Parameters
$input : mixed
Return values
string

Returns a string containing the type of the variable and if a class is provided, the class name.

headers_from_lines()

Parses an array of header lines into an associative array of headers.

headers_from_lines(iterable<string|int, mixed> $lines) : array<string|int, mixed>
Parameters
$lines : iterable<string|int, mixed>

Header lines array of strings in the following format: "Name: Value"

Return values
array<string|int, mixed>

debug_resource()

Returns a debug stream based on the provided variable.

debug_resource([mixed $value = null ]) : resource
Parameters
$value : mixed = null

Optional value

Return values
resource

choose_handler()

Chooses and creates a default handler to use based on the environment.

choose_handler() : callable

The returned handler is not wrapped by any default middlewares.

Tags
throws
RuntimeException

if no viable Handler is available.

Return values
callable

Returns the best handler for the given system.

default_user_agent()

Get the default User-Agent string to use with Guzzle

default_user_agent() : string
Return values
string

default_ca_bundle()

Returns the default cacert bundle for the current system.

default_ca_bundle() : string

First, the openssl.cafile and curl.cainfo php.ini settings are checked. If those settings are not configured, then the common locations for bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X and Windows are checked. If any of these file locations are found on disk, they will be utilized.

Note: the result of this function is cached for subsequent calls.

Tags
throws
RuntimeException

if no bundle can be found.

Return values
string

normalize_header_keys()

Creates an associative array of lowercase header names to the actual header casing.

normalize_header_keys(array<string|int, mixed> $headers) : array<string|int, mixed>
Parameters
$headers : array<string|int, mixed>
Return values
array<string|int, mixed>

is_host_in_noproxy()

Returns true if the provided host matches any of the no proxy areas.

is_host_in_noproxy(string $host, array<string|int, mixed> $noProxyArray) : bool

This method will strip a port from the host if it is present. Each pattern can be matched with an exact match (e.g., "foo.com" == "foo.com") or a partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == "baz.foo.com", but ".foo.com" != "foo.com").

Areas are matched in the following cases:

  1. "*" (without quotes) always matches any hosts.
  2. An exact match.
  3. The area starts with "." and the area is the last part of the host. e.g. '.mit.edu' will match any host that ends with '.mit.edu'.
Parameters
$host : string

Host to check against the patterns.

$noProxyArray : array<string|int, mixed>

An array of host patterns.

Return values
bool

json_decode()

Wrapper for json_decode that throws when an error occurs.

json_decode(string $json[, bool $assoc = false ][, int $depth = 512 ][, int $options = 0 ]) : mixed
Parameters
$json : string

JSON data to parse

$assoc : bool = false

When true, returned objects will be converted into associative arrays.

$depth : int = 512

User specified recursion depth.

$options : int = 0

Bitmask of JSON decode options.

Tags
throws
InvalidArgumentException

if the JSON cannot be decoded.

link
http://www.php.net/manual/en/function.json-decode.php

json_encode()

Wrapper for JSON encoding that throws when an error occurs.

json_encode(mixed $value[, int $options = 0 ][, int $depth = 512 ]) : string
Parameters
$value : mixed

The value being encoded

$options : int = 0

JSON encode option bitmask

$depth : int = 512

Set the maximum depth. Must be greater than zero.

Tags
throws
InvalidArgumentException

if the JSON cannot be encoded.

link
http://www.php.net/manual/en/function.json-encode.php
Return values
string

queue()

Get the global task queue used for promise resolution.

queue([TaskQueueInterface $assign = null ]) : TaskQueueInterface

This task queue MUST be run in an event loop in order for promises to be settled asynchronously. It will be automatically run when synchronously waiting on a promise.

while ($eventLoop->isRunning()) { GuzzleHttp\Promise\queue()->run(); }
Parameters
$assign : TaskQueueInterface = null

Optionally specify a new queue instance.

Tags
deprecated

queue will be removed in guzzlehttp/promises:2.0. Use Utils::queue instead.

Return values
TaskQueueInterface

task()

Adds a function to run in the task queue when it is next `run()` and returns a promise that is fulfilled or rejected with the result.

task(callable $task) : PromiseInterface
Parameters
$task : callable

Task function to run.

Tags
deprecated

task will be removed in guzzlehttp/promises:2.0. Use Utils::task instead.

Return values
PromiseInterface

promise_for()

Creates a promise for a value if the value is not a promise.

promise_for(mixed $value) : PromiseInterface
Parameters
$value : mixed

Promise or value.

Tags
deprecated

promise_for will be removed in guzzlehttp/promises:2.0. Use Create::promiseFor instead.

Return values
PromiseInterface

rejection_for()

Creates a rejected promise for a reason if the reason is not a promise. If the provided reason is a promise, then it is returned as-is.

rejection_for(mixed $reason) : PromiseInterface
Parameters
$reason : mixed

Promise or reason.

Tags
deprecated

rejection_for will be removed in guzzlehttp/promises:2.0. Use Create::rejectionFor instead.

Return values
PromiseInterface

exception_for()

Create an exception for a rejected promise value.

exception_for(mixed $reason) : Exception|Throwable
Parameters
$reason : mixed
Tags
deprecated

exception_for will be removed in guzzlehttp/promises:2.0. Use Create::exceptionFor instead.

Return values
Exception|Throwable

iter_for()

Returns an iterator for the given value.

iter_for(mixed $value) : Iterator
Parameters
$value : mixed
Tags
deprecated

iter_for will be removed in guzzlehttp/promises:2.0. Use Create::iterFor instead.

Return values
Iterator

inspect()

Synchronously waits on a promise to resolve and returns an inspection state array.

inspect(PromiseInterface $promise) : array<string|int, mixed>

Returns a state associative array containing a "state" key mapping to a valid promise state. If the state of the promise is "fulfilled", the array will contain a "value" key mapping to the fulfilled value of the promise. If the promise is rejected, the array will contain a "reason" key mapping to the rejection reason of the promise.

Parameters
$promise : PromiseInterface

Promise or value.

Tags
deprecated

inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspect instead.

Return values
array<string|int, mixed>

inspect_all()

Waits on all of the provided promises, but does not unwrap rejected promises as thrown exception.

inspect_all(array<string|int, PromiseInterface$promises) : array<string|int, mixed>

Returns an array of inspection state arrays.

Parameters
$promises : array<string|int, PromiseInterface>

Traversable of promises to wait upon.

Tags
see
inspect

for the inspection state array format.

deprecated

inspect will be removed in guzzlehttp/promises:2.0. Use Utils::inspectAll instead.

Return values
array<string|int, mixed>

unwrap()

Waits on all of the provided promises and returns the fulfilled values.

unwrap(iterable<string|int, PromiseInterface$promises) : array<string|int, mixed>

Returns an array that contains the value of each promise (in the same order the promises were provided). An exception is thrown if any of the promises are rejected.

Parameters
$promises : iterable<string|int, PromiseInterface>

Iterable of PromiseInterface objects to wait on.

Tags
throws
Exception

on error

throws
Throwable

on error in PHP >=7

deprecated

unwrap will be removed in guzzlehttp/promises:2.0. Use Utils::unwrap instead.

Return values
array<string|int, mixed>

all()

Given an array of promises, return a promise that is fulfilled when all the items in the array are fulfilled.

all(mixed $promises[, bool $recursive = false ]) : PromiseInterface

The promise's fulfillment value is an array with fulfillment values at respective positions to the original array. If any promise in the array rejects, the returned promise is rejected with the rejection reason.

Parameters
$promises : mixed

Promises or values.

$recursive : bool = false

If true, resolves new promises that might have been added to the stack during its own resolution.

Tags
deprecated

all will be removed in guzzlehttp/promises:2.0. Use Utils::all instead.

Return values
PromiseInterface

some()

Initiate a competitive race between multiple promises or values (values will become immediately fulfilled promises).

some(int $count, mixed $promises) : PromiseInterface

When count amount of promises have been fulfilled, the returned promise is fulfilled with an array that contains the fulfillment values of the winners in order of resolution.

This promise is rejected with a AggregateException if the number of fulfilled promises is less than the desired $count.

Parameters
$count : int

Total number of promises.

$promises : mixed

Promises or values.

Tags
deprecated

some will be removed in guzzlehttp/promises:2.0. Use Utils::some instead.

Return values
PromiseInterface

any()

Like some(), with 1 as count. However, if the promise fulfills, the fulfillment value is not an array of 1 but the value directly.

any(mixed $promises) : PromiseInterface
Parameters
$promises : mixed

Promises or values.

Tags
deprecated

any will be removed in guzzlehttp/promises:2.0. Use Utils::any instead.

Return values
PromiseInterface

settle()

Returns a promise that is fulfilled when all of the provided promises have been fulfilled or rejected.

settle(mixed $promises) : PromiseInterface

The returned promise is fulfilled with an array of inspection state arrays.

Parameters
$promises : mixed

Promises or values.

Tags
see
inspect

for the inspection state array format.

deprecated

settle will be removed in guzzlehttp/promises:2.0. Use Utils::settle instead.

Return values
PromiseInterface

each()

Given an iterator that yields promises or values, returns a promise that is fulfilled with a null value when the iterator has been consumed or the aggregate promise has been fulfilled or rejected.

each(mixed $iterable[, callable $onFulfilled = null ][, callable $onRejected = null ]) : PromiseInterface

$onFulfilled is a function that accepts the fulfilled value, iterator index, and the aggregate promise. The callback can invoke any necessary side effects and choose to resolve or reject the aggregate if needed.

$onRejected is a function that accepts the rejection reason, iterator index, and the aggregate promise. The callback can invoke any necessary side effects and choose to resolve or reject the aggregate if needed.

Parameters
$iterable : mixed

Iterator or array to iterate over.

$onFulfilled : callable = null
$onRejected : callable = null
Tags
deprecated

each will be removed in guzzlehttp/promises:2.0. Use Each::of instead.

Return values
PromiseInterface

each_limit()

Like each, but only allows a certain number of outstanding promises at any given time.

each_limit(mixed $iterable, int|callable $concurrency[, callable $onFulfilled = null ][, callable $onRejected = null ]) : PromiseInterface

$concurrency may be an integer or a function that accepts the number of pending promises and returns a numeric concurrency limit value to allow for dynamic a concurrency size.

Parameters
$iterable : mixed
$concurrency : int|callable
$onFulfilled : callable = null
$onRejected : callable = null
Tags
deprecated

each_limit will be removed in guzzlehttp/promises:2.0. Use Each::ofLimit instead.

Return values
PromiseInterface

each_limit_all()

Like each_limit, but ensures that no promise in the given $iterable argument is rejected. If any promise is rejected, then the aggregate promise is rejected with the encountered rejection.

each_limit_all(mixed $iterable, int|callable $concurrency[, callable $onFulfilled = null ]) : PromiseInterface
Parameters
$iterable : mixed
$concurrency : int|callable
$onFulfilled : callable = null
Tags
deprecated

each_limit_all will be removed in guzzlehttp/promises:2.0. Use Each::ofLimitAll instead.

Return values
PromiseInterface

is_fulfilled()

Returns true if a promise is fulfilled.

is_fulfilled(PromiseInterface $promise) : bool
Parameters
$promise : PromiseInterface
Tags
deprecated

is_fulfilled will be removed in guzzlehttp/promises:2.0. Use Is::fulfilled instead.

Return values
bool

is_rejected()

Returns true if a promise is rejected.

is_rejected(PromiseInterface $promise) : bool
Parameters
$promise : PromiseInterface
Tags
deprecated

is_rejected will be removed in guzzlehttp/promises:2.0. Use Is::rejected instead.

Return values
bool

is_settled()

Returns true if a promise is fulfilled or rejected.

is_settled(PromiseInterface $promise) : bool
Parameters
$promise : PromiseInterface
Tags
deprecated

is_settled will be removed in guzzlehttp/promises:2.0. Use Is::settled instead.

Return values
bool

coroutine()

Create a new coroutine.

coroutine(callable $generatorFn) : PromiseInterface
Parameters
$generatorFn : callable
Tags
see
Coroutine
deprecated

coroutine will be removed in guzzlehttp/promises:2.0. Use Coroutine::of instead.

Return values
PromiseInterface

str()

Returns the string representation of an HTTP message.

str(MessageInterface $message) : string
Parameters
$message : MessageInterface

Message to convert to a string.

Tags
deprecated

str will be removed in guzzlehttp/psr7:2.0. Use Message::toString instead.

Return values
string

uri_for()

Returns a UriInterface for the given value.

uri_for(string|UriInterface $uri) : UriInterface

This function accepts a string or UriInterface and returns a UriInterface for the given value. If the value is already a UriInterface, it is returned as-is.

Parameters
$uri : string|UriInterface
Tags
throws
InvalidArgumentException
deprecated

uri_for will be removed in guzzlehttp/psr7:2.0. Use Utils::uriFor instead.

Return values
UriInterface

stream_for()

Create a new stream based on the input type.

stream_for([resource|string|int|float|bool|StreamInterface|callable|Iterator|null $resource = '' ][, array<string|int, mixed> $options = [] ]) : StreamInterface

Options is an associative array that can contain the following keys:

  • metadata: Array of custom metadata.
  • size: Size of the stream.

This method accepts the following $resource types:

  • Psr\Http\Message\StreamInterface: Returns the value as-is.
  • string: Creates a stream object that uses the given string as the contents.
  • resource: Creates a stream object that wraps the given PHP stream resource.
  • Iterator: If the provided value implements Iterator, then a read-only stream object will be created that wraps the given iterable. Each time the stream is read from, data from the iterator will fill a buffer and will be continuously called until the buffer is equal to the requested read size. Subsequent read calls will first read from the buffer and then call next on the underlying iterator until it is exhausted.
  • object with __toString(): If the object has the __toString() method, the object will be cast to a string and then a stream will be returned that uses the string value.
  • NULL: When null is passed, an empty stream object is returned.
  • callable When a callable is passed, a read-only stream object will be created that invokes the given callable. The callable is invoked with the number of suggested bytes to read. The callable can return any number of bytes, but MUST return false when there is no more data to return. The stream object that wraps the callable will invoke the callable until the number of requested bytes are available. Any additional bytes will be buffered and used in subsequent reads.
Parameters
$resource : resource|string|int|float|bool|StreamInterface|callable|Iterator|null = ''

Entity body data

$options : array<string|int, mixed> = []

Additional options

Tags
throws
InvalidArgumentException

if the $resource arg is not valid.

deprecated

stream_for will be removed in guzzlehttp/psr7:2.0. Use Utils::streamFor instead.

Return values
StreamInterface

parse_header()

Parse an array of header values containing ";" separated data into an array of associative arrays representing the header key value pair data of the header. When a parameter does not contain a value, but just contains a key, this function will inject a key with a '' string value.

parse_header(string|array<string|int, mixed> $header) : array<string|int, mixed>
Parameters
$header : string|array<string|int, mixed>

Header to parse into components.

Tags
deprecated

parse_header will be removed in guzzlehttp/psr7:2.0. Use Header::parse instead.

Return values
array<string|int, mixed>

Returns the parsed header values.

normalize_header()

Converts an array of header values that may contain comma separated headers into an array of headers with no comma separated values.

normalize_header(string|array<string|int, mixed> $header) : array<string|int, mixed>
Parameters
$header : string|array<string|int, mixed>

Header to normalize.

Tags
deprecated

normalize_header will be removed in guzzlehttp/psr7:2.0. Use Header::normalize instead.

Return values
array<string|int, mixed>

Returns the normalized header field values.

modify_request()

Clone and modify a request with the given changes.

modify_request(RequestInterface $request, array<string|int, mixed> $changes) : RequestInterface

This method is useful for reducing the number of clones needed to mutate a message.

The changes can be one of:

  • method: (string) Changes the HTTP method.
  • set_headers: (array) Sets the given headers.
  • remove_headers: (array) Remove the given headers.
  • body: (mixed) Sets the given body.
  • uri: (UriInterface) Set the URI.
  • query: (string) Set the query string value of the URI.
  • version: (string) Set the protocol version.
Parameters
$request : RequestInterface

Request to clone and modify.

$changes : array<string|int, mixed>

Changes to apply.

Tags
deprecated

modify_request will be removed in guzzlehttp/psr7:2.0. Use Utils::modifyRequest instead.

Return values
RequestInterface

rewind_body()

Attempts to rewind a message body and throws an exception on failure.

rewind_body(MessageInterface $message) : mixed

The body of the message will only be rewound if a call to tell() returns a value other than 0.

Parameters
$message : MessageInterface

Message to rewind

Tags
throws
RuntimeException
deprecated

rewind_body will be removed in guzzlehttp/psr7:2.0. Use Message::rewindBody instead.

try_fopen()

Safely opens a PHP stream resource using a filename.

try_fopen(string $filename, string $mode) : resource

When fopen fails, PHP normally raises a warning. This function adds an error handler that checks for errors and throws an exception instead.

Parameters
$filename : string

File to open

$mode : string

Mode used to open the file

Tags
throws
RuntimeException

if the file cannot be opened

deprecated

try_fopen will be removed in guzzlehttp/psr7:2.0. Use Utils::tryFopen instead.

Return values
resource

copy_to_string()

Copy the contents of a stream into a string until the given number of bytes have been read.

copy_to_string(StreamInterface $stream[, int $maxLen = -1 ]) : string
Parameters
$stream : StreamInterface

Stream to read

$maxLen : int = -1

Maximum number of bytes to read. Pass -1 to read the entire stream.

Tags
throws
RuntimeException

on error.

deprecated

copy_to_string will be removed in guzzlehttp/psr7:2.0. Use Utils::copyToString instead.

Return values
string

copy_to_stream()

Copy the contents of a stream into another stream until the given number of bytes have been read.

copy_to_stream(StreamInterface $source, StreamInterface $dest[, int $maxLen = -1 ]) : mixed
Parameters
$source : StreamInterface

Stream to read from

$dest : StreamInterface

Stream to write to

$maxLen : int = -1

Maximum number of bytes to read. Pass -1 to read the entire stream.

Tags
throws
RuntimeException

on error.

deprecated

copy_to_stream will be removed in guzzlehttp/psr7:2.0. Use Utils::copyToStream instead.

hash()

Calculate a hash of a stream.

hash(StreamInterface $stream, string $algo[, bool $rawOutput = false ]) : string

This method reads the entire stream to calculate a rolling hash, based on PHP's hash_init functions.

Parameters
$stream : StreamInterface

Stream to calculate the hash for

$algo : string

Hash algorithm (e.g. md5, crc32, etc)

$rawOutput : bool = false

Whether or not to use raw output

Tags
throws
RuntimeException

on error.

deprecated

hash will be removed in guzzlehttp/psr7:2.0. Use Utils::hash instead.

Return values
string

Returns the hash of the stream

readline()

Read a line from the stream up to the maximum allowed buffer length.

readline(StreamInterface $stream[, int|null $maxLength = null ]) : string
Parameters
$stream : StreamInterface

Stream to read from

$maxLength : int|null = null

Maximum buffer length

Tags
deprecated

readline will be removed in guzzlehttp/psr7:2.0. Use Utils::readLine instead.

Return values
string

parse_request()

Parses a request message string into a request object.

parse_request(string $message) : Request
Parameters
$message : string

Request message string.

Tags
deprecated

parse_request will be removed in guzzlehttp/psr7:2.0. Use Message::parseRequest instead.

Return values
Request

parse_response()

Parses a response message string into a response object.

parse_response(string $message) : Response
Parameters
$message : string

Response message string.

Tags
deprecated

parse_response will be removed in guzzlehttp/psr7:2.0. Use Message::parseResponse instead.

Return values
Response

parse_query()

Parse a query string into an associative array.

parse_query(string $str[, int|bool $urlEncoding = true ]) : array<string|int, mixed>

If multiple values are found for the same key, the value of that key value pair will become an array. This function does not parse nested PHP style arrays into an associative array (e.g., foo[a]=1&foo[b]=2 will be parsed into ['foo[a]' => '1', 'foo[b]' => '2']).

Parameters
$str : string

Query string to parse

$urlEncoding : int|bool = true

How the query string is encoded

Tags
deprecated

parse_query will be removed in guzzlehttp/psr7:2.0. Use Query::parse instead.

Return values
array<string|int, mixed>

build_query()

Build a query string from an array of key value pairs.

build_query(array<string|int, mixed> $params[, int|false $encoding = PHP_QUERY_RFC3986 ]) : string

This function can use the return value of parse_query() to build a query string. This function does not modify the provided keys when an array is encountered (like http_build_query() would).

Parameters
$params : array<string|int, mixed>

Query string parameters.

$encoding : int|false = PHP_QUERY_RFC3986

Set to false to not encode, PHP_QUERY_RFC3986 to encode using RFC3986, or PHP_QUERY_RFC1738 to encode using RFC1738.

Tags
deprecated

build_query will be removed in guzzlehttp/psr7:2.0. Use Query::build instead.

Return values
string

mimetype_from_filename()

Determines the mimetype of a file by looking at its extension.

mimetype_from_filename(string $filename) : string|null
Parameters
$filename : string
Tags
deprecated

mimetype_from_filename will be removed in guzzlehttp/psr7:2.0. Use MimeType::fromFilename instead.

Return values
string|null

get_message_body_summary()

Get a short summary of the message body.

get_message_body_summary(MessageInterface $message[, int $truncateAt = 120 ]) : string|null

Will return null if the response is not printable.

Parameters
$message : MessageInterface

The message to get the body summary

$truncateAt : int = 120

The maximum allowed size of the summary

Tags
deprecated

get_message_body_summary will be removed in guzzlehttp/psr7:2.0. Use Message::bodySummary instead.

Return values
string|null

RandomCompat_strlen()

strlen() implementation that isn't brittle to mbstring.func_overload

RandomCompat_strlen(string $binary_string) : int

This version just used the default strlen()

Parameters
$binary_string : string
Tags
throws
TypeError
Return values
int

RandomCompat_substr()

substr() implementation that isn't brittle to mbstring.func_overload

RandomCompat_substr(string $binary_string, int $start[, int|null $length = null ]) : string

This version just uses the default substr()

Parameters
$binary_string : string
$start : int
$length : int|null = null

(optional)

Tags
throws
TypeError
Return values
string

RandomCompat_intval()

Cast to an integer if we can, safely.

RandomCompat_intval(int|float $number[, bool $fail_open = false ]) : float|int

If you pass it a float in the range (~PHP_INT_MAX, PHP_INT_MAX) (non-inclusive), it will sanely cast it to an int. If you it's equal to ~PHP_INT_MAX or PHP_INT_MAX, we let it fail as not an integer. Floats lose precision, so the <= and => operators might accidentally let a float through.

Parameters
$number : int|float

The number we want to convert to an int

$fail_open : bool = false

Set to true to not throw an exception

Tags
psalm-suppress

InvalidReturnType

throws
TypeError
Return values
float|int

random_bytes()

We don't have any more options, so let's throw an exception right now and hope the developer won't let it fail silently.

random_bytes(mixed $length) : string
Parameters
$length : mixed
Tags
psalm-suppress

InvalidReturnType

throws
Exception
Return values
string

random_bytes()

Windows with PHP < 5.3.0 will not have the function openssl_random_pseudo_bytes() available, so let's use CAPICOM to work around this deficiency.

random_bytes(int $bytes) : string
Parameters
$bytes : int
Tags
throws
Exception
Return values
string

random_bytes()

Unless open_basedir is enabled, use /dev/urandom for random numbers in accordance with best practices

random_bytes(int $bytes) : string

Why we use /dev/urandom and not /dev/random

Parameters
$bytes : int
Tags
ref

https://www.2uo.de/myths-about-urandom

ref

http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers

throws
Exception
Return values
string

random_bytes()

If the libsodium PHP extension is loaded, we'll use it above any other solution.

random_bytes(int $bytes) : string

libsodium-php project:

Parameters
$bytes : int
Tags
ref

https://github.com/jedisct1/libsodium-php

throws
Exception
Return values
string

random_bytes()

If the libsodium PHP extension is loaded, we'll use it above any other solution.

random_bytes(int $bytes) : string

libsodium-php project:

Parameters
$bytes : int
Tags
ref

https://github.com/jedisct1/libsodium-php

throws
Exception
Return values
string

random_bytes()

Powered by ext/mcrypt (and thankfully NOT libmcrypt)

random_bytes(int $bytes) : string
Parameters
$bytes : int
Tags
ref

https://bugs.php.net/bug.php?id=55169

ref

https://github.com/php/php-src/blob/c568ffe5171d942161fc8dda066bce844bdef676/ext/mcrypt/mcrypt.c#L1321-L1386

throws
Exception
Return values
string

random_int()

Fetch a random integer between $min and $max inclusive

random_int(int $min, int $max) : int
Parameters
$min : int
$max : int
Tags
throws
Exception
Return values
int

getallheaders()

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

getallheaders() : mixed
Return values
mixed

The HTTP header key/value pairs.

idn_to_ascii()

idn_to_ascii(mixed $domain[, mixed $options = IDNA_DEFAULT ][, mixed $variant = INTL_IDNA_VARIANT_UTS46 ][, mixed &$idna_info = array() ]) : mixed
Parameters
$domain : mixed
$options : mixed = IDNA_DEFAULT
$variant : mixed = INTL_IDNA_VARIANT_UTS46
$idna_info : mixed = array()

idn_to_utf8()

idn_to_utf8(mixed $domain[, mixed $options = IDNA_DEFAULT ][, mixed $variant = INTL_IDNA_VARIANT_UTS46 ][, mixed &$idna_info = array() ]) : mixed
Parameters
$domain : mixed
$options : mixed = IDNA_DEFAULT
$variant : mixed = INTL_IDNA_VARIANT_UTS46
$idna_info : mixed = array()

normalizer_is_normalized()

normalizer_is_normalized(mixed $input[, mixed $form = pNormalizer::NFC ]) : mixed
Parameters
$input : mixed
$form : mixed = pNormalizer::NFC

normalizer_normalize()

normalizer_normalize(mixed $input[, mixed $form = pNormalizer::NFC ]) : mixed
Parameters
$input : mixed
$form : mixed = pNormalizer::NFC

intdiv()

intdiv(mixed $num1, mixed $num2) : mixed
Parameters
$num1 : mixed
$num2 : mixed

preg_replace_callback_array()

preg_replace_callback_array(array<string|int, mixed> $pattern, mixed $subject[, mixed $limit = -1 ][, mixed &$count = 0 ][, mixed $flags = null ]) : mixed
Parameters
$pattern : array<string|int, mixed>
$subject : mixed
$limit : mixed = -1
$count : mixed = 0
$flags : mixed = null

error_clear_last()

error_clear_last() : mixed

sapi_windows_vt100_support()

sapi_windows_vt100_support(mixed $stream[, mixed $enable = null ]) : mixed
Parameters
$stream : mixed
$enable : mixed = null

stream_isatty()

stream_isatty(mixed $stream) : mixed
Parameters
$stream : mixed

utf8_encode()

utf8_encode(mixed $string) : mixed
Parameters
$string : mixed

utf8_decode()

utf8_decode(mixed $string) : mixed
Parameters
$string : mixed

spl_object_id()

spl_object_id(mixed $object) : mixed
Parameters
$object : mixed

mb_ord()

mb_ord(mixed $string[, mixed $encoding = null ]) : mixed
Parameters
$string : mixed
$encoding : mixed = null

mb_chr()

mb_chr(mixed $codepoint[, mixed $encoding = null ]) : mixed
Parameters
$codepoint : mixed
$encoding : mixed = null

mb_scrub()

mb_scrub(mixed $string[, mixed $encoding = null ]) : mixed
Parameters
$string : mixed
$encoding : mixed = null

get_api_payment_weixin_query()

微信订单查寻 在订单中要调用,用户检测是否支付成功 如果需要支付宝,那么要实现 get_api_payment_alipay_query

get_api_payment_weixin_query(mixed $order_num) : mixed
Parameters
$order_num : mixed

payment_weixin_refund()

微信支付退款 如果需要支付宝,那么要实现 payment_alipay_refund

payment_weixin_refund(mixed $order_num, mixed $total_fee, mixed $refund_amount[, mixed $refund_desc = '' ]) : mixed
Parameters
$order_num : mixed
$total_fee : mixed
$refund_amount : mixed
$refund_desc : mixed = ''

payemnt_insert_base()

写入支付信息

payemnt_insert_base(mixed $out_trade_no, mixed $data) : mixed
Parameters
$out_trade_no : mixed
$data : mixed

get_payment_base()

获取支付信息

get_payment_base(mixed $out_trade_no) : mixed
Parameters
$out_trade_no : mixed

get_payment_base_by_id()

获取支付信息

get_payment_base_by_id(mixed $pay_id[, mixed $status = 1 ]) : mixed
Parameters
$pay_id : mixed
$status : mixed = 1

update_payment_base()

更新支付信息

update_payment_base(mixed $out_trade_no, mixed $data) : mixed
Parameters
$out_trade_no : mixed
$data : mixed

insert_payment_refund_info()

写入退款信息

insert_payment_refund_info(mixed $arr) : mixed
Parameters
$arr : mixed

get_webtool_wx()

get_webtool_wx() : mixed

add_webtool_cmd_job()

add_webtool_cmd_job(mixed $cmd) : mixed
Parameters
$cmd : mixed

create_oss_remote_url()

create_oss_remote_url(mixed $url) : mixed
Parameters
$url : mixed

add_oss_info()

add_oss_info(mixed $type, mixed $file, mixed $remote_url) : mixed
Parameters
$type : mixed
$file : mixed
$remote_url : mixed

webtool_log()

webtool_log(mixed $type, mixed $title, mixed $par[, mixed $is_update = false ]) : mixed
Parameters
$type : mixed
$title : mixed
$par : mixed
$is_update : mixed = false

update_webtool_log()

update_webtool_log(mixed $id[, mixed $data = [] ][, mixed $flag = 'ok' ]) : mixed
Parameters
$id : mixed
$data : mixed = []
$flag : mixed = 'ok'

set_webtool_printer_finish()

set_webtool_printer_finish(mixed $job_id) : mixed
Parameters
$job_id : mixed

close_webtool_printer_job()

close_webtool_printer_job(mixed $job_id) : mixed
Parameters
$job_id : mixed

get_captcha_drive()

get_captcha_drive() : mixed

get_captcha_check()

get_captcha_check([mixed $ignore_expire = false ]) : mixed
Parameters
$ignore_expire : mixed = false

get_captcha_init()

get_captcha_init([mixed $output = true ]) : mixed
Parameters
$output : mixed = true

element()

element(mixed $name, mixed $data) : mixed
Parameters
$name : mixed
$data : mixed

element_to_str()

element_to_str(mixed $arr) : mixed
Parameters
$arr : mixed

element_vue()

element_vue() : mixed

element_open_pdf()

element_open_pdf() : mixed

element_open_office()

element_open_office() : mixed

predis()

redis

predis([mixed $host = '' ][, mixed $port = '' ][, mixed $auth = '' ]) : mixed
Parameters
$host : mixed = ''
$port : mixed = ''
$auth : mixed = ''

predis_add_geo()

添加位置信息 predis_add_geo('places',[ [ 'lng'=>'116.397128', 'lat'=>'39.916527', 'title'=>'北京天安门' ], ]);

predis_add_geo(mixed $key[, mixed $arr = [] ]) : mixed
Parameters
$key : mixed
$arr : mixed = []

predis_delete_geo()

删除位置信息

predis_delete_geo(mixed $key[, mixed $arr = [] ]) : mixed

predis_delete_geo('places',[ '北京天安门', ]);

Parameters
$key : mixed
$arr : mixed = []

predis_get_pager()

返回附近的地理位置 pr(predis_get_pager('places', 116.403958, 39.915049)); http://redisdoc.com/geo/georadius.html

predis_get_pager(mixed $key, mixed $lat, mixed $lng[, mixed $juli = 2 ][, mixed $sort = 'ASC' ][, mixed $to_fixed = 2 ]) : mixed
Parameters
$key : mixed
$lat : mixed
$lng : mixed
$juli : mixed = 2
$sort : mixed = 'ASC'
$to_fixed : mixed = 2

predis_geo_pos()

取lat lng

predis_geo_pos(mixed $key[, mixed $title = [] ][, mixed $to_fixed = 6 ]) : mixed
Parameters
$key : mixed
$title : mixed = []
$to_fixed : mixed = 6

array_to_pager()

分组分页

array_to_pager(mixed $arr) : mixed
Parameters
$arr : mixed

get_url_remove_http()

返回URL路径,不含有域名部分

get_url_remove_http(mixed $url) : mixed
Parameters
$url : mixed

get_ext_by_url()

取后缀 add_action("get_ext_by_url",function(&$data){ $url = $data['url']; $data['ext'] = 'pdf'; });

get_ext_by_url(mixed $url) : mixed
Parameters
$url : mixed

get_mime()

通过URL取mime

get_mime(mixed $url) : mixed
Parameters
$url : mixed

URL

get_mime_content()

取mime

get_mime_content(mixed $content[, mixed $just_return_ext = false ]) : mixed
Parameters
$content : mixed

文件内容,可以是通过file_get_contents取到的

$just_return_ext : mixed = false

get_remote_file()

获取远程URL内容

get_remote_file(mixed $url[, mixed $is_json = false ]) : mixed
Parameters
$url : mixed
$is_json : mixed = false

remove_host()

移除主域名部分

remove_host(mixed $url) : mixed
Parameters
$url : mixed

download_file()

下载文件 建议使用 download_file_safe

download_file(mixed $url[, mixed $contain_http = false ]) : mixed
Parameters
$url : mixed
$contain_http : mixed = false

download_file_safe()

下载资源文件到本地

download_file_safe(mixed $url[, mixed $mimes = ['image/*', 'video/*'] ][, mixed $cons = [] ][, mixed $contain_http = false ]) : mixed
Parameters
$url : mixed
$mimes : mixed = ['image/*', 'video/*']
$cons : mixed = []
$contain_http : mixed = false

download_remote_file()

下载远程文件 global $remote_to_local_path; $remote_to_local_path = '/uploads/saved/'.date("Y-m-d");

download_remote_file(mixed $url[, mixed $path = '' ][, mixed $name = '' ]) : mixed
Parameters
$url : mixed
$path : mixed = ''
$name : mixed = ''

curl_aliyun()

调用阿里云

curl_aliyun(mixed $url[, mixed $bodys = '' ][, mixed $method = 'POST' ]) : mixed
Parameters
$url : mixed
$bodys : mixed = ''
$method : mixed = 'POST'

success_data()

返回成功的json信息

success_data(mixed $data[, mixed $msg = '' ]) : mixed
Parameters
$data : mixed
$msg : mixed = ''

error_data()

返回失败的json信息

error_data(mixed $msg) : mixed
Parameters
$msg : mixed

get_path_info()

pathinfo /index.php/admin/auth/index?code=2 返回 admin/auth/index 数组时返回 ['admin','auth','index']

get_path_info([mixed $return_array = false ]) : mixed
Parameters
$return_array : mixed = false

router_pathinfo()

支持pathinfo路由 未找到请用 pathinfo_not_find 函数

router_pathinfo([mixed $ns = 'app' ][, mixed $add_controller = 'controller' ][, mixed $ucfirst_controller = true ]) : mixed
Parameters
$ns : mixed = 'app'
$add_controller : mixed = 'controller'
$ucfirst_controller : mixed = true

make_rand_code()

生成数字随机数 一般用于核销 需要表名 rand_code 字段 nid code status默认0

make_rand_code(mixed $node_id) : mixed
Parameters
$node_id : mixed

update_make_rand_code()

核销后需要释放核销码

update_make_rand_code(mixed $node_id) : mixed
Parameters
$node_id : mixed

set_lock()

锁功能已替代 lock_call('k',functon(){

set_lock(mixed $key[, mixed $exp_time = 60 ]) : mixed

},second);

Parameters
$key : mixed
$exp_time : mixed = 60

get_lock()

获取是否锁定

get_lock(mixed $key) : mixed
Parameters
$key : mixed

del_lock()

释放锁定

del_lock(mixed $key) : mixed
Parameters
$key : mixed

json_replace()

json数据替换

json_replace(mixed $json[, mixed $replace = [] ][, mixed $return_json = true ]) : mixed
Parameters
$json : mixed

json格式数组或数组

$replace : mixed = []

要替换的数组,如$replace = ['appid'=>'new appid'];

$return_json : mixed = true

默认返回JSON格式

remove_php_notes()

去除PHP代码注释

remove_php_notes(mixed $content) : mixed
Parameters
$content : mixed

online_view_office()

在线查看office文件

online_view_office(mixed $url) : mixed
Parameters
$url : mixed

printfs()

格式化输出金额 强制输出数字类型

printfs(mixed &$v[, mixed $keys = [] ][, mixed $dot = 2 ]) : mixed
Parameters
$v : mixed
$keys : mixed = []
$dot : mixed = 2

float_noup()

float不进位,如3.145 返回3.14 进位的有默认round(3.145) 或sprintf("%.2f",3.145);

float_noup(mixed $float_number[, mixed $dot = 2 ]) : mixed
Parameters
$float_number : mixed
$dot : mixed = 2

float_up()

四舍五入

float_up(mixed $float_number[, mixed $dot = 2 ][, mixed $mid_val = 5 ]) : mixed
Parameters
$float_number : mixed
$dot : mixed = 2
$mid_val : mixed = 5

逢几进位

load_xls()

加载xlsx load_xls([ 'file' => $xls, 'config'=>[ '序号' =>'index', ], 'title_line'=>1, 'call'=>function($i,$row,&$d){} ]);

load_xls([mixed $new_arr = [] ]) : mixed
Parameters
$new_arr : mixed = []

get_lines()

获取文件行数,不包空行

get_lines(mixed $file[, mixed $length = 40960 ]) : mixed
Parameters
$file : mixed
$length : mixed = 40960

get_request_top()

返回请求中是http还是https

get_request_top() : mixed

get_request_host()

返回请求域名及URL部分,不包含http://

get_request_host() : mixed

auto_jump()

自动跳转到https网站

auto_jump() : mixed

get_http_full_url()

get_http_full_url(mixed $url[, mixed $fun = 'cdn_url' ]) : mixed
Parameters
$url : mixed
$fun : mixed = 'cdn_url'

get_index_array_valule()

从数组中搜索

get_index_array_valule(mixed $array, mixed $key, mixed $val) : mixed
Parameters
$array : mixed
$key : mixed
$val : mixed

gbk_substr()

gbk_substr(mixed $text, mixed $start, mixed $len[, mixed $gbk = 'GBK' ]) : mixed
Parameters
$text : mixed
$start : mixed
$len : mixed
$gbk : mixed = 'GBK'

get_gbk_len()

GBK长宽 2个字符

get_gbk_len(mixed $value[, mixed $gbk = 'GBK' ]) : mixed
Parameters
$value : mixed
$gbk : mixed = 'GBK'

get_text_c()

文字居中

get_text_c(string $str, int $len) : mixed
Parameters
$str : string
$len : int

get_text_lr()

文字排版 左 中 右 左 右

get_text_lr(array<string|int, mixed> $arr, int $length[, mixed $return_arr = false ]) : mixed
Parameters
$arr : array<string|int, mixed>
$length : int
$return_arr : mixed = false

allow_cross_origin()

处理跨域

allow_cross_origin() : mixed

to_utf8()

to_utf8(mixed $str) : mixed
Parameters
$str : mixed

csv_reader()

csv_reader(mixed $file) : mixed
Parameters
$file : mixed

csv_writer()

csv_writer(mixed $file[, mixed $header = [] ][, mixed $content = [] ]) : mixed
Parameters
$file : mixed
$header : mixed = []
$content : mixed = []

lock_call()

基于redis锁

lock_call(mixed $key, mixed $call[, mixed $time = 10 ]) : mixed

global $redis_lock; //锁前缀 global $lock_key;

$redis_lock = [ 'host'=>'', 'port'=>'', 'auth'=>'', ];

lock_call('k',functon()},1); 或 if(lock_start('k')){ .. lock_end(); }

Parameters
$key : mixed
$call : mixed
$time : mixed = 10

lock_start()

开始锁

lock_start(mixed $key[, mixed $time = 1 ]) : mixed
Parameters
$key : mixed
$time : mixed = 1

lock_end()

释放锁

lock_end() : mixed

compare_date()

compare_date(mixed $a, mixed $b) : mixed
Parameters
$a : mixed
$b : mixed

redis_pub()

发布消息 redis_pub("demo","welcome man"); redis_pub("demo",['title'=>'yourname']);

redis_pub(mixed $channel, mixed $message) : mixed
Parameters
$channel : mixed
$message : mixed

redis_sub()

取订阅消息 redis_sub("demo",function($channel,$message){ echo "channel ".$channel."\n"; print_r($message); });

redis_sub(mixed $channel, mixed $call[, mixed $unsubscribe = false ]) : mixed
Parameters
$channel : mixed
$call : mixed
$unsubscribe : mixed = false

send_pusher()

send_pusher([mixed $data = [] ][, mixed $channel = 'netteadmin' ][, mixed $event = 'notice' ]) : mixed
Parameters
$data : mixed = []
$channel : mixed = 'netteadmin'
$event : mixed = 'notice'

think_check_sign()

think_check_sign(mixed $json_string[, mixed $key = '' ][, mixed $sign_key = 'sign' ]) : mixed
Parameters
$json_string : mixed
$key : mixed = ''
$sign_key : mixed = 'sign'

think_create_sign()

think_create_sign([mixed $arr = [] ][, mixed $key = '' ]) : mixed
Parameters
$arr : mixed = []
$key : mixed = ''

get_str_ord()

get_str_ord(mixed $str[, mixed $is_join = false ]) : mixed
Parameters
$str : mixed
$is_join : mixed = false

gz_encode()

gz_encode(mixed $arr_or_str) : mixed
Parameters
$arr_or_str : mixed

gz_decode()

gz_decode(mixed $str) : mixed
Parameters
$str : mixed

html_to_pdf()

html_to_pdf(mixed $input_html_file, mixed $output_pdf_file[, mixed $return_cmd = false ][, mixed $exec = false ]) : mixed
Parameters
$input_html_file : mixed
$output_pdf_file : mixed
$return_cmd : mixed = false
$exec : mixed = false

get_barcode()

https://github.com/picqer/php-barcode-generator/blob/main/src/BarcodeGenerator.php C128 C128A C128B C128C C93 EAN13 EAN8 EAN2

get_barcode(mixed $code[, mixed $type = 'C128' ][, mixed $widthFactor = 2 ][, mixed $height = 30 ][, mixed $foregroundColor = [0, 0, 0] ]) : mixed
Parameters
$code : mixed
$type : mixed = 'C128'
$widthFactor : mixed = 2
$height : mixed = 30
$foregroundColor : mixed = [0, 0, 0]

text_add_br()

text_add_br(mixed $text, mixed $w[, mixed $br = '<br>' ]) : mixed
Parameters
$text : mixed
$w : mixed
$br : mixed = '<br>'

get_server_headers()

get_server_headers([mixed $name = '' ]) : mixed
Parameters
$name : mixed = ''

output_js_css()

output_js_css([mixed $js = '' ][, mixed $css = '' ]) : mixed
Parameters
$js : mixed = ''
$css : mixed = ''

file_parse()

解析文件内容

file_parse(mixed $file[, mixed $zip_output_dir = '' ][, mixed $need_remove = false ]) : mixed

支持 zip pdf xml pdf读取 yum install poppler-utils odf转pdf pip install mupdf

file_parse(DIR.'/1.zip',DIR."/tmp"); file_parse(DIR.'/2.xml',DIR);

Parameters
$file : mixed
$zip_output_dir : mixed = ''
$need_remove : mixed = false
Tags
parma

$file 文件支持 zip pdf xml ofd

parma

$zip_output_dir 主要是用于返回数组的key时把路径替换掉

show_number()

优化数量显示 1.10显示为1.1 1.05显示为1.05 1.00显示为1

show_number(mixed $num) : mixed
Parameters
$num : mixed

get_str_number()

取字符中的数字

get_str_number(mixed $input) : mixed
Parameters
$input : mixed

line_bezier()

贝塞尔

line_bezier([mixed $opt = [] ][, mixed $return = 'base64' ]) : mixed
Parameters
$opt : mixed = []
$return : mixed = 'base64'

blob | base64 当为blob时 header("Content-Type: image/png");echo $blob;exit; 当为base64时 echo "";

num_to_chinese()

数字转中文,非金额读法

num_to_chinese(mixed $num) : mixed
Parameters
$num : mixed

get_video_time()

获取本地音视频时长 https://github.com/JamesHeinrich/getID3 composer require james-heinrich/getid3

get_video_time(mixed $video_local_path[, mixed $ret_time = true ]) : mixed
Parameters
$video_local_path : mixed
$ret_time : mixed = true

copy_dir()

目录 复制到 另一个目录

copy_dir(mixed $source, mixed $dest) : mixed
Parameters
$source : mixed
$dest : mixed

unzip_tar()

解压zip、7z、gz、tar、bz2包 yum -y install p7zip unar unzip

unzip_tar(mixed $input[, mixed $output_base = '' ]) : mixed
Parameters
$input : mixed
$output_base : mixed = ''

think_exec()

exec

think_exec(mixed $cmd[, mixed &$output = '' ][, mixed $show_err = false ]) : mixed
Parameters
$cmd : mixed
$output : mixed = ''
$show_err : mixed = false

xml2array()

xml2array(mixed $xml_content) : mixed
Parameters
$xml_content : mixed

_xml2array_node()

_xml2array_node(mixed $node) : mixed
Parameters
$node : mixed

array2xml()

array2xml(mixed $arr[, mixed $root = '' ]) : mixed
Parameters
$arr : mixed
$root : mixed = ''

is_image_ext()

是否是图片

is_image_ext(mixed $url) : mixed
Parameters
$url : mixed

is_video_ext()

是否是视频

is_video_ext(mixed $url) : mixed
Parameters
$url : mixed

is_audio_ext()

是否是音频

is_audio_ext(mixed $url) : mixed
Parameters
$url : mixed

copy_base64_data()

copy_base64_data() : mixed

set_scss_path()

set_scss_path(mixed $path) : mixed
Parameters
$path : mixed

scss()

scss(mixed $css[, mixed $is_cached = false ]) : mixed
Parameters
$css : mixed
$is_cached : mixed = false

get_ws_js()

HTML端收消息 wss://yourdomain/wss ws://ip:port

get_ws_js(mixed $func[, mixed $ws = 'ws://127.0.0.1:3006' ]) : mixed
Parameters
$func : mixed
$ws : mixed = 'ws://127.0.0.1:3006'

create_node_ws_server()

生成node js ws服务 需要把返回的内容写入server.js中 依赖 ioredis

create_node_ws_server([mixed $ws_port = 3006 ][, mixed $topic = ['demo'] ][, mixed $redis_host = '127.0.0.1' ][, mixed $port = '6379' ][, mixed $auth = '' ]) : mixed
Parameters
$ws_port : mixed = 3006
$topic : mixed = ['demo']
$redis_host : mixed = '127.0.0.1'
$port : mixed = '6379'
$auth : mixed = ''

xis_ssl()

xis_ssl() : mixed

xcookie()

xcookie(mixed $name[, mixed $value = '' ][, mixed $expire = 0 ]) : mixed
Parameters
$name : mixed
$value : mixed = ''
$expire : mixed = 0

xcookie_delete()

xcookie_delete(mixed $name) : mixed
Parameters
$name : mixed

rpc_client()

rpc_client(mixed $url[, mixed $is_remote = false ]) : mixed
Parameters
$url : mixed
$is_remote : mixed = false

rpc_server()

rpc_server(mixed $class) : mixed
Parameters
$class : mixed

call_retry()

尝试多次运行 $times 运行次数 $usleep_time 毫秒

call_retry(mixed $func[, mixed $times = 3 ][, mixed $usleep_time = 1000 ]) : mixed
Parameters
$func : mixed
$times : mixed = 3
$usleep_time : mixed = 1000

array_to_tree()

数组转tree

array_to_tree(mixed $list[, mixed $pk = 'id' ][, mixed $pid = 'pid' ][, mixed $child = 'children' ][, mixed $root = 0 ][, mixed $my_id = '' ]) : mixed

输入$list [ {id:1,pid:0,其他字段}, {id:2,pid:1,其他字段}, {id:3,pid:1,其他字段}, ] 输出 [ [ id:1, pid:0, 其他字段, children:[ {id:2,pid:1,其他字段}, {id:3,pid:1,其他字段}, ] ] ]

Parameters
$list : mixed
$pk : mixed = 'id'
$pid : mixed = 'pid'
$child : mixed = 'children'
$root : mixed = 0
$my_id : mixed = ''

pr()

数组或字符输出,方便查看

pr(mixed $str) : mixed
Parameters
$str : mixed

add_action()

add_action(mixed $name, mixed $call[, mixed $level = 20 ]) : mixed
Parameters
$name : mixed
$call : mixed
$level : mixed = 20

do_action()

do_action(mixed $name[, mixed &$par = null ]) : mixed
Parameters
$name : mixed
$par : mixed = null

is_json()

is_json(mixed $data[, mixed $assoc = false ]) : mixed
Parameters
$data : mixed
$assoc : mixed = false

array_to_object()

array_to_object(mixed $arr) : mixed
Parameters
$arr : mixed

object_to_array()

object_to_array(mixed $obj) : mixed
Parameters
$obj : mixed

get_dir()

get_dir(mixed $name) : mixed
Parameters
$name : mixed

get_ext()

get_ext(mixed $name) : mixed
Parameters
$name : mixed

get_name()

get_name(mixed $name) : mixed
Parameters
$name : mixed

create_dir_if_not_exists()

create_dir_if_not_exists(mixed $arr) : mixed
Parameters
$arr : mixed

get_ip()

get_ip([mixed $type = 0 ][, mixed $adv = false ]) : mixed
Parameters
$type : mixed = 0
$adv : mixed = false

get_distance()

get_distance(mixed $longitude1, mixed $latitude1, mixed $longitude2, mixed $latitude2[, mixed $unit = 2 ][, mixed $decimal = 2 ]) : mixed
Parameters
$longitude1 : mixed
$latitude1 : mixed
$longitude2 : mixed
$latitude2 : mixed
$unit : mixed = 2
$decimal : mixed = 2

get_deep_dir()

get_deep_dir(mixed $path) : mixed
Parameters
$path : mixed

price_format()

price_format(mixed $yuan[, mixed $dot = 2 ]) : mixed
Parameters
$yuan : mixed
$dot : mixed = 2

json()

json([mixed $arr = [] ]) : mixed
Parameters
$arr : mixed = []

json_error()

json_error([mixed $arr = [] ][, mixed $is_array = false ]) : mixed
Parameters
$arr : mixed = []
$is_array : mixed = false

json_success()

json_success([mixed $arr = [] ][, mixed $is_array = false ]) : mixed
Parameters
$arr : mixed = []
$is_array : mixed = false

yaml_load()

yaml_load(mixed $str) : mixed
Parameters
$str : mixed

yaml_dump()

yaml_dump(mixed $array[, mixed $line = 3 ]) : mixed
Parameters
$array : mixed
$line : mixed = 3

yaml()

yaml(mixed $str) : mixed
Parameters
$str : mixed

aes_encode()

aes_encode(mixed $data[, mixed $key = '' ][, mixed $iv = '' ][, mixed $type = 'AES-128-CBC' ][, mixed $options = '' ]) : mixed
Parameters
$data : mixed
$key : mixed = ''
$iv : mixed = ''
$type : mixed = 'AES-128-CBC'
$options : mixed = ''

aes_decode()

aes_decode(mixed $data[, mixed $key = '' ][, mixed $iv = '' ][, mixed $type = 'AES-128-CBC' ][, mixed $options = '' ]) : mixed
Parameters
$data : mixed
$key : mixed = ''
$iv : mixed = ''
$type : mixed = 'AES-128-CBC'
$options : mixed = ''

string_to_array()

string_to_array(mixed $name[, mixed $array = '' ]) : mixed
Parameters
$name : mixed
$array : mixed = ''

get_dates()

get_dates(mixed $start, mixed $end[, mixed $contain_last = true ]) : mixed
Parameters
$start : mixed
$end : mixed
$contain_last : mixed = true

get_date_china()

get_date_china(mixed $date) : mixed
Parameters
$date : mixed

timeago()

timeago(mixed $time) : mixed
Parameters
$time : mixed

import()

import(mixed $file[, mixed $vars = [] ][, mixed $check_vars = false ]) : mixed
Parameters
$file : mixed
$vars : mixed = []
$check_vars : mixed = false

get_reffer()

get_reffer([mixed $refer = '' ]) : mixed
Parameters
$refer : mixed = ''

get_root_domain()

get_root_domain([mixed $host = '' ]) : mixed
Parameters
$host : mixed = ''

get_sub_domain()

get_sub_domain([mixed $host = '' ]) : mixed
Parameters
$host : mixed = ''

sign_by_secret()

sign_by_secret(mixed $params[, mixed $secret = '' ][, mixed $array_encode = false ]) : mixed
Parameters
$params : mixed
$secret : mixed = ''
$array_encode : mixed = false

zip_extract()

zip_extract(mixed $local_file, mixed $extract_local_dir) : mixed
Parameters
$local_file : mixed
$extract_local_dir : mixed

zip_create()

zip_create(mixed $local_zip_file[, mixed $files = [] ]) : mixed
Parameters
$local_zip_file : mixed
$files : mixed = []

is_json_request()

is_json_request() : mixed

array_to_el_select()

array_to_el_select(mixed $all, mixed $v, mixed $k) : mixed
Parameters
$all : mixed
$v : mixed
$k : mixed

echats()

echats(mixed $ele[, mixed $options = [] ]) : mixed
Parameters
$ele : mixed
$options : mixed = []

echats_reload()

echats_reload() : mixed

echarts()

echarts(mixed $ele[, mixed $options = [] ]) : mixed
Parameters
$ele : mixed
$options : mixed = []

echarts_reload()

echarts_reload() : mixed

set_field_allow()

设置允许字段

set_field_allow(mixed $collect, mixed $field) : mixed
Parameters
$collect : mixed
$field : mixed

get_field_allow()

获取允许字段

get_field_allow(mixed $collect) : mixed
Parameters
$collect : mixed

get_data_allow()

返回允许字段值

get_data_allow(mixed $collect, mixed $input) : mixed
Parameters
$collect : mixed
$input : mixed

think_validate()

think_validate(mixed $labels, mixed $data, mixed $rules[, mixed $show_array = false ]) : mixed
Parameters
$labels : mixed
$data : mixed
$rules : mixed
$show_array : mixed = false

validate()

validate(mixed $labels, mixed $data, mixed $rules[, mixed $show_array = false ]) : mixed
Parameters
$labels : mixed
$data : mixed
$rules : mixed
$show_array : mixed = false

jump()

jump(mixed $url) : mixed
Parameters
$url : mixed

set_url_use_cdn()

对数组添加cdn url

set_url_use_cdn(mixed &$row[, mixed $field = [] ]) : mixed
Parameters
$row : mixed
$field : mixed = []

push_task()

添加到队列 "topthink/think-queue": "^3" push_task('app\printer\job\Printer',['tt'=>11],'');

push_task(mixed $job[, mixed $data = '' ][, mixed $queue = '' ]) : mixed
Parameters
$job : mixed
$data : mixed = ''
$queue : mixed = ''

loop_tree()

向上取递归 如当前分类是3,将返回 123所有的值 $arr = loop_tree("catalog",$v['catalog_id'],true); foreach($arr as $vv){ $title[] = $vv['title']; } id pid 1 0 2 1 3 2

loop_tree(mixed $table, mixed $id[, mixed $is_frist = true ]) : mixed
Parameters
$table : mixed
$id : mixed
$is_frist : mixed = true

get_loop_tree_ids()

向下递归

get_loop_tree_ids(mixed $table, mixed $id[, mixed $where = [] ][, mixed $get_field = 'id' ]) : mixed
Parameters
$table : mixed
$id : mixed
$where : mixed = []
$get_field : mixed = 'id'

loop_del()

递归删除

loop_del(mixed $table, mixed $id[, mixed $where = [] ]) : mixed
Parameters
$table : mixed
$id : mixed
$where : mixed = []

el_table_tree()

用于tree表格排序 因为tree给的lists字段是用于显示,在排序时得到的index是不正确的, 此时需要lists_sort字段得到正确的index 在交换排序值时才能正确保存并显示

el_table_tree(mixed $list, mixed $j[, mixed $is_top = false ]) : mixed
Parameters
$list : mixed
$j : mixed
$is_top : mixed = false

el_cascader()

用于cascader字段 public function cascader(){ $catalog = db_get($this->table,"*",[ 'ORDER'=>catalog_default_order_by(), 'status'=>1 ]); $select = el_cascader(array_to_tree($catalog)); json_success(['data'=>$select]); } $catalog = db_get("catalog",[]); $select = el_cascader(array_to_tree($catalog));

el_cascader(mixed $select[, mixed $label = 'title' ][, mixed $value = 'id' ]) : mixed
Parameters
$select : mixed
$label : mixed = 'title'
$value : mixed = 'id'

_loop_del_tree()

内部实现

_loop_del_tree(mixed $table, mixed $all) : mixed
Parameters
$table : mixed
$all : mixed

_loop_tree_deep_inner()

内部实现

_loop_tree_deep_inner(mixed $all, mixed $get_field[, mixed $is_frist = false ]) : mixed
Parameters
$all : mixed
$get_field : mixed
$is_frist : mixed = false

get_xss_clean_ins()

get_xss_clean_ins() : mixed

xss_clean_str()

xss_clean_str(mixed $str) : mixed
Parameters
$str : mixed

xss_clean()

xss_clean(mixed $input) : mixed
Parameters
$input : mixed

global_trim_inner()

global_trim_inner(mixed &$in) : mixed
Parameters
$in : mixed

get()

get([mixed $key = "" ]) : mixed
Parameters
$key : mixed = ""

get_req_post()

get_req_post([mixed $key = "" ]) : mixed
Parameters
$key : mixed = ""

g()

g([mixed $key = null ]) : mixed
Parameters
$key : mixed = null

guzzle_http()

guzzle_http([mixed $click_option = [] ]) : mixed
Parameters
$click_option : mixed = []

guzzle_http_fake_option()

guzzle_http_fake_option() : mixed

get_template()

get_template(mixed $name[, mixed $replace_arr = [] ]) : mixed
Parameters
$name : mixed
$replace_arr : mixed = []

get_api_data()

获取接口请求数据,如果存在将不发起接口请求

get_api_data(mixed $title, mixed $name) : mixed
Parameters
$title : mixed
$name : mixed

api_data_insert()

记录接口请求数据

api_data_insert([mixed $data = [] ]) : mixed
Parameters
$data : mixed = []
cookie(mixed $name[, mixed $value = '' ][, mixed $expire = 0 ]) : mixed
Parameters
$name : mixed
$value : mixed = ''
$expire : mixed = 0
cookie_delete(mixed $name) : mixed
Parameters
$name : mixed

get_env()

获取ENV

get_env(mixed $key) : mixed
Parameters
$key : mixed

set_env()

设置ENV

set_env(mixed $key, mixed $val) : mixed
Parameters
$key : mixed
$val : mixed

set_config()

set_config(mixed $title, mixed $body) : mixed
Parameters
$title : mixed
$body : mixed

get_config()

get_config(mixed $title) : mixed
Parameters
$title : mixed

get_id_by_auto_insert()

设置或取ID

get_id_by_auto_insert(mixed $table[, mixed $data = [] ][, mixed $where = [] ][, mixed $has_time_and_update = false ]) : mixed
Parameters
$table : mixed
$data : mixed = []
$where : mixed = []
$has_time_and_update : mixed = false

get_all_or_one()

取一条或多条记录 get_all_or_one("novel_book",$where,'get_novel_book_row');

get_all_or_one(mixed $table, mixed $where[, mixed $fun = '' ][, mixed $limit = '' ]) : mixed
Parameters
$table : mixed
$where : mixed
$fun : mixed = ''
$limit : mixed = ''

db_set_field_type()

db_set_field_type(mixed $table, mixed $data) : mixed
Parameters
$table : mixed
$data : mixed

db_reset_data_by_filed_type()

权限字段类型设置值

db_reset_data_by_filed_type(mixed $table, mixed &$data) : mixed
Parameters
$table : mixed
$data : mixed

db_active()

激活数据库连接

db_active([mixed $value = 'mongo' ]) : mixed
Parameters
$value : mixed = 'mongo'

db_active_default()

使用默认monogo连接

db_active_default() : mixed

db_get_group()

group by 查寻

db_get_group(mixed $table[, mixed $field = [] ][, mixed $options = [] ][, mixed $is_pager = false ]) : mixed
Parameters
$table : mixed
$field : mixed = []
$options : mixed = []
$is_pager : mixed = false

_db_group_con()

mongodb groupby兼容

_db_group_con(mixed $k, mixed $value[, mixed $up_value = '' ]) : mixed
Parameters
$k : mixed
$value : mixed
$up_value : mixed = ''

db_update()

数据库更新记录

db_update(mixed $table, mixed $update_data, mixed $where[, mixed $use_action = true ]) : mixed
Parameters
$table : mixed
$update_data : mixed
$where : mixed
$use_action : mixed = true

db_del()

数据库删除记录

db_del(mixed $table, mixed $where) : mixed
Parameters
$table : mixed
$where : mixed

db_insert()

向数据库添加记录

db_insert(mixed $table, mixed $data[, mixed $use_action = true ]) : mixed
Parameters
$table : mixed
$data : mixed
$use_action : mixed = true

_db_get_when_array()

内部调用,处理 where条件是数组的情况

_db_get_when_array(mixed $list, mixed $call) : mixed
Parameters
$list : mixed
$call : mixed

db_get_one()

数据库查寻

db_get_one(mixed $table, mixed $field[, mixed $call = null ]) : mixed
Parameters
$table : mixed
$field : mixed
$call : mixed = null

set_db_cache()

设置数据库查寻字段走缓存

set_db_cache(mixed $table, mixed $field) : mixed
Parameters
$table : mixed
$field : mixed

get_db_cache_key()

取缓存key

get_db_cache_key(mixed $table, mixed $where) : mixed
Parameters
$table : mixed
$where : mixed

get_db_cache_where()

取缓存where

get_db_cache_where(mixed $table, mixed $where) : mixed
Parameters
$table : mixed
$where : mixed

db_get_cache()

取数据,带缓存

db_get_cache(mixed $table[, mixed $where = [] ][, mixed $limit = null ]) : mixed
Parameters
$table : mixed
$where : mixed = []
$limit : mixed = null

db_get()

取数据

db_get(mixed $table[, mixed $field = null ][, mixed $call = null ][, mixed $limit = null ]) : mixed
Parameters
$table : mixed
$field : mixed = null
$call : mixed = null
$limit : mixed = null

db_get_count()

数量

db_get_count(mixed $table, mixed $call) : mixed
Parameters
$table : mixed
$call : mixed

db_get_sum()

计算SUM

db_get_sum(mixed $table, mixed $field, mixed $call) : mixed
Parameters
$table : mixed
$field : mixed
$call : mixed

db_pager()

数据库分页

db_pager(mixed $table[, mixed $field = [] ][, mixed $call = [] ]) : mixed
Parameters
$table : mixed
$field : mixed = []
$call : mixed = []

db_get_pager()

分页

db_get_pager(mixed $table, mixed $call) : mixed
Parameters
$table : mixed
$call : mixed

db_action()

mongodb事务

db_action(mixed $call) : mixed
Parameters
$call : mixed

mongo_action()

mongo_action(mixed $call) : mixed
Parameters
$call : mixed

db_allow()

数据库字段允许

db_allow(mixed $table, mixed $data) : mixed
Parameters
$table : mixed
$data : mixed

db_allow_set()

设置允许字段

db_allow_set(mixed $table, mixed $data) : mixed
Parameters
$table : mixed
$data : mixed

vue_get_jidu()

季度 返回 k=>{0:开始 1:结束 flag:}

vue_get_jidu([mixed $time = '' ]) : mixed
Parameters
$time : mixed = ''

vue_get_jidu_array()

每个季度开始、结束时间

vue_get_jidu_array(mixed $year) : mixed
Parameters
$year : mixed

vue_get_last_day()

某月的最后一天

vue_get_last_day([mixed $month = '2023-07' ]) : mixed
Parameters
$month : mixed = '2023-07'

vue_message()

vue message

vue_message() : mixed

vue_loading()

loading效果

vue_loading([mixed $name = 'load' ][, mixed $txt = '加载中' ]) : mixed
Parameters
$name : mixed = 'load'
$txt : mixed = '加载中'

vue_el_table_drag()

<el-table class="draggable_video"></el-table>

vue_el_table_drag([mixed $ele = '.table' ][, mixed $data = 'form.video_list' ]) : mixed

$str = vue_el_table_drag($ele='.draggable_video',$data='form.video_list'); $vue->method("video_row_drop(ele)",$str); 表格拖拽

Parameters
$ele : mixed = '.table'
$data : mixed = 'form.video_list'

php_to_js()

Encodes a PHP variable into javascript representation.

php_to_js(mixed $value[, bool $safe = false ]) : string

Example:

$options=array('key1'=>true,'key2'=>123,'key3'=>'value');
echo php_to_js($options);
// The following javascript code would be generated:
// {'key1':true,'key2':123,'key3':'value'}

For highly complex data structures use and to serialize and unserialize.

If you are encoding user input, make sure $safe is set to true.

Parameters
$value : mixed

PHP variable to be encoded

$safe : bool = false

If true, 'js:' will not be allowed. In case of wrapping code with JavaScript expression will stay as is no matter what value this parameter is set to. Default is false. This parameter is available since 1.1.11.

Return values
string

the encoded string

yii_quote()

yii_quote(mixed $js[, mixed $forUrl = false ]) : mixed
Parameters
$js : mixed
$forUrl : mixed = false

        
On this page

Search results