Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
G
goods
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
goods
Commits
14fcb105
Commit
14fcb105
authored
Jul 17, 2021
by
jianghaiming
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update:set
parent
e7fa0b7d
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
252 additions
and
92 deletions
+252
-92
IdCertification.php
...or/api/php_services/src/Certification/IdCertification.php
+5
-3
SocialCreditCertification.php
..._services/src/Certification/SocialCreditCertification.php
+1
-1
ThreeElementsCertification.php
...services/src/Certification/ThreeElementsCertification.php
+1
-1
Daemon.php
vendor/api/php_services/src/Daemon/Daemon.php
+3
-1
JwUser.php
vendor/api/php_services/src/JwUser/JwUser.php
+11
-1
Ks3Api.php
vendor/api/php_services/src/Ksy/Ks3Api.php
+5
-6
Ksyun.php
vendor/api/php_services/src/Ksy/Ksyun.php
+10
-1
GetImage.php
vendor/api/php_services/src/ShopImage/GetImage.php
+37
-0
HttpUtil.php
vendor/api/php_utils/src/Http/HttpUtil.php
+150
-48
FrequencyLockUtil.php
vendor/api/php_utils/src/Lock/FrequencyLockUtil.php
+1
-1
InstalledVersions.php
vendor/composer/InstalledVersions.php
+7
-8
autoload_classmap.php
vendor/composer/autoload_classmap.php
+1
-0
autoload_static.php
vendor/composer/autoload_static.php
+1
-0
installed.json
vendor/composer/installed.json
+11
-12
installed.php
vendor/composer/installed.php
+7
-8
README.md
vendor/symfony/polyfill-php80/README.md
+1
-1
No files found.
vendor/api/php_services/src/Certification/IdCertification.php
View file @
14fcb105
...
...
@@ -8,9 +8,9 @@ class IdCertification
{
private
const
key
=
'_v7QkFPgzb887YD6BuBqzHPJMJalJ6Zt'
;
private
const
secret
=
'mDenoicZs2U_wd2jVmQQpCOPeM8jaFRu'
;
p
rivate
const
kuangshi_ocr_url
=
'https://api.megvii.com/faceid/v3/ocridcard'
;
p
rivate
const
kuangshi_get_token
=
'https://api.megvii.com/faceid/v3/sdk/get_biz_token'
;
p
rivate
const
kuangshi_face_compare
=
'https://api.megvii.com/faceid/v3/sdk/verify'
;
p
ublic
const
kuangshi_ocr_url
=
'https://api.megvii.com/faceid/v3/ocridcard'
;
p
ublic
const
kuangshi_get_token
=
'https://api.megvii.com/faceid/v3/sdk/get_biz_token'
;
p
ublic
const
kuangshi_face_compare
=
'https://api.megvii.com/faceid/v3/sdk/verify'
;
/**
* 身份证合法校验
...
...
@@ -232,6 +232,7 @@ class IdCertification
$final_data
[
'birth_year'
]
=
$ocr_data
[
'response'
][
'birth_year'
][
'result'
]
??
''
;
$final_data
[
'completeness'
]
=
$ocr_data
[
'response'
][
'completeness'
]
??
-
1
;
$final_data
[
'legality'
]
=
$ocr_data
[
'response'
][
'legality'
]
??
(
object
)[];
$final_data
[
'code'
]
=
$ocr_data
[
'response'
][
'code'
]
??
-
1
;
return
$final_data
;
}
...
...
@@ -247,6 +248,7 @@ class IdCertification
$final_data
[
'valid_date_end'
]
=
$ocr_data
[
'response'
][
'valid_date_end'
][
'result'
]
??
''
;
$final_data
[
'completeness'
]
=
$ocr_data
[
'response'
][
'completeness'
]
??
-
1
;
$final_data
[
'legality'
]
=
$ocr_data
[
'response'
][
'legality'
]
??
(
object
)[];
$final_data
[
'code'
]
=
$ocr_data
[
'response'
][
'code'
]
??
-
1
;
return
$final_data
;
}
}
\ No newline at end of file
vendor/api/php_services/src/Certification/SocialCreditCertification.php
View file @
14fcb105
...
...
@@ -7,7 +7,7 @@ class SocialCreditCertification
{
private
const
account
=
'BJyimingzhineng'
;
private
const
app_key
=
'deee9c9877e5452f8838cfc5130ac5ad'
;
p
rivate
const
ocr_bussiness_url
=
'http://apistore.xmturui.com/apistore/ocr-new'
;
p
ublic
const
ocr_bussiness_url
=
'http://apistore.xmturui.com/apistore/ocr-new'
;
private
const
engine_type
=
'blic-new'
;
/**
...
...
vendor/api/php_services/src/Certification/ThreeElementsCertification.php
View file @
14fcb105
...
...
@@ -8,7 +8,7 @@ class ThreeElementsCertification
{
private
const
app_key
=
'392df35aa98721c597cf20b85d21eebc'
;
//运营商三要素检测接口
p
rivate
const
test_mobile3_ele_Sim_url
=
'https://api.goodsdatas.com:8443/credit/Mobile3EleSim'
;
p
ublic
const
test_mobile3_ele_Sim_url
=
'https://api.goodsdatas.com:8443/credit/Mobile3EleSim'
;
//加密需要的相关参数
private
const
salt
=
'A99BC8325635E303'
;
...
...
vendor/api/php_services/src/Daemon/Daemon.php
View file @
14fcb105
...
...
@@ -263,11 +263,12 @@ class Daemon
*/
protected
function
set_base_config
(){
ini_set
(
"display_errors"
,
1
);
error_reporting
(
'E_ALL'
);
ini_set
(
'date.timezone'
,
'Asia/Shanghai'
);
ini_set
(
"memory_limit"
,
'2048M'
);
error_reporting
(
E_ALL
);
//日志存储到 php-error.log
/*
//创建任务日志文件
$log_dir = ROOT_PATH.'/logs/daemon/'.$this->task_name;
$log_path = $log_dir.'/'.$this->task_name.'.log';
...
...
@@ -280,6 +281,7 @@ class Daemon
die($log_path."文件无法创建"."\n");
}
}
*/
$this
->
log_signature
=
"daemon:"
.
$this
->
task_name
;
}
...
...
vendor/api/php_services/src/JwUser/JwUser.php
View file @
14fcb105
...
...
@@ -14,6 +14,7 @@ use Api\PhpUtils\Common\TimeOut;
use
Api\PhpUtils\Http\Request
;
use
App\Exception\custom\CodeSpecialException
;
use
Api\PhpUtils\Log\FileLog
;
use
Api\PhpUtils\Mon\MonUtil
;
class
JwUser
{
...
...
@@ -61,7 +62,16 @@ class JwUser
$params
=
[
"userId"
=>
$params
[
'user_id'
]];
//$user_info = (new TimeOut())->runPost($url, $params);
$user_info
=
(
new
Request
())
->
post
(
$url
,
$params
,
0
,
''
,
''
,
0
,
true
,
'jw_user'
);
$begin
=
microtime
(
true
);
$user_info
=
(
new
Request
())
->
post
(
$url
,
$params
);
$end
=
microtime
(
true
);
$total_time
=
round
((
$end
-
$begin
),
4
)
*
1000
;
if
(
!
empty
(
$user_info
[
'response'
])){
$code
=
$user_info
[
'response'
][
'code'
];
}
else
{
$code
=
-
1
;
}
MonUtil
::
proxyMon
(
$url
,
$code
,
'jw_user'
,
$total_time
);
FileLog
::
info
(
'jw_user_getUserByUserId'
,
json_encode
(
$user_info
));
if
(
!
$user_info
)
{
throw
new
CodeSpecialException
(
"timeout"
);
...
...
vendor/api/php_services/src/Ksy/Ks3Api.php
View file @
14fcb105
...
...
@@ -47,7 +47,7 @@ class Ks3Api
"signature"
=>
$signature
,
"type"
=>
$type
,
];
return
HttpUtil
::
POST
(
$url
,
$params
);
return
HttpUtil
::
post
(
$url
,
$params
);
}
/**
...
...
@@ -59,12 +59,11 @@ class Ks3Api
* @param $headers
* @return array
*/
public
static
function
signature
(
$resource
,
$httpMethod
,
$contentType
,
$contentMd5
,
$headers
)
public
static
function
signature
(
$resource
,
$httpMethod
,
$contentType
,
$contentMd5
,
$headers
,
$date
)
{
$url
=
self
::
BASE_URL
.
self
::
PATH_SIGNATURE
;
$timestamp
=
self
::
msectime
();
$date
=
gmdate
(
self
::
KS_DATE_SCHEME
);
$md5Str
=
$httpMethod
.
"&"
.
$contentType
.
"&"
.
$contentMd5
.
"&"
.
$date
.
"&"
.
$resource
.
"&"
.
$headers
.
"&"
.
$timestamp
.
"&"
.
self
::
KSYUN_SK
;
$signature
=
self
::
KSYUN_AK
.
":"
.
md5
(
$md5Str
);
...
...
@@ -79,7 +78,7 @@ class Ks3Api
"resource"
=>
$resource
,
"headers"
=>
$headers
,
];
return
HttpUtil
::
POST
(
$url
,
$params
);
return
HttpUtil
::
post
(
$url
,
$params
);
}
/**
...
...
@@ -113,7 +112,7 @@ class Ks3Api
"content_type"
=>
$contentType
,
"extend"
=>
$extendJsonStr
,
];
return
HttpUtil
::
POST
(
$url
,
$params
);
return
HttpUtil
::
post
(
$url
,
$params
);
}
/**
...
...
@@ -140,7 +139,7 @@ class Ks3Api
"signature"
=>
$signature
,
"extend"
=>
$extendJsonStr
,
];
return
HttpUtil
::
POST
(
$url
,
$params
);
return
HttpUtil
::
post
(
$url
,
$params
);
}
/**
...
...
vendor/api/php_services/src/Ksy/Ksyun.php
View file @
14fcb105
...
...
@@ -2,6 +2,7 @@
namespace
Api\PhpServices\Ksy
;
use
Api\PhpUtils\Http\Request
;
use
Api\PhpUtils\Mon\MonUtil
;
class
Ksyun
{
...
...
@@ -39,8 +40,16 @@ class Ksyun
'bucket'
=>
$bucket
,
'expire'
=>
$expire_time
,
];
$begin
=
microtime
(
true
);
$res
=
(
new
Request
())
->
post
(
self
::
get_down_from_ksyun
,
$post_data
,
50
,
'json'
,[],
1
,
true
);
$end
=
microtime
(
true
);
$total_time
=
round
((
$end
-
$begin
),
4
)
*
1000
;
if
(
isset
(
$res
[
'response'
][
'code'
])){
$code
=
$res
[
'response'
][
'code'
];
}
else
{
$code
=
-
1
;
}
MonUtil
::
proxyMon
(
self
::
get_down_from_ksyun
,
$code
,
'merchant'
,
$total_time
);
if
(
isset
(
$res
[
'code'
],
$res
[
'response'
][
'status'
])
&&
$res
[
'response'
][
'status'
]
===
'success'
)
{
return
$res
[
'response'
][
'data'
];
}
...
...
vendor/api/php_services/src/ShopImage/GetImage.php
View file @
14fcb105
...
...
@@ -252,7 +252,44 @@ class GetImage
return
$image_thump
;
}
private
function
curlImage
(
$url
,
$save_dir
=
''
,
$filename
=
''
,
$type
=
0
){
$mimes
=
array
(
'image/bmp'
=>
'bmp'
,
'image/gif'
=>
'gif'
,
'image/jpeg'
=>
'jpg'
,
'image/png'
=>
'png'
,
'image/tiff'
=>
'tiff'
,
'image/x-icon'
=>
'ico'
,
'mage/vnd.wap.wbmp'
=>
'wbmp'
,
'image/fax'
=>
'fax'
,
'image/pnetvue'
=>
'net'
,
'image/vnd.rn-realpix'
=>
'rp'
);
//创建保存目录
if
(
!
file_exists
(
$save_dir
)
&&!
mkdir
(
$save_dir
,
0777
,
true
)){
return
false
;
}
// 获取响应头
if
((
$headers
=
get_headers
(
$url
,
1
))
!==
false
){
$type
=
$headers
[
'Content-Type'
];
if
(
isset
(
$mimes
[
$type
]))
{
$this
->
extension
=
$mimes
[
$type
];
$file_path
=
$save_dir
.
$filename
.
"."
.
$this
->
extension
;
$contents
=
file_get_contents
(
$url
);
if
(
file_put_contents
(
$file_path
,
$contents
))
{
return
$save_dir
.
$filename
.
"."
.
$this
->
extension
;
}
}
}
}
private
function
curlImageBak
(
$url
,
$save_dir
=
''
,
$filename
=
''
,
$type
=
0
){
if
(
trim
(
$url
)
==
''
){
return
array
(
'file_name'
=>
''
,
'save_path'
=>
''
,
'error'
=>
1
);
}
...
...
vendor/api/php_utils/src/Http/HttpUtil.php
View file @
14fcb105
...
...
@@ -25,37 +25,104 @@ use Api\PhpUtils\Mon\MonUtil;
class
HttpUtil
{
// 成功
private
const
CODE_SUCCESS
=
0
;
// 失败
private
const
CODE_FAIL
=
999999
;
static
function
HEAD
(
$url
,
$timeout
=
10000
,
$retries
=
1
,
$headers
=
false
,
$proxy
=
false
)
/**
* head 请求
* @param string $url 链接地址
* @param int $timeout 超时时间(MS)
* @param int $retries 重试次数
* @param array $headers 请求头
* @param string $proxy 代理地址
* @return array Response
*/
public
static
function
head
(
string
$url
,
int
$timeout
=
10000
,
int
$retries
=
1
,
array
$headers
=
[],
string
$proxy
=
''
)
:
array
{
return
self
::
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
false
,
$proxy
,
'HEAD'
);
return
self
::
curl
(
$url
,
$timeout
,
$retries
,
$headers
,
false
,
$proxy
,
'HEAD'
);
}
static
function
GET
(
$url
,
$params
,
$timeout
=
10000
,
$retries
=
1
,
$headers
=
false
,
$proxy
=
false
,
$curl_opts
=
array
())
/**
*
* @param string $url
* @param array $params
* @param int $timeout
* @param int $retries
* @param array $headers
* @param string $proxy
* @param array $curl_opts
* @return array
*/
public
static
function
get
(
string
$url
,
array
$params
=
[],
int
$timeout
=
10000
,
int
$retries
=
1
,
array
$headers
=
[],
string
$proxy
=
''
,
array
$curl_opts
=
[])
:
array
{
$url
=
$url
.
"?"
.
http_build_query
(
$params
);
return
self
::
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
[],
$proxy
,
'GET'
,
$curl_opts
);
return
self
::
curl
(
$url
,
$timeout
,
$retries
,
$headers
,
[],
$proxy
,
'GET'
,
$curl_opts
);
}
static
function
PUT
(
$url
,
$post
,
$timeout
=
10000
,
$retries
=
1
,
$headers
=
false
,
$proxy
=
false
)
/**
* 发起 curl put 请求
* @param string $url url 地址
* @param mixed $post POST 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param int $timeout 超时时间(MS)
* @param int $retries 重试次数
* @param array $headers 请求头
* @param string $proxy 代理地址
* @return array Response
*/
public
static
function
put
(
string
$url
,
$post
,
int
$timeout
=
10000
,
int
$retries
=
1
,
array
$headers
=
[],
string
$proxy
=
''
)
:
array
{
return
self
::
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
$post
,
$proxy
,
'PUT'
);
return
self
::
curl
(
$url
,
$timeout
,
$retries
,
$headers
,
$post
,
$proxy
,
'PUT'
);
}
static
function
POST
(
$url
,
$post
,
$timeout
=
10000
,
$retries
=
1
,
$headers
=
false
,
$proxy
=
false
,
$curl_opts
=
array
())
/**
* 发起 curl post 请求
* @param string $url url 地址
* @param mixed $post POST 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param int $timeout 超时时间(MS)
* @param int $retries 重试次数
* @param array $headers 请求头
* @param string $proxy 代理地址
* @param array $curl_opts curl 参数
* @return array Response
*/
public
static
function
post
(
string
$url
,
$post
,
int
$timeout
=
10000
,
int
$retries
=
1
,
array
$headers
=
[],
string
$proxy
=
''
,
array
$curl_opts
=
[])
:
array
{
return
self
::
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
$post
,
$proxy
,
'POST'
,
$curl_opts
);
return
self
::
curl
(
$url
,
$timeout
,
$retries
,
$headers
,
$post
,
$proxy
,
'POST'
,
$curl_opts
);
}
static
function
DELETE
(
$url
,
$timeout
=
10000
,
$retries
=
1
,
$headers
=
false
,
$proxy
=
false
)
/**
* 发起 curl delete 请求
* @param string $url url 地址
* @param int $timeout 超时时间(MS)
* @param int $retries 重试次数
* @param array $headers 请求头
* @param string $proxy 代理地址
* @return array Response
*/
public
static
function
delete
(
string
$url
,
int
$timeout
=
10000
,
int
$retries
=
1
,
array
$headers
=
[],
string
$proxy
=
''
)
:
array
{
return
self
::
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
false
,
$proxy
,
'DELETE'
);
return
self
::
curl
(
$url
,
$timeout
,
$retries
,
$headers
,
false
,
$proxy
,
'DELETE'
);
}
static
function
CURL
(
$url
,
$timeout
,
$retries
,
$headers
,
$post
=
false
,
$proxy
=
false
,
$method
=
'GET'
,
$curl_opts
=
array
())
/**
* 发起 curl 请求
* @param string $url url 地址
* @param int $timeout 超时时间(MS)
* @param int $retries 重试次数
* @param array $headers 请求头
* @param mixed $post POST 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param string $proxy 代理地址
* @param string $method 请求方法
* @param array $curl_opts curl 参数
* @return array Response
*/
public
static
function
curl
(
string
$url
,
int
$timeout
,
int
$retries
,
array
$headers
,
$post
,
string
$proxy
=
''
,
string
$method
=
'GET'
,
array
$curl_opts
=
[])
:
array
{
$ch
=
self
::
CH
(
$url
,
$timeout
,
$headers
,
$post
,
$proxy
,
$method
,
$curl_opts
);
$ch
=
self
::
ch
(
$url
,
$timeout
,
$headers
,
$post
,
$proxy
,
$method
,
$curl_opts
);
$response
=
self
::
defaultResponse
();
...
...
@@ -115,17 +182,17 @@ class HttpUtil
}
/**
*
* @param $url
* @param $timeout
* @param
false
$headers
* @param
false
$post
* @param
false
$proxy
*
生产 curl句柄
* @param
string
$url
* @param
int
$timeout
* @param
array
$headers
* @param
mixed
$post
* @param
string
$proxy
* @param string $method
* @param array $curl_opts
* @return false|mixed|resource
*/
static
function
CH
(
$url
,
$timeout
,
$headers
=
false
,
$post
=
false
,
$proxy
=
false
,
$method
=
'GET'
,
$curl_opts
=
array
()
)
private
static
function
ch
(
string
$url
,
int
$timeout
,
array
$headers
=
[],
$post
,
string
$proxy
=
''
,
string
$method
=
'GET'
,
array
$curl_opts
=
[]
)
{
$ch
=
curl_init
(
$url
);
...
...
@@ -143,11 +210,11 @@ class HttpUtil
curl_setopt
(
$ch
,
CURLOPT_CONNECTTIMEOUT_MS
,
$timeout
);
curl_setopt
(
$ch
,
CURLOPT_HTTP_VERSION
,
CURL_HTTP_VERSION_1_0
);
if
(
$headers
!==
false
)
if
(
!
empty
(
$headers
)
)
{
curl_setopt
(
$ch
,
CURLOPT_HTTPHEADER
,
$headers
);
}
if
(
$proxy
!==
false
)
if
(
$proxy
)
{
curl_setopt
(
$ch
,
CURLOPT_PROXY
,
$proxy
);
}
...
...
@@ -182,16 +249,36 @@ class HttpUtil
}
return
$ch
;
}
static
function
MULTI_POST
(
$urls
,
$posts
,
$timeouts
,
$headers
,
$proxies
,
$curl_opts
)
/**
* 并发 curl
* @param array $urls 链接数组
* @param array $timeouts 超时时间数组(MS)
* @param array $posts POST数组 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param array $headers header 数组
* @param array $proxies 代理地址数组
* @param array $curl_opts curl opts 数组
* @return array
*/
public
static
function
concurrencyPost
(
array
$urls
=
[],
array
$posts
=
[],
array
$timeouts
=
[],
array
$headers
=
[],
array
$proxies
=
[],
array
$curl_opts
=
[])
:
array
{
$methods
=
[];
foreach
(
$urls
as
$k
=>
$url
)
{
$methods
[
$k
]
=
'POST'
;
}
return
self
::
MULTI_CURL
(
$urls
,
$methods
,
$posts
,
$timeouts
,
$headers
,
$proxies
,
$curl_opts
);
return
self
::
concurrencyCurl
(
$urls
,
$methods
,
$posts
,
$timeouts
,
$headers
,
$proxies
,
$curl_opts
);
}
static
function
MULTI_GET
(
$urls
=
[],
$params
=
[],
$timeouts
=
[],
$headers
=
[],
$proxies
=
[],
$curl_opts
=
[])
/**
* 并发 curl
* @param array $urls 链接数组
* @param array $timeouts 超时时间数组(MS)
* @param array $headers header 数组
* @param array $proxies 代理地址数组
* @param array $curl_opts curl opts 数组
* @return array
*/
public
static
function
concurrencyGet
(
array
$urls
=
[],
$params
=
[],
array
$timeouts
=
[],
array
$headers
=
[],
array
$proxies
=
[],
array
$curl_opts
=
[])
:
array
{
$methods
=
$posts
=
[];
foreach
(
$urls
as
$k
=>
$url
)
{
...
...
@@ -200,22 +287,21 @@ class HttpUtil
$posts
[
$k
]
=
false
;
}
return
self
::
MULTI_CURL
(
$urls
,
$methods
,
$posts
,
$timeouts
,
$headers
,
$proxies
,
$curl_opts
);
return
self
::
concurrencyCurl
(
$urls
,
$methods
,
$posts
,
$timeouts
,
$headers
,
$proxies
,
$curl_opts
);
}
/**
*
* @param array $urls 链接
* @param array $methods 请求方法 (GET POST ...)
* @param array $posts POST 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param array $timeouts
* @param array $headers
* // * @param int $retry
* @param array $proxies
* @param array $curl_opts
* 并发 curl
* @param array $urls 链接数组
* @param array $methods 请求方法数组 (GET POST ...)
* @param array $posts POST数组 内容 参见 https://www.php.net/manual/en/function.curl-setopt.php CURLOPT_POSTFIELDS
* @param array $timeouts 超时时间数组(MS)
* @param array $headers header 数组
* @param array $proxies 代理地址数组
* @param array $curl_opts curl opts 数组
* @return array
*/
static
function
MULTI_CURL
(
$urls
=
[],
$methods
=
[],
$posts
=
[],
$timeouts
=
[],
$headers
=
[],
$proxies
=
[],
$curl_opts
=
[])
public
static
function
concurrencyCurl
(
array
$urls
=
[],
array
$methods
=
[],
array
$posts
=
[],
array
$timeouts
=
[],
array
$headers
=
[],
array
$proxies
=
[],
array
$curl_opts
=
[])
:
array
{
//step one 初始化一个批处理handle
$mh
=
curl_multi_init
();
...
...
@@ -223,7 +309,7 @@ class HttpUtil
//step two 往批处理handle 添加curl_init来的子handle
foreach
(
$urls
as
$i
=>
$url
)
{
$ch
=
self
::
CH
(
$url
,
$timeouts
[
$i
],
$headers
[
$i
],
$posts
[
$i
],
$proxies
[
$i
],
$methods
[
$i
],
$curl_opts
);
$ch
=
self
::
CH
(
(
string
)
$url
,
(
int
)
$timeouts
[
$i
],
(
array
)
$headers
[
$i
],
$posts
[
$i
],
(
string
)
$proxies
[
$i
],
(
string
)
$methods
[
$i
],
(
array
)
$curl_opts
[
$i
]
);
$conn
[
$i
]
=
$ch
;
curl_multi_add_handle
(
$mh
,
$conn
[
$i
]);
...
...
@@ -264,10 +350,17 @@ class HttpUtil
/*
* 监控打点,模块名默认为第三方服务url,指标为请求返回的HTTP_code与总响应时间
*/
private
static
function
addMon
(
$url
,
$http_code
,
$request_time
)
{
private
static
function
addMon
(
string
$url
,
int
$http_code
,
float
$request_time
)
{
MonUtil
::
proxyMon
(
$url
,
$http_code
,
''
,
$request_time
);
}
/**
* 添加log
* @param $method
* @param $urls
* @param $params
* @param $response
*/
private
static
function
addLog
(
$method
,
$urls
,
$params
,
$response
)
{
//过滤无意义的日志
...
...
@@ -303,24 +396,33 @@ class HttpUtil
/**
* 过滤resource类型字段
* @param
array $arr
* @param
mixed $params array or string resource
* @return array
*/
private
static
function
change
(
$
arr
)
private
static
function
change
(
$
params
)
{
foreach
(
$arr
as
$k
=>
$v
)
{
if
(
is_array
(
$params
))
{
foreach
(
$params
as
$k
=>
$v
)
{
if
(
is_array
(
$v
))
{
$arr
[
$k
]
=
self
::
change
(
$v
);
$params
[
$k
]
=
self
::
change
(
$v
);
}
else
{
if
(
strpos
(
gettype
(
$v
),
'resource'
)
!==
false
)
{
$arr
[
$k
]
=
gettype
(
$v
);
$params
[
$k
]
=
gettype
(
$v
);
}
}
}
return
$arr
;
}
else
{
if
(
strpos
(
gettype
(
$params
),
'resource'
)
!==
false
)
{
$params
=
gettype
(
$params
);
}
}
return
$params
;
}
/**
* 生成返回结果
* @param string $response_content 请求返回结果
* @param resource $ch_handle cURL resource
* @return array
...
...
vendor/api/php_utils/src/Lock/FrequencyLockUtil.php
View file @
14fcb105
...
...
@@ -10,7 +10,7 @@ use Api\PhpUtils\Redis\RedisUtil;
class
FrequencyLockUtil
{
const
MIN_FREQUENCY_SECONDS
=
3
0
;
// 频率锁默认最小间隔秒数
const
MIN_FREQUENCY_SECONDS
=
3
;
// 频率锁默认最小间隔秒数
const
MIN_FREQUENCY_TIMES
=
1
;
// 频率锁默认最小间隔秒数内最大访问次数
const
PREFIX_FREQUENCY_LOCK
=
'flk:'
;
...
...
vendor/composer/InstalledVersions.php
View file @
14fcb105
...
...
@@ -32,7 +32,7 @@ private static $installed = array (
'aliases'
=>
array
(
),
'reference'
=>
'
4f8e8782a402f2ef95b6b5b9b21c23da94816828
'
,
'reference'
=>
'
e7fa0b7dd9584f3f9c8b489b4351a6b4858f62ea
'
,
'name'
=>
'yidian/yaf_demo'
,
),
'versions'
=>
...
...
@@ -45,7 +45,7 @@ private static $installed = array (
array
(
0
=>
'9999999-dev'
,
),
'reference'
=>
'
f7b44c008d561d3785797073d0eb875fb2f16756
'
,
'reference'
=>
'
03c3e30e32f69eb439eb9e116adc0da98538c11b
'
,
),
'api/php_utils'
=>
array
(
...
...
@@ -55,7 +55,7 @@ private static $installed = array (
array
(
0
=>
'9999999-dev'
,
),
'reference'
=>
'
e4bc1258fafead42eb6ac7b84ae743f08d557a99
'
,
'reference'
=>
'
3651661da73b73fd8c5a02db0667f3937f4875f8
'
,
),
'bacon/bacon-qr-code'
=>
array
(
...
...
@@ -196,11 +196,10 @@ private static $installed = array (
),
'psr/log'
=>
array
(
'pretty_version'
=>
'
dev-master
'
,
'version'
=>
'
dev-master
'
,
'pretty_version'
=>
'
1.1.4
'
,
'version'
=>
'
1.1.4.0
'
,
'aliases'
=>
array
(
0
=>
'1.1.x-dev'
,
),
'reference'
=>
'd49695b909c3b7628b6289db5479a1c204601f11'
,
),
...
...
@@ -299,7 +298,7 @@ private static $installed = array (
array
(
0
=>
'1.23.x-dev'
,
),
'reference'
=>
'
eca0bf41ed421bed1b57c4958bab16aa86b757d0
'
,
'reference'
=>
'
19d03c391c6abb6791f5f757fb36e551bffeaa68
'
,
),
'symfony/property-access'
=>
array
(
...
...
@@ -335,7 +334,7 @@ private static $installed = array (
'aliases'
=>
array
(
),
'reference'
=>
'
4f8e8782a402f2ef95b6b5b9b21c23da94816828
'
,
'reference'
=>
'
e7fa0b7dd9584f3f9c8b489b4351a6b4858f62ea
'
,
),
),
);
...
...
vendor/composer/autoload_classmap.php
View file @
14fcb105
...
...
@@ -102,6 +102,7 @@ return array(
'App\\Models\\goods\\mysql\\GoodsSnapshot'
=>
$baseDir
.
'/application/models/goods/mysql/GoodsSnapshot.php'
,
'App\\Models\\goods\\mysql\\GoodsSpu'
=>
$baseDir
.
'/application/models/goods/mysql/GoodsSpu.php'
,
'App\\Models\\goods\\mysql\\InventoryOperationRecord'
=>
$baseDir
.
'/application/models/goods/mysql/InventoryOperationRecord.php'
,
'App\\Models\\goods\\mysql\\LifeAccountShopNum'
=>
$baseDir
.
'/application/models/goods/mysql/LifeAccountShopNum.php'
,
'App\\Models\\goods\\mysql\\PaySuccessGoodsCallbackRecord'
=>
$baseDir
.
'/application/models/goods/mysql/PaySuccessGoodsCallbackRecord.php'
,
'App\\Models\\goods\\mysql\\Shop'
=>
$baseDir
.
'/application/models/goods/mysql/Shop.php'
,
'App\\Models\\goods\\mysql\\Tcc'
=>
$baseDir
.
'/application/models/goods/mysql/Tcc.php'
,
...
...
vendor/composer/autoload_static.php
View file @
14fcb105
...
...
@@ -331,6 +331,7 @@ class ComposerStaticInit90e85a2e64f8339192f3e91b8700b9f2
'App\\Models\\goods\\mysql\\GoodsSnapshot'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/GoodsSnapshot.php'
,
'App\\Models\\goods\\mysql\\GoodsSpu'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/GoodsSpu.php'
,
'App\\Models\\goods\\mysql\\InventoryOperationRecord'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/InventoryOperationRecord.php'
,
'App\\Models\\goods\\mysql\\LifeAccountShopNum'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/LifeAccountShopNum.php'
,
'App\\Models\\goods\\mysql\\PaySuccessGoodsCallbackRecord'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/PaySuccessGoodsCallbackRecord.php'
,
'App\\Models\\goods\\mysql\\Shop'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/Shop.php'
,
'App\\Models\\goods\\mysql\\Tcc'
=>
__DIR__
.
'/../..'
.
'/application/models/goods/mysql/Tcc.php'
,
...
...
vendor/composer/installed.json
View file @
14fcb105
...
...
@@ -7,7 +7,7 @@
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://git.yidian-inc.com:8021/bp/php_services.git"
,
"reference"
:
"
f7b44c008d561d3785797073d0eb875fb2f16756
"
"reference"
:
"
03c3e30e32f69eb439eb9e116adc0da98538c11b
"
},
"require"
:
{
"api/php_utils"
:
"dev-master"
,
...
...
@@ -15,7 +15,7 @@
"perftools/php-profiler"
:
"^0.18.0"
,
"php"
:
"7.2.*"
},
"time"
:
"2021-07-1
4T09:06:17
+00:00"
,
"time"
:
"2021-07-1
7T15:33:26
+00:00"
,
"default-branch"
:
true
,
"type"
:
"library"
,
"installation-source"
:
"source"
,
...
...
@@ -34,7 +34,7 @@
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://git.yidian-inc.com:8021/bp/php_utils.git"
,
"reference"
:
"
e4bc1258fafead42eb6ac7b84ae743f08d557a99
"
"reference"
:
"
3651661da73b73fd8c5a02db0667f3937f4875f8
"
},
"require"
:
{
"elasticsearch/elasticsearch"
:
"~7.0"
,
...
...
@@ -46,7 +46,7 @@
"mongodb/mongodb"
:
"1.4.3"
,
"php"
:
"7.2.*"
},
"time"
:
"2021-07-14T
08:30:4
1+00:00"
,
"time"
:
"2021-07-14T
14:21:3
1+00:00"
,
"default-branch"
:
true
,
"type"
:
"library"
,
"installation-source"
:
"source"
,
...
...
@@ -950,8 +950,8 @@
},
{
"name"
:
"psr/log"
,
"version"
:
"
dev-master
"
,
"version_normalized"
:
"
dev-master
"
,
"version"
:
"
1.1.4
"
,
"version_normalized"
:
"
1.1.4.0
"
,
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/php-fig/log.git"
,
...
...
@@ -967,7 +967,6 @@
"php"
:
">=5.3.0"
},
"time"
:
"2021-05-03T11:20:27+00:00"
,
"default-branch"
:
true
,
"type"
:
"library"
,
"extra"
:
{
"branch-alias"
:
{
...
...
@@ -1685,18 +1684,18 @@
"source"
:
{
"type"
:
"git"
,
"url"
:
"https://github.com/symfony/polyfill-php80.git"
,
"reference"
:
"
eca0bf41ed421bed1b57c4958bab16aa86b757d0
"
"reference"
:
"
19d03c391c6abb6791f5f757fb36e551bffeaa68
"
},
"dist"
:
{
"type"
:
"zip"
,
"url"
:
"https://api.github.com/repos/symfony/polyfill-php80/zipball/
eca0bf41ed421bed1b57c4958bab16aa86b757d0
"
,
"reference"
:
"
eca0bf41ed421bed1b57c4958bab16aa86b757d0
"
,
"url"
:
"https://api.github.com/repos/symfony/polyfill-php80/zipball/
19d03c391c6abb6791f5f757fb36e551bffeaa68
"
,
"reference"
:
"
19d03c391c6abb6791f5f757fb36e551bffeaa68
"
,
"shasum"
:
""
},
"require"
:
{
"php"
:
">=7.1"
},
"time"
:
"2021-0
2-19T12:13:01
+00:00"
,
"time"
:
"2021-0
7-13T14:34:27
+00:00"
,
"default-branch"
:
true
,
"type"
:
"library"
,
"extra"
:
{
...
...
@@ -1747,7 +1746,7 @@
"shim"
],
"support"
:
{
"source"
:
"https://github.com/symfony/polyfill-php80/tree/
v1.23.0
"
"source"
:
"https://github.com/symfony/polyfill-php80/tree/
main
"
},
"funding"
:
[
{
...
...
vendor/composer/installed.php
View file @
14fcb105
...
...
@@ -6,7 +6,7 @@
'aliases'
=>
array
(
),
'reference'
=>
'
4f8e8782a402f2ef95b6b5b9b21c23da94816828
'
,
'reference'
=>
'
e7fa0b7dd9584f3f9c8b489b4351a6b4858f62ea
'
,
'name'
=>
'yidian/yaf_demo'
,
),
'versions'
=>
...
...
@@ -19,7 +19,7 @@
array
(
0
=>
'9999999-dev'
,
),
'reference'
=>
'
f7b44c008d561d3785797073d0eb875fb2f16756
'
,
'reference'
=>
'
03c3e30e32f69eb439eb9e116adc0da98538c11b
'
,
),
'api/php_utils'
=>
array
(
...
...
@@ -29,7 +29,7 @@
array
(
0
=>
'9999999-dev'
,
),
'reference'
=>
'
e4bc1258fafead42eb6ac7b84ae743f08d557a99
'
,
'reference'
=>
'
3651661da73b73fd8c5a02db0667f3937f4875f8
'
,
),
'bacon/bacon-qr-code'
=>
array
(
...
...
@@ -170,11 +170,10 @@
),
'psr/log'
=>
array
(
'pretty_version'
=>
'
dev-master
'
,
'version'
=>
'
dev-master
'
,
'pretty_version'
=>
'
1.1.4
'
,
'version'
=>
'
1.1.4.0
'
,
'aliases'
=>
array
(
0
=>
'1.1.x-dev'
,
),
'reference'
=>
'd49695b909c3b7628b6289db5479a1c204601f11'
,
),
...
...
@@ -273,7 +272,7 @@
array
(
0
=>
'1.23.x-dev'
,
),
'reference'
=>
'
eca0bf41ed421bed1b57c4958bab16aa86b757d0
'
,
'reference'
=>
'
19d03c391c6abb6791f5f757fb36e551bffeaa68
'
,
),
'symfony/property-access'
=>
array
(
...
...
@@ -309,7 +308,7 @@
'aliases'
=>
array
(
),
'reference'
=>
'
4f8e8782a402f2ef95b6b5b9b21c23da94816828
'
,
'reference'
=>
'
e7fa0b7dd9584f3f9c8b489b4351a6b4858f62ea
'
,
),
),
);
vendor/symfony/polyfill-php80/README.md
View file @
14fcb105
...
...
@@ -16,7 +16,7 @@ This component provides features added to PHP 8.0 core:
-
[
`get_resource_id`
](
https://php.net/get_resource_id
)
More information can be found in the
[
main Polyfill README
](
https://github.com/symfony/polyfill/blob/ma
ster
/README.md
)
.
[
main Polyfill README
](
https://github.com/symfony/polyfill/blob/ma
in
/README.md
)
.
License
=======
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment