Commit 206eca83 authored by mengweifu's avatar mengweifu

update: HttpUtil

parent 69c9bde1
...@@ -8,9 +8,9 @@ class IdCertification ...@@ -8,9 +8,9 @@ class IdCertification
{ {
private const key = '_v7QkFPgzb887YD6BuBqzHPJMJalJ6Zt'; private const key = '_v7QkFPgzb887YD6BuBqzHPJMJalJ6Zt';
private const secret = 'mDenoicZs2U_wd2jVmQQpCOPeM8jaFRu'; private const secret = 'mDenoicZs2U_wd2jVmQQpCOPeM8jaFRu';
private const kuangshi_ocr_url = 'https://api.megvii.com/faceid/v3/ocridcard'; public const kuangshi_ocr_url = 'https://api.megvii.com/faceid/v3/ocridcard';
private const kuangshi_get_token = 'https://api.megvii.com/faceid/v3/sdk/get_biz_token'; public const kuangshi_get_token = 'https://api.megvii.com/faceid/v3/sdk/get_biz_token';
private const kuangshi_face_compare = 'https://api.megvii.com/faceid/v3/sdk/verify'; public const kuangshi_face_compare = 'https://api.megvii.com/faceid/v3/sdk/verify';
/** /**
* 身份证合法校验 * 身份证合法校验
...@@ -232,6 +232,7 @@ class IdCertification ...@@ -232,6 +232,7 @@ class IdCertification
$final_data['birth_year'] = $ocr_data['response']['birth_year']['result'] ?? ''; $final_data['birth_year'] = $ocr_data['response']['birth_year']['result'] ?? '';
$final_data['completeness'] = $ocr_data['response']['completeness'] ?? -1; $final_data['completeness'] = $ocr_data['response']['completeness'] ?? -1;
$final_data['legality'] = $ocr_data['response']['legality'] ?? (object)[]; $final_data['legality'] = $ocr_data['response']['legality'] ?? (object)[];
$final_data['code'] = $ocr_data['response']['code'] ?? -1;
return $final_data; return $final_data;
} }
...@@ -247,6 +248,7 @@ class IdCertification ...@@ -247,6 +248,7 @@ class IdCertification
$final_data['valid_date_end'] = $ocr_data['response']['valid_date_end']['result'] ?? ''; $final_data['valid_date_end'] = $ocr_data['response']['valid_date_end']['result'] ?? '';
$final_data['completeness'] = $ocr_data['response']['completeness'] ?? -1; $final_data['completeness'] = $ocr_data['response']['completeness'] ?? -1;
$final_data['legality'] = $ocr_data['response']['legality'] ?? (object)[]; $final_data['legality'] = $ocr_data['response']['legality'] ?? (object)[];
$final_data['code'] = $ocr_data['response']['code'] ?? -1;
return $final_data; return $final_data;
} }
} }
\ No newline at end of file
...@@ -7,7 +7,7 @@ class SocialCreditCertification ...@@ -7,7 +7,7 @@ class SocialCreditCertification
{ {
private const account = 'BJyimingzhineng'; private const account = 'BJyimingzhineng';
private const app_key = 'deee9c9877e5452f8838cfc5130ac5ad'; private const app_key = 'deee9c9877e5452f8838cfc5130ac5ad';
private const ocr_bussiness_url = 'http://apistore.xmturui.com/apistore/ocr-new'; public const ocr_bussiness_url = 'http://apistore.xmturui.com/apistore/ocr-new';
private const engine_type = 'blic-new'; private const engine_type = 'blic-new';
/** /**
......
...@@ -8,7 +8,7 @@ class ThreeElementsCertification ...@@ -8,7 +8,7 @@ class ThreeElementsCertification
{ {
private const app_key = '392df35aa98721c597cf20b85d21eebc'; private const app_key = '392df35aa98721c597cf20b85d21eebc';
//运营商三要素检测接口 //运营商三要素检测接口
private const test_mobile3_ele_Sim_url = 'https://api.goodsdatas.com:8443/credit/Mobile3EleSim'; public const test_mobile3_ele_Sim_url = 'https://api.goodsdatas.com:8443/credit/Mobile3EleSim';
//加密需要的相关参数 //加密需要的相关参数
private const salt = 'A99BC8325635E303'; private const salt = 'A99BC8325635E303';
......
...@@ -13,6 +13,7 @@ namespace Api\PhpServices\JwUser; ...@@ -13,6 +13,7 @@ namespace Api\PhpServices\JwUser;
use Api\PhpUtils\Common\TimeOut; use Api\PhpUtils\Common\TimeOut;
use Api\PhpUtils\Http\Request; use Api\PhpUtils\Http\Request;
use App\Exception\custom\CodeSpecialException; use App\Exception\custom\CodeSpecialException;
use Api\PhpUtils\Log\FileLog;
class JwUser class JwUser
{ {
...@@ -24,6 +25,7 @@ class JwUser ...@@ -24,6 +25,7 @@ class JwUser
*/ */
public function getUserInfo($params) public function getUserInfo($params)
{ {
$url = config('interface', 'service.jw_user.get_user_info'); $url = config('interface', 'service.jw_user.get_user_info');
if (!$url) { if (!$url) {
throw new CodeSpecialException("failed"); throw new CodeSpecialException("failed");
...@@ -34,11 +36,13 @@ class JwUser ...@@ -34,11 +36,13 @@ class JwUser
} }
$params = ["mobilePhone" => $params['mobile']]; $params = ["mobilePhone" => $params['mobile']];
$user_info = (new TimeOut())->runGet($url, $params); //$user_info = (new TimeOut())->runGet($url, $params);
$user_info = (new Request())->get($url, $params);
FileLog::info('jw_user_getUserInfo', json_encode($user_info));
if (!$user_info) { if (!$user_info) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
} }
return $user_info; return !empty($user_info['response']) ? $user_info['response'] : [];
} }
/** /**
* 获取单条信息 * 获取单条信息
...@@ -56,11 +60,13 @@ class JwUser ...@@ -56,11 +60,13 @@ class JwUser
} }
$params = ["userId" => $params['user_id']]; $params = ["userId" => $params['user_id']];
$user_info = (new TimeOut())->runPost($url, $params); //$user_info = (new TimeOut())->runPost($url, $params);
$user_info = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
FileLog::info('jw_user_getUserByUserId', json_encode($user_info));
if (!$user_info) { if (!$user_info) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
} }
return $user_info; return !empty($user_info['response']) ? $user_info['response'] : [];
} }
public function getUserList($params) public function getUserList($params)
...@@ -75,11 +81,13 @@ class JwUser ...@@ -75,11 +81,13 @@ class JwUser
} }
$params = ["userIds" => $params['user_id']]; $params = ["userIds" => $params['user_id']];
$user_info = (new TimeOut())->runPost($url, $params); //$user_info = (new TimeOut())->runPost($url, $params);
$user_info = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
FileLog::info('jw_user_getUserList', json_encode($user_info));
if (!$user_info) { if (!$user_info) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
} }
return $user_info; return !empty($user_info['response']) ? $user_info['response'] : [];
} }
...@@ -95,11 +103,13 @@ class JwUser ...@@ -95,11 +103,13 @@ class JwUser
throw new CodeSpecialException("failed"); throw new CodeSpecialException("failed");
} }
$params = []; $params = [];
$city_list = (new TimeOut())->runGet($url, $params); //$city_list = (new TimeOut())->runGet($url, $params);
$city_list = (new Request())->get($url, $params);
FileLog::info('jw_user_getAllCityTree', json_encode($city_list));
if (!$city_list) { if (!$city_list) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
} }
return $city_list; return !empty($city_list['response']) ? $city_list['response'] : [];
} }
...@@ -118,11 +128,13 @@ class JwUser ...@@ -118,11 +128,13 @@ class JwUser
if (empty($params)) { if (empty($params)) {
throw new CodeSpecialException("failed"); throw new CodeSpecialException("failed");
} }
$pushToken = (new TimeOut())->runPost($url, $params); //$pushToken = (new TimeOut())->runPost($url, $params);
$pushToken = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
FileLog::info('jw_user_savePushToken', json_encode($pushToken));
if (!$pushToken) { if (!$pushToken) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
} }
return $pushToken; return !empty($pushToken['response']) ? $pushToken['response'] : [];
} }
/** /**
...@@ -141,11 +153,13 @@ class JwUser ...@@ -141,11 +153,13 @@ class JwUser
} }
$params = ["userIds" => $params['user_id']]; $params = ["userIds" => $params['user_id']];
$list = (new TimeOut())->runPost($url, $params); //$list = (new TimeOut())->runPost($url, $params);
$list = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
FileLog::info('jw_user_getUserListWithDynamic', json_encode($list));
if (!$list) { if (!$list) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
} }
return $list; return !empty($list['response']) ? $list['response'] : [];
} }
/** /**
...@@ -164,28 +178,30 @@ class JwUser ...@@ -164,28 +178,30 @@ class JwUser
} }
$params = ["userId" => $params['user_id']]; $params = ["userId" => $params['user_id']];
$list = (new TimeOut())->runPost($url, $params); //$list = (new TimeOut())->runPost($url, $params);
$list = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
FileLog::info('jw_user_getUserDigg', json_encode($list));
if (!$list) { if (!$list) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
} }
return $list; return !empty($list['response']) ? $list['response'] : [];
} }
/** /**
* 给简网同步生活号 * 给简网同步生活号
*/ */
public static function saveUpdateLife($params) public static function saveUpdateLife($params)
{ {
$url = config('interface', 'service.jw_user.save_update_life'); $url = config('interface', 'service.jw_user.save_update_life');
if (!$url) { if (!$url) {
throw new CodeSpecialException("failed"); throw new CodeSpecialException("failed");
} }
//$ret = (new TimeOut())->runPost($url, $params);
$ret = (new TimeOut())->runPost($url, $params); $ret = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
FileLog::info('jw_user_saveUpdateLife', json_encode($ret));
if (!$ret) { if (!$ret) {
throw new CodeSpecialException("timeout"); throw new CodeSpecialException("timeout");
} }
return $ret; return !empty($ret['response']) ? $ret['response'] : [];
} }
} }
\ No newline at end of file
<?php
namespace Api\PhpServices\Ksy;
use Api\PhpUtils\Http\HttpUtil;
/**
* 文档: http://ydwiki.yidian-inc.com/pages/viewpage.action?pageId=68515904
* Class Ks3Api
* @package Api\PhpServices\Ksy
*/
class Ks3Api
{
const KSYUN_SK = "3wm9z0P0ja6NceaZYf477EDZrJs7dSSZ";
const KSYUN_AK = "47DA6034D64E7023";
const KS_DATE_SCHEME = 'D, d M Y H:i:s \G\M\T';
const BASE_URL = "http://image-upload.int.yidian-inc.com";
const BASE_GEN_URL = "http://image-urlgen.int.yidian-inc.com";
const PATH_GEN = "/v1/key/gen";
const PATH_SIGNATURE = "/v1/ks3/signature";
const PATH_PIC_ENCRYPT_URL = "/v1/url/gen";
const PATH_PIC_UPLOAD = "/upload";
const AUDIT_ID = "shqbp";
const TYPE_QUALIFICATION = "shq_qualification";//商户资质
const TYPE_GOODS = "shq_goods";//商品图片
public static $typeList = [
self::TYPE_QUALIFICATION,
self::TYPE_GOODS
];
/**
* 获取bucket与objectKey
* @param $type
* @return mixed
*/
public static function gen($type)
{
$url = self::BASE_URL . self::PATH_GEN;
$timestamp = self::msectime();
$md5Str = $type . "&" . $timestamp . "&" . self::KSYUN_SK;
$signature = self::KSYUN_AK . ":" . md5($md5Str);
$params = [
"timestamp" => $timestamp,
"signature" => $signature,
"type" => $type,
];
return HttpUtil::post($url, $params);
}
/**
* 获取KS签名
* @param $resource
* @param $httpMethod
* @param $contentType
* @param $contentMd5
* @param $headers
* @return array
*/
public static function signature($resource, $httpMethod, $contentType, $contentMd5, $headers, $date)
{
$url = self::BASE_URL . self::PATH_SIGNATURE;
$timestamp = self::msectime();
$md5Str = $httpMethod . "&" . $contentType . "&" . $contentMd5 . "&" . $date . "&" . $resource . "&" . $headers . "&" . $timestamp . "&" . self::KSYUN_SK;
$signature = self::KSYUN_AK . ":" . md5($md5Str);
$params = [
"timestamp" => $timestamp,
"signature" => $signature,
"http_method" => $httpMethod,
"content_type" => $contentType,
"date" => $date,
"content_md5" => $contentMd5,
"resource" => $resource,
"headers" => $headers,
];
return HttpUtil::post($url, $params);
}
/**
* 生成图片访问加密链接
* @param $imageId
* @param $authId
* @param $widthSize
* @param $highSize
* @param int $expirationTime
* @return mixed
*/
public static function picEncryptUrl($imageId, $widthSize = 0, $highSize = 0, $expirationTime = 60 * 60 * 24 * 365)
{
$url = self::BASE_GEN_URL . self::PATH_PIC_ENCRYPT_URL;
$timestamp = self::msectime();
$extend = [];
$extend["expiration_time"] = $expirationTime;
if (!empty($widthSize) && !empty($highSize)) {
$extend["query"] = "type=thumbnail_" . $widthSize . "x" . $highSize;
}
$extendJsonStr = json_encode($extend);
$md5Str = $extendJsonStr . "&" . $imageId . "&" . self::AUDIT_ID . "&" . $timestamp . "&" . self::KSYUN_SK;
$signature = self::KSYUN_AK . ":" . md5($md5Str);
$contentType = 'multipart/form-data';
$params = [
"image_id" => $imageId,
"auth_id" => self::AUDIT_ID,
"timestamp" => $timestamp,
"signature" => $signature,
"content_type" => $contentType,
"extend" => $extendJsonStr,
];
return HttpUtil::post($url, $params);
}
/**
* 上传图片
* @param int $type
* @return mixed
*/
public static function upload($type)
{
$url = self::BASE_URL . self::PATH_PIC_UPLOAD;
$timestamp = self::msectime();
$handle = fopen($_FILES['file']['tmp_name'], 'r');
$content = fread($handle, filesize($_FILES['file']['tmp_name']));
$extend = ["type" => $type];
$extendJsonStr = json_encode($extend);
$md5Str = $extendJsonStr . "&" . md5($content) . "&" . $timestamp . "&" . self::KSYUN_SK;
$signature = self::KSYUN_AK . ":" . md5($md5Str);
$params = [
"pic" => new \CURLFile($_FILES['file']['tmp_name'], $_FILES['file']['type']),
"timestamp" => $timestamp,
"signature" => $signature,
"extend" => $extendJsonStr,
];
return HttpUtil::post($url, $params);
}
/**
* 时间戳(毫秒)
* @return float
*/
private static function msectime()
{
list($msec, $sec) = explode(' ', microtime());
return (float)sprintf('%.0f', (floatval($msec) + floatval($sec)) * 1000);
}
}
\ No newline at end of file
...@@ -2,6 +2,8 @@ ...@@ -2,6 +2,8 @@
namespace Api\PhpServices\Ksy; namespace Api\PhpServices\Ksy;
use Api\PhpUtils\Http\Request; use Api\PhpUtils\Http\Request;
use Api\PhpUtils\Mon\MonUtil;
use GuzzleHttp\TransferStats;
class Ksyun class Ksyun
{ {
...@@ -41,6 +43,12 @@ class Ksyun ...@@ -41,6 +43,12 @@ class Ksyun
]; ];
$res = (new Request())->post(self::get_down_from_ksyun, $post_data,50, 'json',[],1,true); $res = (new Request())->post(self::get_down_from_ksyun, $post_data,50, 'json',[],1,true);
if(isset($res['response']['code'])){
$code = $res['response']['code'];
}else{
$code = -1;
}
(new MonUtil())::proxyMon(self::get_down_from_ksyun, $code, 'merchant',round((new TransferStats())->getHandlerStat('total_time'),4) * 1000);
if (isset($res['code'],$res['response']['status']) && $res['response']['status'] === 'success') { if (isset($res['code'],$res['response']['status']) && $res['response']['status'] === 'success') {
return $res['response']['data']; return $res['response']['data'];
} }
......
<?php
namespace Api\PhpUtils\Http;
/*
* Copyright 2011-2012 Hipu Holding Inc, Beijing. All Rights Reserved.
* DO NOT ALERT OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is distributed as free software within the company.
* You can redistribute it and/or modify it without any restriction.
*
* If you need additional information or have any questions,
* please contact: xukf@hipu.com.
*/
/**
* Description of HttpUtil
*
* @author mengweifu
* @date 2021-7-12 20:00:00
*/
use Api\PhpUtils\Log\FileLog;
use Api\PhpUtils\Mon\MonUtil;
class HttpUtil
{
// 成功
private const CODE_SUCCESS = 0;
// 失败
private const CODE_FAIL = 999999;
/**
* 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');
}
/**
*
* @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);
}
/**
* 发起 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');
}
/**
* 发起 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);
}
/**
* 发起 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');
}
/**
* 发起 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);
$response = self::defaultResponse();
if (is_resource($ch) === true)
{
//返回结果
$result = false;
while (($result === false) && ($retries-- > 0))
{
$result = curl_exec($ch);
}
// { todo
if (curl_errno($ch) !== 0)
{
$GLOBALS['ERROR_MESSAGE'] = curl_error($ch);
}
$GLOBALS['HTTP_CODE'] = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if( isset($GLOBALS['ENABLE_HEADER_REQUEST_TIME']) )
{
$GLOBALS['BELENDER_CURL_INFO'] = curl_getinfo($ch);
//在返回header中添加blender响应时间
$GLOBALS['DEPENDENT-REQUEST-TIME'] = round(curl_getinfo($ch, CURLINFO_TOTAL_TIME),4).'|'.round(curl_getinfo($ch, CURLINFO_NAMELOOKUP_TIME),4).'|'.round(curl_getinfo($ch, CURLINFO_CONNECT_TIME),4);
$GLOBALS['DEPENDENT-REQUEST'] = array('url'=>$url, 'method'=>$method, 'body'=>$post);
$GLOBALS['DEPENDENT-URI'] = parse_url($url, PHP_URL_PATH);
if ($GLOBALS['HTTP_CODE'] === 0)
{
$GLOBALS['DEPENDENT-STATUS'] = 'timeout';
}
else if ($GLOBALS['HTTP_CODE'] !== 200)
{
$GLOBALS['DEPENDENT-STATUS'] = '5xx';
}else
{
$GLOBALS['DEPENDENT-STATUS'] = 'normal';
}
}
unset($GLOBALS['ENABLE_HEADER_REQUEST_TIME']);
// }
// 监控
self::addMon(
$url,
$GLOBALS['HTTP_CODE'] ?? -999,
round(curl_getinfo($ch, CURLINFO_TOTAL_TIME),4) * 1000
);
// 日志
self::addLog($method, $url, $post, $result);
// 返回结果
$response = self::createResponse($result, $ch);
curl_close($ch);
}
return $response;
}
/**
* 生产 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
*/
private static function ch(string $url,int $timeout,array $headers = [], $post, string $proxy = '', string $method = 'GET', array $curl_opts = [])
{
$ch = curl_init($url);
if (is_resource($ch) === true)
{
curl_setopt($ch, CURLOPT_FAILONERROR, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TCP_NODELAY, true);
curl_setopt($ch, CURLOPT_NOSIGNAL, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_BUFFERSIZE, 10240);
curl_setopt($ch, CURLOPT_TIMEOUT_MS, $timeout);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT_MS, $timeout);
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_0);
if (! empty($headers))
{
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
if ($proxy)
{
curl_setopt($ch, CURLOPT_PROXY, $proxy);
}
if (!empty($curl_opts))
{
foreach ($curl_opts as $opt => $val)
{
curl_setopt($ch, $opt, $val);
}
}
switch ($method) {
case 'HEAD':
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'HEAD');
break;
case 'GET':
break;
case 'POST':
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
break;
case 'DELETE':
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
break;
case 'PUT':
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_POSTFIELDS, $post);
break;
default:
die('httpUtil bad method');
break;
}
}
return $ch;
}
/**
* 并发 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::concurrencyCurl($urls, $methods, $posts, $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) {
$urls[$k] = $url ."?". http_build_query($params[$k]);
$methods[$k] = 'GET';
$posts[$k] = false;
}
return self::concurrencyCurl($urls, $methods, $posts, $timeouts , $headers, $proxies, $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
*/
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();
//step two 往批处理handle 添加curl_init来的子handle
foreach ($urls as $i => $url)
{
$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]);
}
//step three 并发执行,直到请求全部结束
do {
curl_multi_exec($mh, $active);
} while ($active);
$response = [];
//step four 获取结果,移除并close handle
foreach ($urls as $i => $url)
{
$response_content = curl_multi_getcontent($conn[$i]);
$response[$i] = self::createResponse($response_content, $conn[$i]);
// 监控
self::addMon(
$url,
curl_errno($conn[$i]) === 0 ? curl_getinfo($conn[$i], CURLINFO_HTTP_CODE) : -999,
round(curl_getinfo($conn[$i], CURLINFO_TOTAL_TIME),4) * 1000
);
// 日志
self::addLog($methods[$i], $url, $posts[$i], $response_content);
curl_multi_remove_handle($mh,$conn[$i]);
curl_close($conn[$i]);
}
curl_multi_close($mh);
//step five 结果返回
return $response;
}
/*
* 监控打点,模块名默认为第三方服务url,指标为请求返回的HTTP_code与总响应时间
*/
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)
{
//过滤无意义的日志
$log = true;
$excludes = config('http_util', 'log.exclude');
if (!empty($excludes)) {
foreach ($excludes as $exclude) {
if (is_array($urls)) {
foreach ($urls as $url) {
if (strpos($url, $exclude) !== false) {
$log = false;
break;
}
}
} else {
if (strpos($urls, $exclude) !== false) {
$log = false;
break;
}
}
}
}
if (!empty($log)) {
//
$params = self::change($params);
FileLog::info($method, json_encode([
'url' => $urls,
'params' => $params,
'response' => $response
]));
}
}
/**
* 过滤resource类型字段
* @param mixed $params array or string resource
* @return array
*/
private static function change($params)
{
if (is_array($params)) {
foreach ($params as $k => $v) {
if (is_array($v)) {
$params[$k] = self::change($v);
} else {
if (strpos(gettype($v), 'resource') !== false) {
$params[$k] = gettype($v);
}
}
}
}
else {
if (strpos(gettype($params), 'resource') !== false) {
$params = gettype($params);
}
}
return $params;
}
/**
* 生成返回结果
* @param string $response_content 请求返回结果
* @param resource $ch_handle cURL resource
* @return array
*/
private static function createResponse(string $response_content, $ch_handle): array
{
return [
'code' => curl_errno($ch_handle) === 0 ? self::CODE_SUCCESS : self::CODE_FAIL,
'response' => empty(json_decode($response_content, true)) ? $response_content : json_decode($response_content, true),
'http_code' => curl_getinfo($ch_handle, CURLINFO_HTTP_CODE),
'msg' => curl_error($ch_handle),
];
}
/**
* 默认返回
* @return array
*/
private static function defaultResponse(): array
{
return [
'code' => self::CODE_FAIL,
'response' => '',
'http_code' => 0,
'msg' => '',
];
}
}
...@@ -338,7 +338,7 @@ class ClassLoader ...@@ -338,7 +338,7 @@ class ClassLoader
* Loads the given class or interface. * Loads the given class or interface.
* *
* @param string $class The name of the class * @param string $class The name of the class
* @return bool|null True if loaded, null otherwise * @return true|null True if loaded, null otherwise
*/ */
public function loadClass($class) public function loadClass($class)
{ {
...@@ -347,6 +347,8 @@ class ClassLoader ...@@ -347,6 +347,8 @@ class ClassLoader
return true; return true;
} }
return null;
} }
/** /**
......
<?php <?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Composer; namespace Composer;
use Composer\Autoload\ClassLoader; use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser; use Composer\Semver\VersionParser;
/**
* This class is copied in every Composer installed project and available to all
*
* See also https://getcomposer.org/doc/07-runtime.md#installed-versions
*
* To require it's presence, you can require `composer-runtime-api ^2.0`
*/
class InstalledVersions class InstalledVersions
{ {
private static $installed = array ( private static $installed;
'root' => private static $canGetVendors;
array ( private static $installedByVendor = array();
'pretty_version' => 'dev-develop',
'version' => 'dev-develop', /**
'aliases' => * Returns a list of all package names which are present, either by being installed, replaced or provided
array ( *
), * @return string[]
'reference' => '9ae25f92abf61649d1910edca7d4207e33749f5e', * @psalm-return list<string>
'name' => 'bp/pay', */
), public static function getInstalledPackages()
'versions' => {
array ( $packages = array();
'api/php_services' => foreach (self::getInstalled() as $installed) {
array ( $packages[] = array_keys($installed['versions']);
'pretty_version' => 'dev-master', }
'version' => 'dev-master',
'aliases' => if (1 === \count($packages)) {
array ( return $packages[0];
0 => '9999999-dev', }
),
'reference' => '58888c4a083e384080d78606f362809a89b8c672', return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
), }
'api/php_utils' =>
array ( /**
'pretty_version' => 'dev-master', * Returns a list of all package names with a specific type e.g. 'library'
'version' => 'dev-master', *
'aliases' => * @param string $type
array ( * @return string[]
0 => '9999999-dev', * @psalm-return list<string>
), */
'reference' => '6495e3a31134e644072208c19610924912f4683a', public static function getInstalledPackagesByType($type)
), {
'bacon/bacon-qr-code' => $packagesByType = array();
array (
'pretty_version' => '2.0.4', foreach (self::getInstalled() as $installed) {
'version' => '2.0.4.0', foreach ($installed['versions'] as $name => $package) {
'aliases' => if (isset($package['type']) && $package['type'] === $type) {
array ( $packagesByType[] = $name;
), }
'reference' => 'f73543ac4e1def05f1a70bcd1525c8a157a1ad09', }
), }
'bp/pay' =>
array ( return $packagesByType;
'pretty_version' => 'dev-develop', }
'version' => 'dev-develop',
'aliases' => /**
array ( * Checks whether the given package is installed
), *
'reference' => '9ae25f92abf61649d1910edca7d4207e33749f5e', * This also returns true if the package name is provided or replaced by another package
), *
'dasprid/enum' => * @param string $packageName
array ( * @param bool $includeDevRequirements
'pretty_version' => '1.0.3', * @return bool
'version' => '1.0.3.0', */
'aliases' => public static function isInstalled($packageName, $includeDevRequirements = true)
array ( {
), foreach (self::getInstalled() as $installed) {
'reference' => '5abf82f213618696dda8e3bf6f64dd042d8542b2', if (isset($installed['versions'][$packageName])) {
), return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']);
'elasticsearch/elasticsearch' => }
array ( }
'pretty_version' => '7.11.x-dev',
'version' => '7.11.9999999.9999999-dev', return false;
'aliases' => }
array (
), /**
'reference' => '8d08050fef9d89004702b1428b8c1f7f4f6162cf', * Checks whether the given package satisfies a version constraint
), *
'endroid/qr-code' => * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call:
array ( *
'pretty_version' => '3.9.6', * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3')
'version' => '3.9.6.0', *
'aliases' => * @param VersionParser $parser Install composer/semver to have access to this class and functionality
array ( * @param string $packageName
), * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package
'reference' => '9cdd4f5d609bfc8811ca4a62b4d23eb16976242f', * @return bool
), */
'ezimuel/guzzlestreams' => public static function satisfies(VersionParser $parser, $packageName, $constraint)
array ( {
'pretty_version' => 'dev-master', $constraint = $parser->parseConstraints($constraint);
'version' => 'dev-master', $provided = $parser->parseConstraints(self::getVersionRanges($packageName));
'aliases' =>
array ( return $provided->matches($constraint);
0 => '3.0.x-dev', }
),
'reference' => 'abe3791d231167f14eb80d413420d1eab91163a8', /**
), * Returns a version constraint representing all the range(s) which are installed for a given package
'ezimuel/ringphp' => *
array ( * It is easier to use this via isInstalled() with the $constraint argument if you need to check
'pretty_version' => 'dev-master', * whether a given version of a package is installed, and not just whether it exists
'version' => 'dev-master', *
'aliases' => * @param string $packageName
array ( * @return string Version constraint usable with composer/semver
0 => '1.1.x-dev', */
), public static function getVersionRanges($packageName)
'reference' => '0b78f89d8e0bb9e380046c31adfa40347e9f663b', {
), foreach (self::getInstalled() as $installed) {
'guzzlehttp/guzzle' => if (!isset($installed['versions'][$packageName])) {
array ( continue;
'pretty_version' => '6.3.0', }
'version' => '6.3.0.0',
'aliases' => $ranges = array();
array ( if (isset($installed['versions'][$packageName]['pretty_version'])) {
), $ranges[] = $installed['versions'][$packageName]['pretty_version'];
'reference' => 'f4db5a78a5ea468d4831de7f0bf9d9415e348699', }
), if (array_key_exists('aliases', $installed['versions'][$packageName])) {
'guzzlehttp/promises' => $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
array ( }
'pretty_version' => 'dev-master', if (array_key_exists('replaced', $installed['versions'][$packageName])) {
'version' => 'dev-master', $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
'aliases' => }
array ( if (array_key_exists('provided', $installed['versions'][$packageName])) {
0 => '1.4.x-dev', $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
), }
'reference' => '8e7d04f1f6450fef59366c399cfad4b9383aa30d',
), return implode(' || ', $ranges);
'guzzlehttp/psr7' => }
array (
'pretty_version' => '1.x-dev', throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
'version' => '1.9999999.9999999.9999999-dev', }
'aliases' =>
array ( /**
), * @param string $packageName
'reference' => 'dc960a912984efb74d0a90222870c72c87f10c91', * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
), */
'khanamiryan/qrcode-detector-decoder' => public static function getVersion($packageName)
array ( {
'pretty_version' => '1.0.5.1', foreach (self::getInstalled() as $installed) {
'version' => '1.0.5.1', if (!isset($installed['versions'][$packageName])) {
'aliases' => continue;
array ( }
),
'reference' => 'b96163d4f074970dfe67d4185e75e1f4541b30ca', if (!isset($installed['versions'][$packageName]['version'])) {
), return null;
'mongodb/mongodb' => }
array (
'pretty_version' => '1.4.3', return $installed['versions'][$packageName]['version'];
'version' => '1.4.3.0', }
'aliases' =>
array ( throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
), }
'reference' => '18fca8cc8d0c2cc07f76605760d20632bb3dab96',
), /**
'myclabs/php-enum' => * @param string $packageName
array ( * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present
'pretty_version' => '1.7.7', */
'version' => '1.7.7.0', public static function getPrettyVersion($packageName)
'aliases' => {
array ( foreach (self::getInstalled() as $installed) {
), if (!isset($installed['versions'][$packageName])) {
'reference' => 'd178027d1e679832db9f38248fcc7200647dc2b7', continue;
), }
'perftools/php-profiler' =>
array ( if (!isset($installed['versions'][$packageName]['pretty_version'])) {
'pretty_version' => '0.18.0', return null;
'version' => '0.18.0.0', }
'aliases' =>
array ( return $installed['versions'][$packageName]['pretty_version'];
), }
'reference' => '794c435f615ab9ca4347e386b4d8c6524fe9e3ae',
), throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
'pingplusplus/pingpp-php' => }
array (
'pretty_version' => '2.5.0', /**
'version' => '2.5.0.0', * @param string $packageName
'aliases' => * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference
array ( */
), public static function getReference($packageName)
'reference' => '0fadd17f28cf2366b4da2f7539c4b97bfa3f6f21', {
), foreach (self::getInstalled() as $installed) {
'psr/http-message' => if (!isset($installed['versions'][$packageName])) {
array ( continue;
'pretty_version' => 'dev-master', }
'version' => 'dev-master',
'aliases' => if (!isset($installed['versions'][$packageName]['reference'])) {
array ( return null;
0 => '1.0.x-dev', }
),
'reference' => 'efd67d1dc14a7ef4fc4e518e7dee91c271d524e4', return $installed['versions'][$packageName]['reference'];
), }
'psr/http-message-implementation' =>
array ( throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
'provided' => }
array (
0 => '1.0', /**
), * @param string $packageName
), * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path.
'psr/log' => */
array ( public static function getInstallPath($packageName)
'pretty_version' => 'dev-master', {
'version' => 'dev-master', foreach (self::getInstalled() as $installed) {
'aliases' => if (!isset($installed['versions'][$packageName])) {
array ( continue;
0 => '1.1.x-dev', }
),
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null;
), }
'ralouphie/getallheaders' =>
array ( throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
'pretty_version' => '3.0.3', }
'version' => '3.0.3.0',
'aliases' => /**
array ( * @return array
), * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}
'reference' => '120b605dfeb996808c31b6477290a714d356e822', */
), public static function getRootPackage()
'react/promise' => {
array ( $installed = self::getInstalled();
'pretty_version' => '2.x-dev',
'version' => '2.9999999.9999999.9999999-dev', return $installed[0]['root'];
'aliases' => }
array (
), /**
'reference' => 'a9752a861e21c0fe0b380c9f9e55beddc0ed7d31', * Returns the raw installed.php data for custom implementations
), *
'symfony/deprecation-contracts' => * @deprecated Use getAllRawData() instead which returns all datasets for all autoloaders present in the process. getRawData only returns the first dataset loaded, which may not be what you expect.
array ( * @return array[]
'pretty_version' => 'dev-main', * @psalm-return array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}
'version' => 'dev-main', */
'aliases' => public static function getRawData()
array ( {
0 => '2.5.x-dev', @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
),
'reference' => '36b691b0bdbc963fb610da193a48b4c009d03a62', if (null === self::$installed) {
), // only require the installed.php file if this file is loaded from its dumped location,
'symfony/options-resolver' => // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
array ( if (substr(__DIR__, -8, 1) !== 'C') {
'pretty_version' => '5.4.x-dev', self::$installed = include __DIR__ . '/installed.php';
'version' => '5.4.9999999.9999999-dev', } else {
'aliases' => self::$installed = array();
array ( }
), }
'reference' => '05b35d6cc6227dc22fc053d0cfcd9f41000e2c80',
), return self::$installed;
'symfony/polyfill-ctype' => }
array (
'pretty_version' => 'dev-main', /**
'version' => 'dev-main', * Returns the raw data of all installed.php which are currently loaded for custom implementations
'aliases' => *
array ( * @return array[]
0 => '1.23.x-dev', * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
), */
'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', public static function getAllRawData()
), {
'symfony/polyfill-intl-grapheme' => return self::getInstalled();
array ( }
'pretty_version' => 'dev-main',
'version' => 'dev-main', /**
'aliases' => * Lets you reload the static array from another file
array ( *
0 => '1.23.x-dev', * This is only useful for complex integrations in which a project needs to use
), * this class but then also needs to execute another project's autoloader in process,
'reference' => '16880ba9c5ebe3642d1995ab866db29270b36535', * and wants to ensure both projects have access to their version of installed.php.
), *
'symfony/polyfill-intl-normalizer' => * A typical case would be PHPUnit, where it would need to make sure it reads all
array ( * the data it needs from this class, then call reload() with
'pretty_version' => 'dev-main', * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure
'version' => 'dev-main', * the project in which it runs can then also use this class safely, without
'aliases' => * interference between PHPUnit's dependencies and the project's dependencies.
array ( *
0 => '1.23.x-dev', * @param array[] $data A vendor/composer/installed.php data set
), * @return void
'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', *
), * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>} $data
'symfony/polyfill-mbstring' => */
array ( public static function reload($data)
'pretty_version' => 'dev-main', {
'version' => 'dev-main', self::$installed = $data;
'aliases' => self::$installedByVendor = array();
array ( }
0 => '1.23.x-dev',
), /**
'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', * @return array[]
), * @psalm-return list<array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array<string, array{dev_requirement: bool, pretty_version?: string, version?: string, aliases?: string[], reference?: string, replaced?: string[], provided?: string[], install_path?: string}>}>
'symfony/polyfill-php73' => */
array ( private static function getInstalled()
'pretty_version' => 'dev-main', {
'version' => 'dev-main', if (null === self::$canGetVendors) {
'aliases' => self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
array ( }
0 => '1.23.x-dev',
), $installed = array();
'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010',
), if (self::$canGetVendors) {
'symfony/polyfill-php80' => foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
array ( if (isset(self::$installedByVendor[$vendorDir])) {
'pretty_version' => 'dev-main', $installed[] = self::$installedByVendor[$vendorDir];
'version' => 'dev-main', } elseif (is_file($vendorDir.'/composer/installed.php')) {
'aliases' => $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
array ( if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) {
0 => '1.23.x-dev', self::$installed = $installed[count($installed) - 1];
), }
'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0', }
), }
'symfony/property-access' => }
array (
'pretty_version' => '5.4.x-dev', if (null === self::$installed) {
'version' => '5.4.9999999.9999999-dev', // only require the installed.php file if this file is loaded from its dumped location,
'aliases' => // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937
array ( if (substr(__DIR__, -8, 1) !== 'C') {
), self::$installed = require __DIR__ . '/installed.php';
'reference' => '13c33f29a76bd99976ba7ee20297fa16d5a53a59', } else {
), self::$installed = array();
'symfony/property-info' => }
array ( }
'pretty_version' => '5.4.x-dev', $installed[] = self::$installed;
'version' => '5.4.9999999.9999999-dev',
'aliases' => return $installed;
array ( }
),
'reference' => '718f093ae4cac054db2bbb39ebf86fd898583ac8',
),
'symfony/string' =>
array (
'pretty_version' => '5.4.x-dev',
'version' => '5.4.9999999.9999999-dev',
'aliases' =>
array (
),
'reference' => 'c29a3e649843f4a34eaa4be2683f4914e8b7f023',
),
),
);
private static $canGetVendors;
private static $installedByVendor = array();
public static function getInstalledPackages()
{
$packages = array();
foreach (self::getInstalled() as $installed) {
$packages[] = array_keys($installed['versions']);
}
if (1 === \count($packages)) {
return $packages[0];
}
return array_keys(array_flip(\call_user_func_array('array_merge', $packages)));
}
public static function isInstalled($packageName)
{
foreach (self::getInstalled() as $installed) {
if (isset($installed['versions'][$packageName])) {
return true;
}
}
return false;
}
public static function satisfies(VersionParser $parser, $packageName, $constraint)
{
$constraint = $parser->parseConstraints($constraint);
$provided = $parser->parseConstraints(self::getVersionRanges($packageName));
return $provided->matches($constraint);
}
public static function getVersionRanges($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
$ranges = array();
if (isset($installed['versions'][$packageName]['pretty_version'])) {
$ranges[] = $installed['versions'][$packageName]['pretty_version'];
}
if (array_key_exists('aliases', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']);
}
if (array_key_exists('replaced', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']);
}
if (array_key_exists('provided', $installed['versions'][$packageName])) {
$ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']);
}
return implode(' || ', $ranges);
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
public static function getVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['version'])) {
return null;
}
return $installed['versions'][$packageName]['version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
public static function getPrettyVersion($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['pretty_version'])) {
return null;
}
return $installed['versions'][$packageName]['pretty_version'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
public static function getReference($packageName)
{
foreach (self::getInstalled() as $installed) {
if (!isset($installed['versions'][$packageName])) {
continue;
}
if (!isset($installed['versions'][$packageName]['reference'])) {
return null;
}
return $installed['versions'][$packageName]['reference'];
}
throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed');
}
public static function getRootPackage()
{
$installed = self::getInstalled();
return $installed[0]['root'];
}
public static function getRawData()
{
@trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED);
return self::$installed;
}
public static function getAllRawData()
{
return self::getInstalled();
}
public static function reload($data)
{
self::$installed = $data;
self::$installedByVendor = array();
}
private static function getInstalled()
{
if (null === self::$canGetVendors) {
self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders');
}
$installed = array();
if (self::$canGetVendors) {
foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) {
if (isset(self::$installedByVendor[$vendorDir])) {
$installed[] = self::$installedByVendor[$vendorDir];
} elseif (is_file($vendorDir.'/composer/installed.php')) {
$installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php';
}
}
}
$installed[] = self::$installed;
return $installed;
}
} }
...@@ -18,6 +18,7 @@ return array( ...@@ -18,6 +18,7 @@ return array(
'Api\\PhpServices\\Idgen\\Idgen' => $vendorDir . '/api/php_services/src/Idgen/Idgen.php', 'Api\\PhpServices\\Idgen\\Idgen' => $vendorDir . '/api/php_services/src/Idgen/Idgen.php',
'Api\\PhpServices\\Interaction\\InterDynamic' => $vendorDir . '/api/php_services/src/Interaction/InterDynamic.php', 'Api\\PhpServices\\Interaction\\InterDynamic' => $vendorDir . '/api/php_services/src/Interaction/InterDynamic.php',
'Api\\PhpServices\\JwUser\\JwUser' => $vendorDir . '/api/php_services/src/JwUser/JwUser.php', 'Api\\PhpServices\\JwUser\\JwUser' => $vendorDir . '/api/php_services/src/JwUser/JwUser.php',
'Api\\PhpServices\\Ksy\\Ks3Api' => $vendorDir . '/api/php_services/src/Ksy/Ks3Api.php',
'Api\\PhpServices\\Ksy\\Ksyun' => $vendorDir . '/api/php_services/src/Ksy/Ksyun.php', 'Api\\PhpServices\\Ksy\\Ksyun' => $vendorDir . '/api/php_services/src/Ksy/Ksyun.php',
'Api\\PhpServices\\LifeAccount\\Account' => $vendorDir . '/api/php_services/src/LifeAccount/Account.php', 'Api\\PhpServices\\LifeAccount\\Account' => $vendorDir . '/api/php_services/src/LifeAccount/Account.php',
'Api\\PhpServices\\Login\\Login' => $vendorDir . '/api/php_services/src/Login/Login.php', 'Api\\PhpServices\\Login\\Login' => $vendorDir . '/api/php_services/src/Login/Login.php',
...@@ -50,6 +51,7 @@ return array( ...@@ -50,6 +51,7 @@ return array(
'Api\\PhpUtils\\Elastic\\Manager\\DocumentManager' => $vendorDir . '/api/php_utils/src/Elastic/Manager/DocumentManager.php', 'Api\\PhpUtils\\Elastic\\Manager\\DocumentManager' => $vendorDir . '/api/php_utils/src/Elastic/Manager/DocumentManager.php',
'Api\\PhpUtils\\Elastic\\Manager\\IndexManager' => $vendorDir . '/api/php_utils/src/Elastic/Manager/IndexManager.php', 'Api\\PhpUtils\\Elastic\\Manager\\IndexManager' => $vendorDir . '/api/php_utils/src/Elastic/Manager/IndexManager.php',
'Api\\PhpUtils\\Http\\Base' => $vendorDir . '/api/php_utils/src/Http/Base.php', 'Api\\PhpUtils\\Http\\Base' => $vendorDir . '/api/php_utils/src/Http/Base.php',
'Api\\PhpUtils\\Http\\HttpUtil' => $vendorDir . '/api/php_utils/src/Http/HttpUtil.php',
'Api\\PhpUtils\\Http\\Request' => $vendorDir . '/api/php_utils/src/Http/Request.php', 'Api\\PhpUtils\\Http\\Request' => $vendorDir . '/api/php_utils/src/Http/Request.php',
'Api\\PhpUtils\\Hystrix\\ApcuStateStorage' => $vendorDir . '/api/php_utils/src/Hystrix/ApcuStateStorage.php', 'Api\\PhpUtils\\Hystrix\\ApcuStateStorage' => $vendorDir . '/api/php_utils/src/Hystrix/ApcuStateStorage.php',
'Api\\PhpUtils\\Hystrix\\DemoCommand' => $vendorDir . '/api/php_utils/src/Hystrix/DemoCommand.php', 'Api\\PhpUtils\\Hystrix\\DemoCommand' => $vendorDir . '/api/php_utils/src/Hystrix/DemoCommand.php',
......
...@@ -252,6 +252,7 @@ class ComposerStaticInit449f7c51756999ca9c3a3daf8077484c ...@@ -252,6 +252,7 @@ class ComposerStaticInit449f7c51756999ca9c3a3daf8077484c
'Api\\PhpServices\\Idgen\\Idgen' => __DIR__ . '/..' . '/api/php_services/src/Idgen/Idgen.php', 'Api\\PhpServices\\Idgen\\Idgen' => __DIR__ . '/..' . '/api/php_services/src/Idgen/Idgen.php',
'Api\\PhpServices\\Interaction\\InterDynamic' => __DIR__ . '/..' . '/api/php_services/src/Interaction/InterDynamic.php', 'Api\\PhpServices\\Interaction\\InterDynamic' => __DIR__ . '/..' . '/api/php_services/src/Interaction/InterDynamic.php',
'Api\\PhpServices\\JwUser\\JwUser' => __DIR__ . '/..' . '/api/php_services/src/JwUser/JwUser.php', 'Api\\PhpServices\\JwUser\\JwUser' => __DIR__ . '/..' . '/api/php_services/src/JwUser/JwUser.php',
'Api\\PhpServices\\Ksy\\Ks3Api' => __DIR__ . '/..' . '/api/php_services/src/Ksy/Ks3Api.php',
'Api\\PhpServices\\Ksy\\Ksyun' => __DIR__ . '/..' . '/api/php_services/src/Ksy/Ksyun.php', 'Api\\PhpServices\\Ksy\\Ksyun' => __DIR__ . '/..' . '/api/php_services/src/Ksy/Ksyun.php',
'Api\\PhpServices\\LifeAccount\\Account' => __DIR__ . '/..' . '/api/php_services/src/LifeAccount/Account.php', 'Api\\PhpServices\\LifeAccount\\Account' => __DIR__ . '/..' . '/api/php_services/src/LifeAccount/Account.php',
'Api\\PhpServices\\Login\\Login' => __DIR__ . '/..' . '/api/php_services/src/Login/Login.php', 'Api\\PhpServices\\Login\\Login' => __DIR__ . '/..' . '/api/php_services/src/Login/Login.php',
...@@ -284,6 +285,7 @@ class ComposerStaticInit449f7c51756999ca9c3a3daf8077484c ...@@ -284,6 +285,7 @@ class ComposerStaticInit449f7c51756999ca9c3a3daf8077484c
'Api\\PhpUtils\\Elastic\\Manager\\DocumentManager' => __DIR__ . '/..' . '/api/php_utils/src/Elastic/Manager/DocumentManager.php', 'Api\\PhpUtils\\Elastic\\Manager\\DocumentManager' => __DIR__ . '/..' . '/api/php_utils/src/Elastic/Manager/DocumentManager.php',
'Api\\PhpUtils\\Elastic\\Manager\\IndexManager' => __DIR__ . '/..' . '/api/php_utils/src/Elastic/Manager/IndexManager.php', 'Api\\PhpUtils\\Elastic\\Manager\\IndexManager' => __DIR__ . '/..' . '/api/php_utils/src/Elastic/Manager/IndexManager.php',
'Api\\PhpUtils\\Http\\Base' => __DIR__ . '/..' . '/api/php_utils/src/Http/Base.php', 'Api\\PhpUtils\\Http\\Base' => __DIR__ . '/..' . '/api/php_utils/src/Http/Base.php',
'Api\\PhpUtils\\Http\\HttpUtil' => __DIR__ . '/..' . '/api/php_utils/src/Http/HttpUtil.php',
'Api\\PhpUtils\\Http\\Request' => __DIR__ . '/..' . '/api/php_utils/src/Http/Request.php', 'Api\\PhpUtils\\Http\\Request' => __DIR__ . '/..' . '/api/php_utils/src/Http/Request.php',
'Api\\PhpUtils\\Hystrix\\ApcuStateStorage' => __DIR__ . '/..' . '/api/php_utils/src/Hystrix/ApcuStateStorage.php', 'Api\\PhpUtils\\Hystrix\\ApcuStateStorage' => __DIR__ . '/..' . '/api/php_utils/src/Hystrix/ApcuStateStorage.php',
'Api\\PhpUtils\\Hystrix\\DemoCommand' => __DIR__ . '/..' . '/api/php_utils/src/Hystrix/DemoCommand.php', 'Api\\PhpUtils\\Hystrix\\DemoCommand' => __DIR__ . '/..' . '/api/php_utils/src/Hystrix/DemoCommand.php',
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://gitlab.yidian-inc.com/bp/php_services.git", "url": "https://gitlab.yidian-inc.com/bp/php_services.git",
"reference": "58888c4a083e384080d78606f362809a89b8c672" "reference": "e68700976b8cca3ecf4de5bfdb8c0df1276a25bd"
}, },
"require": { "require": {
"api/php_utils": "dev-master", "api/php_utils": "dev-master",
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
"perftools/php-profiler": "^0.18.0", "perftools/php-profiler": "^0.18.0",
"php": "7.2.*" "php": "7.2.*"
}, },
"time": "2021-07-09T13:44:16+00:00", "time": "2021-07-14T13:59:01+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"installation-source": "source", "installation-source": "source",
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://gitlab.yidian-inc.com/bp/php_utils.git", "url": "https://gitlab.yidian-inc.com/bp/php_utils.git",
"reference": "6495e3a31134e644072208c19610924912f4683a" "reference": "3c343d9deec02d60db43c034d1c5916b024eed3a"
}, },
"require": { "require": {
"elasticsearch/elasticsearch": "~7.0", "elasticsearch/elasticsearch": "~7.0",
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
"mongodb/mongodb": "1.4.3", "mongodb/mongodb": "1.4.3",
"php": "7.2.*" "php": "7.2.*"
}, },
"time": "2021-07-10T12:30:06+00:00", "time": "2021-07-14T12:48:42+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"installation-source": "source", "installation-source": "source",
...@@ -1282,12 +1282,12 @@ ...@@ -1282,12 +1282,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git", "url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "36b691b0bdbc963fb610da193a48b4c009d03a62" "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/36b691b0bdbc963fb610da193a48b4c009d03a62", "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8",
"reference": "36b691b0bdbc963fb610da193a48b4c009d03a62", "reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
...@@ -1299,7 +1299,7 @@ ...@@ -1299,7 +1299,7 @@
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
}, },
"time": "2021-06-09T13:36:38+00:00", "time": "2021-07-12T14:48:14+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"extra": { "extra": {
...@@ -1890,12 +1890,12 @@ ...@@ -1890,12 +1890,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/symfony/polyfill-php80.git", "url": "https://github.com/symfony/polyfill-php80.git",
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0" "reference": "19d03c391c6abb6791f5f757fb36e551bffeaa68"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/eca0bf41ed421bed1b57c4958bab16aa86b757d0", "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/19d03c391c6abb6791f5f757fb36e551bffeaa68",
"reference": "eca0bf41ed421bed1b57c4958bab16aa86b757d0", "reference": "19d03c391c6abb6791f5f757fb36e551bffeaa68",
"shasum": "", "shasum": "",
"mirrors": [ "mirrors": [
{ {
...@@ -1907,7 +1907,7 @@ ...@@ -1907,7 +1907,7 @@
"require": { "require": {
"php": ">=7.1" "php": ">=7.1"
}, },
"time": "2021-02-19T12:13:01+00:00", "time": "2021-07-13T14:34:27+00:00",
"default-branch": true, "default-branch": true,
"type": "library", "type": "library",
"extra": { "extra": {
...@@ -1958,7 +1958,7 @@ ...@@ -1958,7 +1958,7 @@
"shim" "shim"
], ],
"support": { "support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0" "source": "https://github.com/symfony/polyfill-php80/tree/main"
}, },
"funding": [ "funding": [
{ {
......
<?php return array ( <?php return array(
'root' => 'root' => array(
array (
'pretty_version' => 'dev-develop', 'pretty_version' => 'dev-develop',
'version' => 'dev-develop', 'version' => 'dev-develop',
'aliases' => 'type' => 'project',
array ( 'install_path' => __DIR__ . '/../../',
), 'aliases' => array(),
'reference' => '9ae25f92abf61649d1910edca7d4207e33749f5e', 'reference' => '69c9bde1dd4fb167dc7d1eac77b1bde3fd599f56',
'name' => 'bp/pay', 'name' => 'bp/pay',
'dev' => true,
), ),
'versions' => 'versions' => array(
array ( 'api/php_services' => array(
'api/php_services' =>
array (
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../api/php_services',
'aliases' => array(
0 => '9999999-dev', 0 => '9999999-dev',
), ),
'reference' => '58888c4a083e384080d78606f362809a89b8c672', 'reference' => 'e68700976b8cca3ecf4de5bfdb8c0df1276a25bd',
'dev_requirement' => false,
), ),
'api/php_utils' => 'api/php_utils' => array(
array (
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../api/php_utils',
'aliases' => array(
0 => '9999999-dev', 0 => '9999999-dev',
), ),
'reference' => '6495e3a31134e644072208c19610924912f4683a', 'reference' => '3c343d9deec02d60db43c034d1c5916b024eed3a',
'dev_requirement' => false,
), ),
'bacon/bacon-qr-code' => 'bacon/bacon-qr-code' => array(
array (
'pretty_version' => '2.0.4', 'pretty_version' => '2.0.4',
'version' => '2.0.4.0', 'version' => '2.0.4.0',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../bacon/bacon-qr-code',
), 'aliases' => array(),
'reference' => 'f73543ac4e1def05f1a70bcd1525c8a157a1ad09', 'reference' => 'f73543ac4e1def05f1a70bcd1525c8a157a1ad09',
'dev_requirement' => false,
), ),
'bp/pay' => 'bp/pay' => array(
array (
'pretty_version' => 'dev-develop', 'pretty_version' => 'dev-develop',
'version' => 'dev-develop', 'version' => 'dev-develop',
'aliases' => 'type' => 'project',
array ( 'install_path' => __DIR__ . '/../../',
), 'aliases' => array(),
'reference' => '9ae25f92abf61649d1910edca7d4207e33749f5e', 'reference' => '69c9bde1dd4fb167dc7d1eac77b1bde3fd599f56',
'dev_requirement' => false,
), ),
'dasprid/enum' => 'dasprid/enum' => array(
array (
'pretty_version' => '1.0.3', 'pretty_version' => '1.0.3',
'version' => '1.0.3.0', 'version' => '1.0.3.0',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../dasprid/enum',
), 'aliases' => array(),
'reference' => '5abf82f213618696dda8e3bf6f64dd042d8542b2', 'reference' => '5abf82f213618696dda8e3bf6f64dd042d8542b2',
'dev_requirement' => false,
), ),
'elasticsearch/elasticsearch' => 'elasticsearch/elasticsearch' => array(
array (
'pretty_version' => '7.11.x-dev', 'pretty_version' => '7.11.x-dev',
'version' => '7.11.9999999.9999999-dev', 'version' => '7.11.9999999.9999999-dev',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../elasticsearch/elasticsearch',
), 'aliases' => array(),
'reference' => '8d08050fef9d89004702b1428b8c1f7f4f6162cf', 'reference' => '8d08050fef9d89004702b1428b8c1f7f4f6162cf',
'dev_requirement' => false,
), ),
'endroid/qr-code' => 'endroid/qr-code' => array(
array (
'pretty_version' => '3.9.6', 'pretty_version' => '3.9.6',
'version' => '3.9.6.0', 'version' => '3.9.6.0',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../endroid/qr-code',
), 'aliases' => array(),
'reference' => '9cdd4f5d609bfc8811ca4a62b4d23eb16976242f', 'reference' => '9cdd4f5d609bfc8811ca4a62b4d23eb16976242f',
'dev_requirement' => false,
), ),
'ezimuel/guzzlestreams' => 'ezimuel/guzzlestreams' => array(
array (
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../ezimuel/guzzlestreams',
'aliases' => array(
0 => '3.0.x-dev', 0 => '3.0.x-dev',
), ),
'reference' => 'abe3791d231167f14eb80d413420d1eab91163a8', 'reference' => 'abe3791d231167f14eb80d413420d1eab91163a8',
'dev_requirement' => false,
), ),
'ezimuel/ringphp' => 'ezimuel/ringphp' => array(
array (
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../ezimuel/ringphp',
'aliases' => array(
0 => '1.1.x-dev', 0 => '1.1.x-dev',
), ),
'reference' => '0b78f89d8e0bb9e380046c31adfa40347e9f663b', 'reference' => '0b78f89d8e0bb9e380046c31adfa40347e9f663b',
'dev_requirement' => false,
), ),
'guzzlehttp/guzzle' => 'guzzlehttp/guzzle' => array(
array (
'pretty_version' => '6.3.0', 'pretty_version' => '6.3.0',
'version' => '6.3.0.0', 'version' => '6.3.0.0',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../guzzlehttp/guzzle',
), 'aliases' => array(),
'reference' => 'f4db5a78a5ea468d4831de7f0bf9d9415e348699', 'reference' => 'f4db5a78a5ea468d4831de7f0bf9d9415e348699',
'dev_requirement' => false,
), ),
'guzzlehttp/promises' => 'guzzlehttp/promises' => array(
array (
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../guzzlehttp/promises',
'aliases' => array(
0 => '1.4.x-dev', 0 => '1.4.x-dev',
), ),
'reference' => '8e7d04f1f6450fef59366c399cfad4b9383aa30d', 'reference' => '8e7d04f1f6450fef59366c399cfad4b9383aa30d',
'dev_requirement' => false,
), ),
'guzzlehttp/psr7' => 'guzzlehttp/psr7' => array(
array (
'pretty_version' => '1.x-dev', 'pretty_version' => '1.x-dev',
'version' => '1.9999999.9999999.9999999-dev', 'version' => '1.9999999.9999999.9999999-dev',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../guzzlehttp/psr7',
), 'aliases' => array(),
'reference' => 'dc960a912984efb74d0a90222870c72c87f10c91', 'reference' => 'dc960a912984efb74d0a90222870c72c87f10c91',
'dev_requirement' => false,
), ),
'khanamiryan/qrcode-detector-decoder' => 'khanamiryan/qrcode-detector-decoder' => array(
array (
'pretty_version' => '1.0.5.1', 'pretty_version' => '1.0.5.1',
'version' => '1.0.5.1', 'version' => '1.0.5.1',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../khanamiryan/qrcode-detector-decoder',
), 'aliases' => array(),
'reference' => 'b96163d4f074970dfe67d4185e75e1f4541b30ca', 'reference' => 'b96163d4f074970dfe67d4185e75e1f4541b30ca',
'dev_requirement' => false,
), ),
'mongodb/mongodb' => 'mongodb/mongodb' => array(
array (
'pretty_version' => '1.4.3', 'pretty_version' => '1.4.3',
'version' => '1.4.3.0', 'version' => '1.4.3.0',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../mongodb/mongodb',
), 'aliases' => array(),
'reference' => '18fca8cc8d0c2cc07f76605760d20632bb3dab96', 'reference' => '18fca8cc8d0c2cc07f76605760d20632bb3dab96',
'dev_requirement' => false,
), ),
'myclabs/php-enum' => 'myclabs/php-enum' => array(
array (
'pretty_version' => '1.7.7', 'pretty_version' => '1.7.7',
'version' => '1.7.7.0', 'version' => '1.7.7.0',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../myclabs/php-enum',
), 'aliases' => array(),
'reference' => 'd178027d1e679832db9f38248fcc7200647dc2b7', 'reference' => 'd178027d1e679832db9f38248fcc7200647dc2b7',
'dev_requirement' => false,
), ),
'perftools/php-profiler' => 'perftools/php-profiler' => array(
array (
'pretty_version' => '0.18.0', 'pretty_version' => '0.18.0',
'version' => '0.18.0.0', 'version' => '0.18.0.0',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../perftools/php-profiler',
), 'aliases' => array(),
'reference' => '794c435f615ab9ca4347e386b4d8c6524fe9e3ae', 'reference' => '794c435f615ab9ca4347e386b4d8c6524fe9e3ae',
'dev_requirement' => false,
), ),
'pingplusplus/pingpp-php' => 'pingplusplus/pingpp-php' => array(
array (
'pretty_version' => '2.5.0', 'pretty_version' => '2.5.0',
'version' => '2.5.0.0', 'version' => '2.5.0.0',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../pingplusplus/pingpp-php',
), 'aliases' => array(),
'reference' => '0fadd17f28cf2366b4da2f7539c4b97bfa3f6f21', 'reference' => '0fadd17f28cf2366b4da2f7539c4b97bfa3f6f21',
'dev_requirement' => false,
), ),
'psr/http-message' => 'psr/http-message' => array(
array (
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../psr/http-message',
'aliases' => array(
0 => '1.0.x-dev', 0 => '1.0.x-dev',
), ),
'reference' => 'efd67d1dc14a7ef4fc4e518e7dee91c271d524e4', 'reference' => 'efd67d1dc14a7ef4fc4e518e7dee91c271d524e4',
'dev_requirement' => false,
), ),
'psr/http-message-implementation' => 'psr/http-message-implementation' => array(
array ( 'dev_requirement' => false,
'provided' => 'provided' => array(
array (
0 => '1.0', 0 => '1.0',
), ),
), ),
'psr/log' => 'psr/log' => array(
array (
'pretty_version' => 'dev-master', 'pretty_version' => 'dev-master',
'version' => 'dev-master', 'version' => 'dev-master',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../psr/log',
'aliases' => array(
0 => '1.1.x-dev', 0 => '1.1.x-dev',
), ),
'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11', 'reference' => 'd49695b909c3b7628b6289db5479a1c204601f11',
'dev_requirement' => false,
), ),
'ralouphie/getallheaders' => 'ralouphie/getallheaders' => array(
array (
'pretty_version' => '3.0.3', 'pretty_version' => '3.0.3',
'version' => '3.0.3.0', 'version' => '3.0.3.0',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../ralouphie/getallheaders',
), 'aliases' => array(),
'reference' => '120b605dfeb996808c31b6477290a714d356e822', 'reference' => '120b605dfeb996808c31b6477290a714d356e822',
'dev_requirement' => false,
), ),
'react/promise' => 'react/promise' => array(
array (
'pretty_version' => '2.x-dev', 'pretty_version' => '2.x-dev',
'version' => '2.9999999.9999999.9999999-dev', 'version' => '2.9999999.9999999.9999999-dev',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../react/promise',
), 'aliases' => array(),
'reference' => 'a9752a861e21c0fe0b380c9f9e55beddc0ed7d31', 'reference' => 'a9752a861e21c0fe0b380c9f9e55beddc0ed7d31',
'dev_requirement' => false,
), ),
'symfony/deprecation-contracts' => 'symfony/deprecation-contracts' => array(
array (
'pretty_version' => 'dev-main', 'pretty_version' => 'dev-main',
'version' => 'dev-main', 'version' => 'dev-main',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/deprecation-contracts',
'aliases' => array(
0 => '2.5.x-dev', 0 => '2.5.x-dev',
), ),
'reference' => '36b691b0bdbc963fb610da193a48b4c009d03a62', 'reference' => '6f981ee24cf69ee7ce9736146d1c57c2780598a8',
'dev_requirement' => false,
), ),
'symfony/options-resolver' => 'symfony/options-resolver' => array(
array (
'pretty_version' => '5.4.x-dev', 'pretty_version' => '5.4.x-dev',
'version' => '5.4.9999999.9999999-dev', 'version' => '5.4.9999999.9999999-dev',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/options-resolver',
), 'aliases' => array(),
'reference' => '05b35d6cc6227dc22fc053d0cfcd9f41000e2c80', 'reference' => '05b35d6cc6227dc22fc053d0cfcd9f41000e2c80',
'dev_requirement' => false,
), ),
'symfony/polyfill-ctype' => 'symfony/polyfill-ctype' => array(
array (
'pretty_version' => 'dev-main', 'pretty_version' => 'dev-main',
'version' => 'dev-main', 'version' => 'dev-main',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/polyfill-ctype',
'aliases' => array(
0 => '1.23.x-dev', 0 => '1.23.x-dev',
), ),
'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce', 'reference' => '46cd95797e9df938fdd2b03693b5fca5e64b01ce',
'dev_requirement' => false,
), ),
'symfony/polyfill-intl-grapheme' => 'symfony/polyfill-intl-grapheme' => array(
array (
'pretty_version' => 'dev-main', 'pretty_version' => 'dev-main',
'version' => 'dev-main', 'version' => 'dev-main',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/polyfill-intl-grapheme',
'aliases' => array(
0 => '1.23.x-dev', 0 => '1.23.x-dev',
), ),
'reference' => '16880ba9c5ebe3642d1995ab866db29270b36535', 'reference' => '16880ba9c5ebe3642d1995ab866db29270b36535',
'dev_requirement' => false,
), ),
'symfony/polyfill-intl-normalizer' => 'symfony/polyfill-intl-normalizer' => array(
array (
'pretty_version' => 'dev-main', 'pretty_version' => 'dev-main',
'version' => 'dev-main', 'version' => 'dev-main',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/polyfill-intl-normalizer',
'aliases' => array(
0 => '1.23.x-dev', 0 => '1.23.x-dev',
), ),
'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8', 'reference' => '8590a5f561694770bdcd3f9b5c69dde6945028e8',
'dev_requirement' => false,
), ),
'symfony/polyfill-mbstring' => 'symfony/polyfill-mbstring' => array(
array (
'pretty_version' => 'dev-main', 'pretty_version' => 'dev-main',
'version' => 'dev-main', 'version' => 'dev-main',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/polyfill-mbstring',
'aliases' => array(
0 => '1.23.x-dev', 0 => '1.23.x-dev',
), ),
'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6', 'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6',
'dev_requirement' => false,
), ),
'symfony/polyfill-php73' => 'symfony/polyfill-php73' => array(
array (
'pretty_version' => 'dev-main', 'pretty_version' => 'dev-main',
'version' => 'dev-main', 'version' => 'dev-main',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/polyfill-php73',
'aliases' => array(
0 => '1.23.x-dev', 0 => '1.23.x-dev',
), ),
'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010', 'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010',
'dev_requirement' => false,
), ),
'symfony/polyfill-php80' => 'symfony/polyfill-php80' => array(
array (
'pretty_version' => 'dev-main', 'pretty_version' => 'dev-main',
'version' => 'dev-main', 'version' => 'dev-main',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/polyfill-php80',
'aliases' => array(
0 => '1.23.x-dev', 0 => '1.23.x-dev',
), ),
'reference' => 'eca0bf41ed421bed1b57c4958bab16aa86b757d0', 'reference' => '19d03c391c6abb6791f5f757fb36e551bffeaa68',
'dev_requirement' => false,
), ),
'symfony/property-access' => 'symfony/property-access' => array(
array (
'pretty_version' => '5.4.x-dev', 'pretty_version' => '5.4.x-dev',
'version' => '5.4.9999999.9999999-dev', 'version' => '5.4.9999999.9999999-dev',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/property-access',
), 'aliases' => array(),
'reference' => '13c33f29a76bd99976ba7ee20297fa16d5a53a59', 'reference' => '13c33f29a76bd99976ba7ee20297fa16d5a53a59',
'dev_requirement' => false,
), ),
'symfony/property-info' => 'symfony/property-info' => array(
array (
'pretty_version' => '5.4.x-dev', 'pretty_version' => '5.4.x-dev',
'version' => '5.4.9999999.9999999-dev', 'version' => '5.4.9999999.9999999-dev',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/property-info',
), 'aliases' => array(),
'reference' => '718f093ae4cac054db2bbb39ebf86fd898583ac8', 'reference' => '718f093ae4cac054db2bbb39ebf86fd898583ac8',
'dev_requirement' => false,
), ),
'symfony/string' => 'symfony/string' => array(
array (
'pretty_version' => '5.4.x-dev', 'pretty_version' => '5.4.x-dev',
'version' => '5.4.9999999.9999999-dev', 'version' => '5.4.9999999.9999999-dev',
'aliases' => 'type' => 'library',
array ( 'install_path' => __DIR__ . '/../symfony/string',
), 'aliases' => array(),
'reference' => 'c29a3e649843f4a34eaa4be2683f4914e8b7f023', 'reference' => 'c29a3e649843f4a34eaa4be2683f4914e8b7f023',
'dev_requirement' => false,
), ),
), ),
); );
...@@ -16,7 +16,7 @@ This component provides features added to PHP 8.0 core: ...@@ -16,7 +16,7 @@ This component provides features added to PHP 8.0 core:
- [`get_resource_id`](https://php.net/get_resource_id) - [`get_resource_id`](https://php.net/get_resource_id)
More information can be found in the More information can be found in the
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md). [main Polyfill README](https://github.com/symfony/polyfill/blob/main/README.md).
License License
======= =======
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment