Commit 12c653d5 authored by luhongguang's avatar luhongguang

update:composer update

parent 0e9bc727
......@@ -12,7 +12,7 @@
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_services.git",
"reference": "d31275d12f73aba4220a0ae667c8490c084678a5"
"reference": "697463568a90156dd40ee8ff957c9cf189823c20"
},
"require": {
"api/php_utils": "dev-master",
......@@ -28,7 +28,7 @@
}
},
"description": "bp api php_services",
"time": "2021-06-24T06:50:34+00:00"
"time": "2021-07-26T03:47:20+00:00"
},
{
"name": "api/php_utils",
......@@ -36,7 +36,7 @@
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_utils.git",
"reference": "e6ae4af3b4d45d7cb111c3e35f9fa9902e7b3190"
"reference": "04d22704930fc63806000f51914ce7bcd59d38ae"
},
"require": {
"elasticsearch/elasticsearch": "~7.0",
......@@ -56,7 +56,7 @@
}
},
"description": "bp api php_utils",
"time": "2021-06-24T14:01:45+00:00"
"time": "2021-07-26T01:42:18+00:00"
},
{
"name": "bacon/bacon-qr-code",
......@@ -908,7 +908,7 @@
},
{
"name": "psr/log",
"version": "dev-master",
"version": "1.1.4",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
......@@ -923,7 +923,6 @@
"require": {
"php": ">=5.3.0"
},
"default-branch": true,
"type": "library",
"extra": {
"branch-alias": {
......@@ -1067,12 +1066,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/deprecation-contracts.git",
"reference": "36b691b0bdbc963fb610da193a48b4c009d03a62"
"reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/36b691b0bdbc963fb610da193a48b4c009d03a62",
"reference": "36b691b0bdbc963fb610da193a48b4c009d03a62",
"url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/6f981ee24cf69ee7ce9736146d1c57c2780598a8",
"reference": "6f981ee24cf69ee7ce9736146d1c57c2780598a8",
"shasum": ""
},
"require": {
......@@ -1127,7 +1126,7 @@
"type": "tidelift"
}
],
"time": "2021-06-09T13:36:38+00:00"
"time": "2021-07-12T14:48:14+00:00"
},
{
"name": "symfony/options-resolver",
......@@ -1135,21 +1134,20 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "162e886ca035869866d233a2bfef70cc28f9bbe5"
"reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/162e886ca035869866d233a2bfef70cc28f9bbe5",
"reference": "162e886ca035869866d233a2bfef70cc28f9bbe5",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/a603e5701bd6e305cfc777a8b50bf081ef73105e",
"reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php73": "~1.0",
"symfony/polyfill-php80": "^1.15"
"symfony/polyfill-php80": "^1.16"
},
"default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
......@@ -1181,7 +1179,7 @@
"options"
],
"support": {
"source": "https://github.com/symfony/options-resolver/tree/v5.3.0"
"source": "https://github.com/symfony/options-resolver/tree/5.4"
},
"funding": [
{
......@@ -1197,7 +1195,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T17:43:10+00:00"
"time": "2021-07-23T15:55:36+00:00"
},
{
"name": "symfony/polyfill-ctype",
......@@ -1613,12 +1611,12 @@
"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": {
......@@ -1673,7 +1671,7 @@
"shim"
],
"support": {
"source": "https://github.com/symfony/polyfill-php80/tree/v1.23.0"
"source": "https://github.com/symfony/polyfill-php80/tree/main"
},
"funding": [
{
......@@ -1689,7 +1687,7 @@
"type": "tidelift"
}
],
"time": "2021-02-19T12:13:01+00:00"
"time": "2021-07-13T14:34:27+00:00"
},
{
"name": "symfony/property-access",
......@@ -1697,18 +1695,18 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/property-access.git",
"reference": "fd89ef387030f4d4126fd9cddcc18dbfed27a346"
"reference": "12e1e517a315fa3a108dfcd3674e31542055d133"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/property-access/zipball/fd89ef387030f4d4126fd9cddcc18dbfed27a346",
"reference": "fd89ef387030f4d4126fd9cddcc18dbfed27a346",
"url": "https://api.github.com/repos/symfony/property-access/zipball/12e1e517a315fa3a108dfcd3674e31542055d133",
"reference": "12e1e517a315fa3a108dfcd3674e31542055d133",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15",
"symfony/polyfill-php80": "^1.16",
"symfony/property-info": "^5.2|^6.0"
},
"require-dev": {
......@@ -1717,7 +1715,6 @@
"suggest": {
"psr/cache-implementation": "To cache access methods."
},
"default-branch": true,
"type": "library",
"autoload": {
"psr-4": {
......@@ -1771,7 +1768,7 @@
"type": "tidelift"
}
],
"time": "2021-05-26T17:43:50+00:00"
"time": "2021-07-21T12:43:48+00:00"
},
{
"name": "symfony/property-info",
......@@ -1779,18 +1776,18 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/property-info.git",
"reference": "a45839949b03e1437837000ce8319a9214974501"
"reference": "63eddb6d10fffe3f25d901d78fef37ca88838b22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/property-info/zipball/a45839949b03e1437837000ce8319a9214974501",
"reference": "a45839949b03e1437837000ce8319a9214974501",
"url": "https://api.github.com/repos/symfony/property-info/zipball/63eddb6d10fffe3f25d901d78fef37ca88838b22",
"reference": "63eddb6d10fffe3f25d901d78fef37ca88838b22",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15",
"symfony/polyfill-php80": "^1.16",
"symfony/string": "^5.1|^6.0"
},
"conflict": {
......@@ -1861,7 +1858,7 @@
"type": "tidelift"
}
],
"time": "2021-06-03T14:00:26+00:00"
"time": "2021-07-21T12:43:48+00:00"
},
{
"name": "symfony/string",
......@@ -1869,12 +1866,12 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/string.git",
"reference": "92855c727d7edabe004605f451ef0b274fa24490"
"reference": "c29a3e649843f4a34eaa4be2683f4914e8b7f023"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/string/zipball/92855c727d7edabe004605f451ef0b274fa24490",
"reference": "92855c727d7edabe004605f451ef0b274fa24490",
"url": "https://api.github.com/repos/symfony/string/zipball/c29a3e649843f4a34eaa4be2683f4914e8b7f023",
"reference": "c29a3e649843f4a34eaa4be2683f4914e8b7f023",
"shasum": ""
},
"require": {
......@@ -1944,7 +1941,7 @@
"type": "tidelift"
}
],
"time": "2021-06-06T09:52:30+00:00"
"time": "2021-06-27T12:34:25+00:00"
}
],
"packages-dev": [],
......
......@@ -192,7 +192,7 @@ class Daemon
// $to = 'api@yidian-inc.com';
$to = 'zhangyu1@yidian-inc.com';
Email::sendMail('noreply@yidian-inc.com', $to, $subject, $mail_body);
Email::sendMail('bp-noreply@yidian-inc.com', $to, $subject, $mail_body);
}
}
}
......
......@@ -65,10 +65,10 @@ class JwUser
$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'])){
$total_time = round(($end - $begin), 4) * 1000;
if (!empty($user_info['response'])) {
$code = $user_info['response']['code'];
}else{
} else {
$code = -1;
}
MonUtil::proxyMon($url, $code, 'jw_user', $total_time);
......@@ -92,7 +92,7 @@ class JwUser
$params = ["userIds" => $params['user_id']];
//$user_info = (new TimeOut())->runPost($url, $params);
$user_info = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
$user_info = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('jw_user_getUserList', json_encode($user_info));
if (!$user_info) {
throw new CodeSpecialException("timeout");
......@@ -139,7 +139,7 @@ class JwUser
throw new CodeSpecialException("failed");
}
//$pushToken = (new TimeOut())->runPost($url, $params);
$pushToken = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
$pushToken = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('jw_user_savePushToken', json_encode($pushToken));
if (!$pushToken) {
throw new CodeSpecialException("timeout");
......@@ -164,7 +164,7 @@ class JwUser
$params = ["userIds" => $params['user_id']];
//$list = (new TimeOut())->runPost($url, $params);
$list = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
$list = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('jw_user_getUserListWithDynamic', json_encode($list));
if (!$list) {
throw new CodeSpecialException("timeout");
......@@ -189,7 +189,7 @@ class JwUser
$params = ["userId" => $params['user_id']];
//$list = (new TimeOut())->runPost($url, $params);
$list = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
$list = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('jw_user_getUserDigg', json_encode($list));
if (!$list) {
throw new CodeSpecialException("timeout");
......@@ -207,11 +207,29 @@ class JwUser
throw new CodeSpecialException("failed");
}
//$ret = (new TimeOut())->runPost($url, $params);
$ret = (new Request())->post($url, $params, 0, '', '', 0,true,'jw_user');
$ret = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('jw_user_saveUpdateLife', json_encode($ret));
if (!$ret) {
throw new CodeSpecialException("timeout");
}
return !empty($ret['response']) ? $ret['response'] : [];
}
/**
* 获取简网微信openid
*/
public static function getWechatOpenid($params)
{
$url = config('interface', 'service.jw_user.get_wechat_openid');
if (!$url) {
throw new CodeSpecialException("failed");
}
//$ret = (new TimeOut())->runPost($url, $params);
$ret = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
FileLog::info('getWechatOpenid', json_encode($ret));
if (!$ret) {
throw new CodeSpecialException("timeout");
}
return !empty($ret['response']) ? $ret['response'] : [];
}
}
......@@ -3,6 +3,7 @@
namespace Api\PhpServices\Ksy;
use Api\PhpUtils\Http\HttpUtil;
use Api\PhpUtils\Mon\MonUtil;
/**
* 文档: http://ydwiki.yidian-inc.com/pages/viewpage.action?pageId=68515904
......@@ -47,7 +48,13 @@ class Ks3Api
"signature" => $signature,
"type" => $type,
];
return HttpUtil::post($url, $params);
$begin = microtime(true);
$genRes = HttpUtil::post($url, $params);
$end = microtime(true);
$totalTime = round(($end - $begin), 4) * 1000;
MonUtil::proxyMon($url, $genRes["response"]['code'], 'ks3api', $totalTime);
return $genRes;
}
/**
......@@ -78,7 +85,13 @@ class Ks3Api
"resource" => $resource,
"headers" => $headers,
];
return HttpUtil::post($url, $params);
$begin = microtime(true);
$signatureRes = HttpUtil::post($url, $params);
$end = microtime(true);
$totalTime = round(($end - $begin), 4) * 1000;
MonUtil::proxyMon($url, $signatureRes["response"]['code'], 'ks3api', $totalTime);
return $signatureRes;
}
/**
......@@ -112,7 +125,13 @@ class Ks3Api
"content_type" => $contentType,
"extend" => $extendJsonStr,
];
return HttpUtil::post($url, $params);
$begin = microtime(true);
$encryptRes = HttpUtil::post($url, $params);
$end = microtime(true);
$totalTime = round(($end - $begin), 4) * 1000;
MonUtil::proxyMon($url, $encryptRes["response"]['code'], 'ks3api', $totalTime);
return $encryptRes;
}
/**
......@@ -139,7 +158,13 @@ class Ks3Api
"signature" => $signature,
"extend" => $extendJsonStr,
];
return HttpUtil::post($url, $params);
$begin = microtime(true);
$uploadRes = HttpUtil::post($url, $params);
$end = microtime(true);
$totalTime = round(($end - $begin), 4) * 1000;
MonUtil::proxyMon($url, $uploadRes["response"]['code'], 'ks3api', $totalTime);
return $uploadRes;
}
/**
......
......@@ -81,6 +81,7 @@ class Sms
'ticket_expire' => !empty($params['ticket_expire']) ? $params['ticket_expire'] : 86400,
'resend_times' => !empty($params['resend_times']) ? $params['resend_times'] : 5,
'retry_times' => !empty($params['retry_times']) ? $params['retry_times'] : 10,
'code_expire' => !empty($params['code_expire']) ? $params['code_expire'] : 600,
];
$sms = (new TimeOut())->runGet($url, $params);
......
......@@ -74,36 +74,6 @@ class CacheUtil
return call_user_func_array([$this->handler, $method], $args);
}
/**
* 获取原始数据
* @param $key
* @return mixed
*/
public function getUnChange($key, $prefix = ''){
return $this->handler->get($this->getCacheKey($prefix, $key));
}
/**
* 保存原始数据
* @param $key
* @param $value
* @param $expire
* @return mixed
*/
public function setUnChange($key , $value , $expire = null, $prefix = ''){
if (is_null($expire)) {
// $expire = $this->expire;
return false;
}
$key = $this->getCacheKey($prefix, $key);
if (is_int($expire) && $expire) {
$result = $this->handler->setex($key, $expire, $value);
} else {
$result = $this->handler->set($key, $value);
}
return $result;
}
/**
* 读取缓存
* @access public
......@@ -117,9 +87,7 @@ class CacheUtil
if (is_null($value) || false === $value) {
return $default;
}
$jsonData = json_decode($value, true);
// 检测是否为JSON数据 true 返回JSON解析数组, false返回源数据
return (null === $jsonData) ? $value : $jsonData;
return $value;
}
/**
......@@ -129,24 +97,13 @@ class CacheUtil
* @param mixed $default 默认值
* @return mixed
*/
public function gets($keys, $prefix = '', $default = false)
public function gets($keys, $prefix = '')
{
if(empty($keys) || !is_array($keys)) {
return $default;
return false;
}
$keys = array_values($keys);
$values = $this->handler->mGet($this->getCacheKey($prefix, $keys));
if (is_null($values) || false === $values) {
return $default;
}
$result = [];
foreach((array)$values as $i => $value) {
if($value !== false) {
$jsonData = json_decode($value, true);
$result[$keys[$i]] = (null === $jsonData) ? $value : $jsonData;
}
}
return $result;
return $this->handler->mGet($this->getCacheKey($prefix, $keys));
}
/**
......@@ -165,7 +122,6 @@ class CacheUtil
}
$key = $this->getCacheKey($prefix, $key);
//对数组/对象数据进行缓存处理,保证数据完整性
$value = (is_object($value) || is_array($value)) ? json_encode($value) : $value;
if (is_int($expire) && $expire) {
$result = $this->handler->setex($key, $expire, $value);
} else {
......@@ -189,7 +145,6 @@ class CacheUtil
$this->handler->multi();
foreach($items as $key => $value) {
$key = $this->getCacheKey($prefix, $key);
$value = (is_object($value) || is_array($value)) ? json_encode($value) : $value;
$this->handler->setex($key, $expire, $value);
}
return $this->handler->exec();
......@@ -210,7 +165,6 @@ class CacheUtil
}
$key = $this->getCacheKey($prefix, $key);
//对数组/对象数据进行缓存处理,保证数据完整性
$value = (is_object($value) || is_array($value)) ? json_encode($value) : $value;
if(is_int($expire) && $expire) {
$result = $this->handler->setenx($key, $expire, $value);
} else {
......
<?php
namespace Api\PhpUtils\Common;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
/**
* 根据给定数据生成excel文件,可选择生成本地临时文件或浏览器直接输出
*
* @author
* @since 2021-07-25
*/
class ExportExcel
{
/**
* 获取生成excel文件的绝对地址
*
* @param 必填项 :items {要生成excel的二维数组,array}
* @param 必填项 :keywords {生成excel使用的keywords数组(具体格式详见SendExportMail.class.php中keywords属性),array}
* @param 必填项 :filename {要生成excel的文件名,string}
* @return string {生成的excel文件的绝对地址}
*/
public static function getExcelFilePath($items, array $keywords, $filename = false)
{
$objPHPExcel = self::getPHPExcelObj($items, $keywords, $filename);
$writer = new Xlsx($objPHPExcel);
$filename = "/tmp/" . $filename;
if (file_exists($filename)) {
unlink($filename);
} else {
//$fp = fopen($filename, 'a');
}
//$objWriter->save($filename);
$writer->save($filename);
return $filename;
}
/**
* 生成PHPExcel object用于输出
*
* @param 必填项 :items {要生成excel的数组,array}
* @param 必填项 :keywords {生成excel文件使用的keywords数组(具体格式详见本类中keywords属性),array}
* @param 必填项 :filename {要生成excel的文件名,string}
* @return object {PHPExcel object}
*/
private static function getPHPExcelObj($items, array $keywords, $filename = false)
{
set_time_limit(0);
// Create new PHPExcel object
$objPHPExcel = new \PHPExcel();
// Set document properties
$objPHPExcel->getProperties()
->setCreator("yidian")
->setLastModifiedBy("yidian")
->setTitle("标题")
->setSubject("题目")
->setDescription("描述")
->setKeywords("关键字")
->setCategory("种类");
$ActiveSheet = $objPHPExcel->getActiveSheet();
$keywords = self::getKeywordsWithAlpha($keywords);
foreach ($keywords as $key => $value) {
// set the wdith of cloumn
$ActiveSheet->getColumnDimension($key)->setWidth($value['column_width']);
// set the value of first row
$ActiveSheet->getStyle($key)
->getAlignment()
->setHorizontal('center');
$ActiveSheet->setCellValue($key . '1', $value['column_name']);
}
$index = 2;
if (is_array($items)) {
foreach ($items as $item) {
foreach ($keywords as $key => $value) {
if (0 && is_numeric($item[$value['key']]) && ! is_int($item[$value['key']])) {
$ActiveSheet->setCellValue($key . $index, floatval($item[$value['key']]));
} elseif (0 && is_numeric($item[$value['key']])) {
$ActiveSheet->setCellValue($key . $index, intval($item[$value['key']]));
} else {
$ActiveSheet->setCellValue($key . $index, $item[$value['key']] . ' ');
}
$Alignment = $ActiveSheet->getStyle($key . $index)->getAlignment();
// 换行
$Alignment->setWrapText(true);
// 垂直居中
$Alignment->setVertical('center');
}
$index ++;
}
}
return $objPHPExcel;
}
/**
* 获取生成多sheet页excel文件的绝对地址
*
* @param 必填项 :data {要生成excel的三维数组,sheet页为第一维,array}
* @param 必填项 :filename {要生成excel的文件名,string}
* @return string {生成的excel文件的绝对地址}
*/
public static function getExcelFileForMultiSheet($data, $filename)
{
$objPHPExcel = self::getPHPExcelObjForMultiSheet($data);
$writer = new Xlsx($objPHPExcel);
//$objWriter = new \PHPExcel_Writer_Excel5($objPHPExcel);
$filename = "/tmp/" . $filename;
//$filename = "/Users/work/" . $filename;
if (file_exists($filename)) {
unlink($filename);
} else {
//$fp = fopen($filename, 'a');
}
//$objWriter->save($filename);
$writer->save($filename);
return $filename;
}
/**
* 生成多sheet页 PHPExcel object用于输出
*
* @param 必填项 :data {要生成excel的三维数组,sheet页为第一维,array}
* @param 必填项 :keywords {生成excel文件使用的keywords数组(具体格式详见本类中keywords属性),array}
* @param 必填项 :filename {要生成excel的文件名,string}
* @return object {PHPExcel object}
*/
private static function getPHPExcelObjForMultiSheet($data)
{
set_time_limit(0);
// Create new PHPExcel object
$objPHPExcel = new Spreadsheet();
// Set document properties
$objPHPExcel->getProperties()
->setCreator("yidian")
->setLastModifiedBy("yidian")
->setTitle("标题")
->setSubject("题目")
->setDescription("描述")
->setKeywords("关键字")
->setCategory("种类");
$sheetIndex = 0;
foreach ($data as $sheet) {
$sheetName = !empty($sheet['sheetName']) ? $sheet['sheetName'] : 'sheet'.$sheetIndex;
$topHeader = !empty($sheet['topHeader']) ? $sheet['topHeader'] : '';
$keywords = !empty($sheet['keywords']) ? $sheet['keywords'] : '';
$items = !empty($sheet['items']) ? $sheet['items'] : '';
//创建一个新的工作空间(sheet)
($sheetIndex > 0) && $objPHPExcel->createSheet();
$objPHPExcel->setActiveSheetIndex($sheetIndex);
$activeSheet = $objPHPExcel->getActiveSheet();
$activeSheet->setTitle($sheetName);
$index = 1;
$keywords = self::getKeywordsWithAlpha($keywords);
if ($topHeader) {
$indexAlpha = array_keys($keywords);
$endAlpha = end($indexAlpha);
$activeSheet->setCellValue('A1', $topHeader);
$activeSheet->mergeCells('A1:' . $endAlpha . '1');
$activeSheet->getRowDimension(1)->setRowHeight(30);
$activeSheet->getStyle('A1:' . $endAlpha . '1')
->getAlignment()
->setHorizontal('center')
->setVertical('center');
$index++;
}
foreach ($keywords as $key => $value) {
// set the wdith of cloumn
$activeSheet->getColumnDimension($key)->setWidth($value['column_width']);
// set the value of first row
$activeSheet->getStyle($key)
->getAlignment()
->setHorizontal('center');
$activeSheet->setCellValue($key . $index, $value['column_name']);
}
$index++;
if (empty($items) || !is_array($items)) {
continue;
}
foreach ($items as $item) {
foreach ($keywords as $key => $value) {
if (0 && is_numeric($item[$value['key']]) && ! is_int($item[$value['key']])) {
$activeSheet->setCellValue($key . $index, floatval($item[$value['key']]));
} elseif (0 && is_numeric($item[$value['key']])) {
$activeSheet->setCellValue($key . $index, intval($item[$value['key']]));
} else {
$activeSheet->setCellValue($key . $index, $item[$value['key']] . ' ');
}
$alignment = $activeSheet->getStyle($key . $index)->getAlignment();
// 换行
$alignment->setWrapText(true);
// 垂直居中
$alignment->setVertical('center');
}
$index ++;
}
$sheetIndex++;
}
return $objPHPExcel;
}
/**
* 将keywords数组索引转为excel英文列名
*
* @param 必填项 :keywords {keywords数组中下标,array}
* @return array {英文下标的数组(下标类似A,AA,BA)}
*/
private static function getKeywordsWithAlpha($keywords)
{
$keywordsWithAlpha = array();
if (is_array($keywords)) {
foreach ($keywords as $key => $value) {
$keywordsWithAlpha[self::intToUpperAlpha($key)] = $value;
}
}
return $keywordsWithAlpha;
}
/**
* 将数组int索引转化为excel列的列名字符串(A,AA,BA)
*
* @param 必填项 :ord {keywords数组中下标,int}
* @return string {excel列的列名字符串}
*/
private static function intToUpperAlpha($ord)
{
$baseOrd = ord('A');
$mod = floor($ord/26);
if ($mod == 0) {
$retAphla = chr($baseOrd + $ord);
} else {
$retAphla = chr($baseOrd + $mod-1);
$retAphla .= chr($baseOrd + $ord%26);
}
return $retAphla;
}
}
\ No newline at end of file
......@@ -70,7 +70,7 @@ class FileLog
foreach ($mail_to as $mail) {
$key = md5(sprintf("%s,%s", $mail, md5($signature)));
if (self::shouldSendEmail($key) === true) {
Email::sendMail('noreply@yidian-inc.com', $mail, $subject, $body);
Email::sendMail('bp-noreply@yidian-inc.com', $mail, $subject, $body);
}
}
}
......
......@@ -175,7 +175,7 @@ abstract class MysqlBase
{
if(PHP_SAPI == 'cli'){
// cli模式下,不走单例,gone away
$flush = true;
//$flush = true;
}
if (!isset(self::$dbConnect[static::CONFIG_INDEX.':'.$type]) || $flush) {
self::$dbConnect[static::CONFIG_INDEX.':'.$type] = new Medoo(self::getDbConf($type));
......
......@@ -27,12 +27,12 @@ class InstalledVersions
private static $installed = array (
'root' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db',
'reference' => '0e9bc7276a2d67047a7ac1eec490abe129b3c16b',
'name' => 'yidian/yaf_demo',
),
'versions' =>
......@@ -45,7 +45,7 @@ private static $installed = array (
array (
0 => '9999999-dev',
),
'reference' => 'cc3be45aa9bfc968b35f1d60c43115dae5f80da3',
'reference' => '697463568a90156dd40ee8ff957c9cf189823c20',
),
'api/php_utils' =>
array (
......@@ -55,7 +55,7 @@ private static $installed = array (
array (
0 => '9999999-dev',
),
'reference' => '44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4',
'reference' => '04d22704930fc63806000f51914ce7bcd59d38ae',
),
'bacon/bacon-qr-code' =>
array (
......@@ -238,7 +238,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '05b35d6cc6227dc22fc053d0cfcd9f41000e2c80',
'reference' => 'a603e5701bd6e305cfc777a8b50bf081ef73105e',
),
'symfony/polyfill-ctype' =>
array (
......@@ -307,7 +307,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => 'cb1aad06e7733a116f49033b1b3048a08e59ddd2',
'reference' => '12e1e517a315fa3a108dfcd3674e31542055d133',
),
'symfony/property-info' =>
array (
......@@ -316,7 +316,7 @@ private static $installed = array (
'aliases' =>
array (
),
'reference' => '36f5c26e3dbf6873b61b593cd86fe4616153d239',
'reference' => '63eddb6d10fffe3f25d901d78fef37ca88838b22',
),
'symfony/string' =>
array (
......@@ -329,12 +329,12 @@ private static $installed = array (
),
'yidian/yaf_demo' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db',
'reference' => '0e9bc7276a2d67047a7ac1eec490abe129b3c16b',
),
),
);
......
......@@ -42,6 +42,7 @@ return array(
'Api\\PhpUtils\\Cache\\CacheUtil' => $vendorDir . '/api/php_utils/src/Cache/CacheUtil.php',
'Api\\PhpUtils\\Common\\BaseConvert' => $vendorDir . '/api/php_utils/src/Common/BaseConvert.php',
'Api\\PhpUtils\\Common\\Docid' => $vendorDir . '/api/php_utils/src/Common/Docid.php',
'Api\\PhpUtils\\Common\\ExportExcel' => $vendorDir . '/api/php_utils/src/Common/ExportExcel.php',
'Api\\PhpUtils\\Common\\Geo' => $vendorDir . '/api/php_utils/src/Common/Geo.php',
'Api\\PhpUtils\\Common\\GoodsSkuId' => $vendorDir . '/api/php_utils/src/Common/GoodsSkuId.php',
'Api\\PhpUtils\\Common\\IP' => $vendorDir . '/api/php_utils/src/Common/IP.php',
......@@ -127,6 +128,7 @@ return array(
'App\\Services\\marketing\\MarketingGoodsService' => $baseDir . '/application/services/marketing/MarketingGoodsService.php',
'App\\Services\\marketing\\MarketingService' => $baseDir . '/application/services/marketing/MarketingService.php',
'App\\Services\\shop\\ShopService' => $baseDir . '/application/services/shop/ShopService.php',
'App\\Services\\tcc\\Tcc2Service' => $baseDir . '/application/services/tcc/Tcc2Service.php',
'App\\Services\\tcc\\TccService' => $baseDir . '/application/services/tcc/TccService.php',
'Attribute' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'BaconQrCode\\Common\\BitArray' => $vendorDir . '/bacon/bacon-qr-code/src/Common/BitArray.php',
......
......@@ -271,6 +271,7 @@ class ComposerStaticInit90e85a2e64f8339192f3e91b8700b9f2
'Api\\PhpUtils\\Cache\\CacheUtil' => __DIR__ . '/..' . '/api/php_utils/src/Cache/CacheUtil.php',
'Api\\PhpUtils\\Common\\BaseConvert' => __DIR__ . '/..' . '/api/php_utils/src/Common/BaseConvert.php',
'Api\\PhpUtils\\Common\\Docid' => __DIR__ . '/..' . '/api/php_utils/src/Common/Docid.php',
'Api\\PhpUtils\\Common\\ExportExcel' => __DIR__ . '/..' . '/api/php_utils/src/Common/ExportExcel.php',
'Api\\PhpUtils\\Common\\Geo' => __DIR__ . '/..' . '/api/php_utils/src/Common/Geo.php',
'Api\\PhpUtils\\Common\\GoodsSkuId' => __DIR__ . '/..' . '/api/php_utils/src/Common/GoodsSkuId.php',
'Api\\PhpUtils\\Common\\IP' => __DIR__ . '/..' . '/api/php_utils/src/Common/IP.php',
......@@ -356,6 +357,7 @@ class ComposerStaticInit90e85a2e64f8339192f3e91b8700b9f2
'App\\Services\\marketing\\MarketingGoodsService' => __DIR__ . '/../..' . '/application/services/marketing/MarketingGoodsService.php',
'App\\Services\\marketing\\MarketingService' => __DIR__ . '/../..' . '/application/services/marketing/MarketingService.php',
'App\\Services\\shop\\ShopService' => __DIR__ . '/../..' . '/application/services/shop/ShopService.php',
'App\\Services\\tcc\\Tcc2Service' => __DIR__ . '/../..' . '/application/services/tcc/Tcc2Service.php',
'App\\Services\\tcc\\TccService' => __DIR__ . '/../..' . '/application/services/tcc/TccService.php',
'Attribute' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Attribute.php',
'BaconQrCode\\Common\\BitArray' => __DIR__ . '/..' . '/bacon/bacon-qr-code/src/Common/BitArray.php',
......
......@@ -7,7 +7,7 @@
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_services.git",
"reference": "cc3be45aa9bfc968b35f1d60c43115dae5f80da3"
"reference": "697463568a90156dd40ee8ff957c9cf189823c20"
},
"require": {
"api/php_utils": "dev-master",
......@@ -15,7 +15,7 @@
"perftools/php-profiler": "^0.18.0",
"php": "7.2.*"
},
"time": "2021-07-19T12:51:28+00:00",
"time": "2021-07-26T03:47:20+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": "44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4"
"reference": "04d22704930fc63806000f51914ce7bcd59d38ae"
},
"require": {
"elasticsearch/elasticsearch": "~7.0",
......@@ -46,7 +46,7 @@
"mongodb/mongodb": "1.4.3",
"php": "7.2.*"
},
"time": "2021-07-19T16:13:22+00:00",
"time": "2021-07-26T01:42:18+00:00",
"default-branch": true,
"type": "library",
"installation-source": "source",
......@@ -1189,21 +1189,21 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "05b35d6cc6227dc22fc053d0cfcd9f41000e2c80"
"reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/05b35d6cc6227dc22fc053d0cfcd9f41000e2c80",
"reference": "05b35d6cc6227dc22fc053d0cfcd9f41000e2c80",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/a603e5701bd6e305cfc777a8b50bf081ef73105e",
"reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php73": "~1.0",
"symfony/polyfill-php80": "^1.15"
"symfony/polyfill-php80": "^1.16"
},
"time": "2021-07-02T16:38:59+00:00",
"time": "2021-07-23T15:55:36+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
......@@ -1236,7 +1236,7 @@
"options"
],
"support": {
"source": "https://github.com/symfony/options-resolver/tree/5.3"
"source": "https://github.com/symfony/options-resolver/tree/5.4"
},
"funding": [
{
......@@ -1771,18 +1771,18 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/property-access.git",
"reference": "cb1aad06e7733a116f49033b1b3048a08e59ddd2"
"reference": "12e1e517a315fa3a108dfcd3674e31542055d133"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/property-access/zipball/cb1aad06e7733a116f49033b1b3048a08e59ddd2",
"reference": "cb1aad06e7733a116f49033b1b3048a08e59ddd2",
"url": "https://api.github.com/repos/symfony/property-access/zipball/12e1e517a315fa3a108dfcd3674e31542055d133",
"reference": "12e1e517a315fa3a108dfcd3674e31542055d133",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15",
"symfony/polyfill-php80": "^1.16",
"symfony/property-info": "^5.2|^6.0"
},
"require-dev": {
......@@ -1791,7 +1791,7 @@
"suggest": {
"psr/cache-implementation": "To cache access methods."
},
"time": "2021-07-17T18:34:10+00:00",
"time": "2021-07-21T12:43:48+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
......@@ -1855,18 +1855,18 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/property-info.git",
"reference": "36f5c26e3dbf6873b61b593cd86fe4616153d239"
"reference": "63eddb6d10fffe3f25d901d78fef37ca88838b22"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/property-info/zipball/36f5c26e3dbf6873b61b593cd86fe4616153d239",
"reference": "36f5c26e3dbf6873b61b593cd86fe4616153d239",
"url": "https://api.github.com/repos/symfony/property-info/zipball/63eddb6d10fffe3f25d901d78fef37ca88838b22",
"reference": "63eddb6d10fffe3f25d901d78fef37ca88838b22",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15",
"symfony/polyfill-php80": "^1.16",
"symfony/string": "^5.1|^6.0"
},
"conflict": {
......@@ -1887,7 +1887,7 @@
"symfony/doctrine-bridge": "To use Doctrine metadata",
"symfony/serializer": "To use Serializer metadata"
},
"time": "2021-07-18T16:31:21+00:00",
"time": "2021-07-21T12:43:48+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
......
<?php return array (
'root' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db',
'reference' => '0e9bc7276a2d67047a7ac1eec490abe129b3c16b',
'name' => 'yidian/yaf_demo',
),
'versions' =>
......@@ -19,7 +19,7 @@
array (
0 => '9999999-dev',
),
'reference' => 'cc3be45aa9bfc968b35f1d60c43115dae5f80da3',
'reference' => '697463568a90156dd40ee8ff957c9cf189823c20',
),
'api/php_utils' =>
array (
......@@ -29,7 +29,7 @@
array (
0 => '9999999-dev',
),
'reference' => '44ddb35fa8ffe201baa7d71da8e42cc3e41d40b4',
'reference' => '04d22704930fc63806000f51914ce7bcd59d38ae',
),
'bacon/bacon-qr-code' =>
array (
......@@ -212,7 +212,7 @@
'aliases' =>
array (
),
'reference' => '05b35d6cc6227dc22fc053d0cfcd9f41000e2c80',
'reference' => 'a603e5701bd6e305cfc777a8b50bf081ef73105e',
),
'symfony/polyfill-ctype' =>
array (
......@@ -281,7 +281,7 @@
'aliases' =>
array (
),
'reference' => 'cb1aad06e7733a116f49033b1b3048a08e59ddd2',
'reference' => '12e1e517a315fa3a108dfcd3674e31542055d133',
),
'symfony/property-info' =>
array (
......@@ -290,7 +290,7 @@
'aliases' =>
array (
),
'reference' => '36f5c26e3dbf6873b61b593cd86fe4616153d239',
'reference' => '63eddb6d10fffe3f25d901d78fef37ca88838b22',
),
'symfony/string' =>
array (
......@@ -303,12 +303,12 @@
),
'yidian/yaf_demo' =>
array (
'pretty_version' => 'dev-develop',
'version' => 'dev-develop',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'aliases' =>
array (
),
'reference' => '68ce832c192189e953b0bb2c9ce62aa9e5a5c3db',
'reference' => '0e9bc7276a2d67047a7ac1eec490abe129b3c16b',
),
),
);
......@@ -1049,7 +1049,7 @@ class OptionsResolver implements Options
$fmtAllowedTypes = implode('" or "', $this->allowedTypes[$option]);
$fmtProvidedTypes = implode('|', array_keys($invalidTypes));
$allowedContainsArrayType = \count(array_filter($this->allowedTypes[$option], static function ($item) {
return '[]' === substr($item, -2);
return str_ends_with($item, '[]');
})) > 0;
if (\is_array($value) && $allowedContainsArrayType) {
......@@ -1211,6 +1211,8 @@ class OptionsResolver implements Options
/**
* Not supported.
*
* @return void
*
* @throws AccessException
*/
public function offsetSet($option, $value)
......@@ -1221,6 +1223,8 @@ class OptionsResolver implements Options
/**
* Not supported.
*
* @return void
*
* @throws AccessException
*/
public function offsetUnset($option)
......
......@@ -19,7 +19,7 @@
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php73": "~1.0",
"symfony/polyfill-php80": "^1.15"
"symfony/polyfill-php80": "^1.16"
},
"autoload": {
"psr-4": { "Symfony\\Component\\OptionsResolver\\": "" },
......
......@@ -249,7 +249,7 @@ class PropertyAccessor implements PropertyAccessorInterface
}
if (\PHP_VERSION_ID < 80000) {
if (0 !== strpos($message, 'Argument ')) {
if (!str_starts_with($message, 'Argument ')) {
return;
}
......@@ -466,7 +466,7 @@ class PropertyAccessor implements PropertyAccessorInterface
&& $object instanceof $trace['class']
&& preg_match('/Return value (?:of .*::\w+\(\) )?must be of (?:the )?type (\w+), null returned$/', $e->getMessage(), $matches)
) {
throw new UninitializedPropertyException(sprintf('The method "%s::%s()" returned "null", but expected type "%3$s". Did you forget to initialize a property or to make the return type nullable using "?%3$s"?', false === strpos(\get_class($object), "@anonymous\0") ? \get_class($object) : (get_parent_class($object) ?: key(class_implements($object)) ?: 'class').'@anonymous', $name, $matches[1]), 0, $e);
throw new UninitializedPropertyException(sprintf('The method "%s::%s()" returned "null", but expected type "%3$s". Did you forget to initialize a property or to make the return type nullable using "?%3$s"?', !str_contains(\get_class($object), "@anonymous\0") ? \get_class($object) : (get_parent_class($object) ?: key(class_implements($object)) ?: 'class').'@anonymous', $name, $matches[1]), 0, $e);
}
throw $e;
......
......@@ -18,7 +18,7 @@
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15",
"symfony/polyfill-php80": "^1.16",
"symfony/property-info": "^5.2|^6.0"
},
"require-dev": {
......
......@@ -109,14 +109,14 @@ final class PhpDocTypeHelper
return null;
}
if ('[]' === substr($docType, -2)) {
if (str_ends_with($docType, '[]')) {
$collectionKeyType = new Type(Type::BUILTIN_TYPE_INT);
$collectionValueType = $this->createType($type, false, substr($docType, 0, -2));
return new Type(Type::BUILTIN_TYPE_ARRAY, $nullable, null, true, $collectionKeyType, $collectionValueType);
}
if (0 === strpos($docType, 'array<') && $type instanceof Array_) {
if (str_starts_with($docType, 'array<') && $type instanceof Array_) {
// array<value> is converted to x[] which is handled above
// so it's only necessary to handle array<key, value> here
$collectionKeyType = $this->getTypes($type->getKeyType())[0];
......
......@@ -25,7 +25,7 @@
"require": {
"php": ">=7.2.5",
"symfony/deprecation-contracts": "^2.1",
"symfony/polyfill-php80": "^1.15",
"symfony/polyfill-php80": "^1.16",
"symfony/string": "^5.1|^6.0"
},
"require-dev": {
......
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