Commit 87d4f5f5 authored by cuiweifeng's avatar cuiweifeng

update : composer update

parent f416044e
......@@ -8,7 +8,7 @@
"ext-json": "*",
"ext-openssl": "*",
"api/php_services": "1.0.1",
"api/php_utils": "1.0.2",
"api/php_utils": "1.0.6",
"pingplusplus/pingpp-php": "2.5.0"
},
"minimum-stability": "dev",
......
......@@ -62,21 +62,10 @@ class FileLog
$exception_info = '';
}
$log .= ' [exception info: ]' . $exception_info;
$log .= ' [debug_backtrace info: ]' . print_r(debug_backtrace(), 1);
error_log($log);
if (empty($mail_to)) {
$mail_to = [
'wangdanfeng@yidian-inc.com',
'cuiweifeng@yidian-inc.com',
'luhongguang@yidian-inc.com',
'wangdong1@yidian-inc.com',
'wanjilong@yidian-inc.com',
'jianghaiming@yidian-inc.com',
'songxiaohang@yidian-inc.com',
'genghongfei@yidian-inc.com',
'mengweifu@yidian-inc.com',
'guozhiyuan@yidian-inc.com',
'suntengda@yidian-inc.com'
];
$mail_to = 'bp-server@yidian-inc.com';
}
$subject = 'App api #' . $signature . '# ' . $_SERVER['SERVER_NAME'] . ' (' . $_SERVER['SERVER_ADDR'] . ') Alert Message';
$body = 'Error: ' . $signature . "\n\n";
......
......@@ -2,6 +2,8 @@
namespace Api\PhpUtils\Message;
use Yaf\Application;
class Email
{
/**
......@@ -19,6 +21,10 @@ class Email
if (empty($to)) {
return false;
}
$env = Application::app()->environ();
if($env != 'test' && $env != 'prod' && $env != 'perf'){
return false;
}
if (empty($from)) {
$from = 'noreply@yidian-inc.com';
}
......@@ -30,6 +36,16 @@ class Email
fwrite($sock, "HELO " . $domain . "\r\n");
fgets($sock);
fwrite($sock, "auth login\r\n");
fgets($sock);
fwrite($sock, "YnAtbm9yZXBseQ==\r\n");
fgets($sock);
fwrite($sock, "VlhObGNtNWhiJFclVTY=\r\n");
fgets($sock);
fwrite($sock, "MAIL FROM:<" . $from . ">\r\n");
fgets($sock);
if (!is_array($to)) {
......
<?php
namespace Api\PhpUtils\Strategy;
/**
* Class ShareWorker
* @package Api\PhpUtils\Strategy
*
* 优惠券分摊处理算法
*/
class ShareWorker {
/**
* @param $items = ['sku_1'=>100, 'sku_2'=>85]
* @param $tip = 100
* @throws \ErrorException
* 根据商品价格等比做优惠金额的分摊, 做四舍五入。
*/
public static function coupon($items, $total_tip) {
if(!is_array($items) || $total_tip <= 0) {
throw new \ErrorException('输入分摊条件失败,请确认', '3001');
}
$total = 0;
foreach ($items as $k=>$price) {
if(!is_int($price) || $price < 0) {
throw new \ErrorException('存在金额非法,请核对金额', '3002');
}
$total += $price;
}
$ret = [];
$cleared = $cleared_tip = 0;
foreach ($items as $k=>$price) {
$left = $total - $cleared;
$ret[$k] = intval(round($price/$left * ($total_tip - $cleared_tip)));
$cleared_tip += $ret[$k];
$cleared += $price;
}
return $ret;
}
/**
* @param $mutiArr = [
['goods'=>['a1'=>600, 'a2'=>100, 'a3'=>1300], 'tip'=>100],
['goods'=>['a1'=>600, 'a2'=>600, 'a3'=>600], 'tip'=>4],
];
* @return array = [
['a1' => 30, 'a2' => 5, 'a3' => 65],
['a1' => 1, 'a2' => 2, 'a3' => 1]
];
* @throws \ErrorException
* 批量计算奖励,
*/
public static function batchCoupon($mutiArr) {
$ret = [];
foreach ($mutiArr as $k=>$item) {
$ret[$k] = self::coupon($item['goods'], $item['tip']);
}
return $ret;
}
}
......@@ -77,6 +77,7 @@ return array(
'Api\\PhpUtils\\Protobuf\\WebsiteLog\\WebLog' => $vendorDir . '/api/php_utils/src/Protobuf/WebsiteLog/WebLog.php',
'Api\\PhpUtils\\RabbitMq\\DelayRabbitMq' => $vendorDir . '/api/php_utils/src/RabbitMq/DelayRabbitMq.php',
'Api\\PhpUtils\\Redis\\RedisUtil' => $vendorDir . '/api/php_utils/src/Redis/RedisUtil.php',
'Api\\PhpUtils\\Strategy\\ShareWorker' => $vendorDir . '/api/php_utils/src/Strategy/ShareWorker.php',
'Api\\PhpUtils\\Validate\\Validate' => $vendorDir . '/api/php_utils/src/Validate/Validate.php',
'Api\\PhpUtils\\Validate\\ValidateRule' => $vendorDir . '/api/php_utils/src/Validate/ValidateRule.php',
'App\\Base\\Base' => $baseDir . '/application/modules/Base/Base.php',
......
......@@ -8,18 +8,18 @@ $baseDir = dirname($vendorDir);
return array(
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/bootstrap.php',
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => $vendorDir . '/symfony/string/Resources/functions.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
'7b11c4dc42b3b3023073cb14e519683c' => $vendorDir . '/ralouphie/getallheaders/src/getallheaders.php',
'ad155f8f1cf0d418fe49e248db8c661b' => $vendorDir . '/react/promise/src/functions_include.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => $vendorDir . '/symfony/polyfill-php73/bootstrap.php',
'c964ee0ededf28c96ebd9db5099ef910' => $vendorDir . '/guzzlehttp/promises/src/functions_include.php',
'a9ed0d27b5a698798a89181429f162c5' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/Common/customFunctions.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => $vendorDir . '/guzzlehttp/psr7/src/functions_include.php',
'a9ed0d27b5a698798a89181429f162c5' => $vendorDir . '/khanamiryan/qrcode-detector-decoder/lib/Common/customFunctions.php',
'8592c7b0947d8a0965a9e8c3d16f9c24' => $vendorDir . '/elasticsearch/elasticsearch/src/autoload.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => $vendorDir . '/guzzlehttp/guzzle/src/functions_include.php',
'3a37ebac017bc098e9a86b35401e7a68' => $vendorDir . '/mongodb/mongodb/src/functions.php',
'8592c7b0947d8a0965a9e8c3d16f9c24' => $vendorDir . '/elasticsearch/elasticsearch/src/autoload.php',
);
......@@ -9,20 +9,20 @@ class ComposerStaticInitbf6a68f31320e30b81d82f10f54d3886
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/bootstrap.php',
'8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
'b6b991a57620e2fb6b2f66f03fe9ddc2' => __DIR__ . '/..' . '/symfony/string/Resources/functions.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
'7b11c4dc42b3b3023073cb14e519683c' => __DIR__ . '/..' . '/ralouphie/getallheaders/src/getallheaders.php',
'ad155f8f1cf0d418fe49e248db8c661b' => __DIR__ . '/..' . '/react/promise/src/functions_include.php',
'0d59ee240a4cd96ddbb4ff164fccea4d' => __DIR__ . '/..' . '/symfony/polyfill-php73/bootstrap.php',
'c964ee0ededf28c96ebd9db5099ef910' => __DIR__ . '/..' . '/guzzlehttp/promises/src/functions_include.php',
'a9ed0d27b5a698798a89181429f162c5' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/Common/customFunctions.php',
'a0edc8309cc5e1d60e3047b5df6b7052' => __DIR__ . '/..' . '/guzzlehttp/psr7/src/functions_include.php',
'a9ed0d27b5a698798a89181429f162c5' => __DIR__ . '/..' . '/khanamiryan/qrcode-detector-decoder/lib/Common/customFunctions.php',
'8592c7b0947d8a0965a9e8c3d16f9c24' => __DIR__ . '/..' . '/elasticsearch/elasticsearch/src/autoload.php',
'37a3dc5111fe8f707ab4c132ef1dbc62' => __DIR__ . '/..' . '/guzzlehttp/guzzle/src/functions_include.php',
'3a37ebac017bc098e9a86b35401e7a68' => __DIR__ . '/..' . '/mongodb/mongodb/src/functions.php',
'8592c7b0947d8a0965a9e8c3d16f9c24' => __DIR__ . '/..' . '/elasticsearch/elasticsearch/src/autoload.php',
);
public static $prefixLengthsPsr4 = array (
......@@ -311,6 +311,7 @@ class ComposerStaticInitbf6a68f31320e30b81d82f10f54d3886
'Api\\PhpUtils\\Protobuf\\WebsiteLog\\WebLog' => __DIR__ . '/..' . '/api/php_utils/src/Protobuf/WebsiteLog/WebLog.php',
'Api\\PhpUtils\\RabbitMq\\DelayRabbitMq' => __DIR__ . '/..' . '/api/php_utils/src/RabbitMq/DelayRabbitMq.php',
'Api\\PhpUtils\\Redis\\RedisUtil' => __DIR__ . '/..' . '/api/php_utils/src/Redis/RedisUtil.php',
'Api\\PhpUtils\\Strategy\\ShareWorker' => __DIR__ . '/..' . '/api/php_utils/src/Strategy/ShareWorker.php',
'Api\\PhpUtils\\Validate\\Validate' => __DIR__ . '/..' . '/api/php_utils/src/Validate/Validate.php',
'Api\\PhpUtils\\Validate\\ValidateRule' => __DIR__ . '/..' . '/api/php_utils/src/Validate/ValidateRule.php',
'App\\Base\\Base' => __DIR__ . '/../..' . '/application/modules/Base/Base.php',
......
......@@ -27,12 +27,12 @@
},
{
"name": "api/php_utils",
"version": "v1.0.2",
"version_normalized": "1.0.2.0",
"version": "v1.0.6",
"version_normalized": "1.0.6.0",
"source": {
"type": "git",
"url": "https://git.yidian-inc.com:8021/bp/php_utils.git",
"reference": "98d1aea6e76f55b2bfdd38c897fc6a8faa2bc722"
"reference": "8e8e414961ea10f32b79dbaeeb60d9e441a97ad6"
},
"require": {
"elasticsearch/elasticsearch": "~7.0",
......@@ -44,7 +44,7 @@
"mongodb/mongodb": "1.4.3",
"php": "7.2.*"
},
"time": "2021-08-03T02:31:09+00:00",
"time": "2021-08-06T16:38:16+00:00",
"type": "library",
"installation-source": "source",
"autoload": {
......@@ -1241,13 +1241,19 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/options-resolver.git",
"reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e"
"reference": "4b78e55b179003a42523a362cc0e8327f7a69b5e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/a603e5701bd6e305cfc777a8b50bf081ef73105e",
"reference": "a603e5701bd6e305cfc777a8b50bf081ef73105e",
"shasum": ""
"url": "https://api.github.com/repos/symfony/options-resolver/zipball/4b78e55b179003a42523a362cc0e8327f7a69b5e",
"reference": "4b78e55b179003a42523a362cc0e8327f7a69b5e",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.2.5",
......@@ -1255,7 +1261,7 @@
"symfony/polyfill-php73": "~1.0",
"symfony/polyfill-php80": "^1.16"
},
"time": "2021-07-23T15:55:36+00:00",
"time": "2021-08-04T21:20:46+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
......@@ -1288,7 +1294,7 @@
"options"
],
"support": {
"source": "https://github.com/symfony/options-resolver/tree/5.4"
"source": "https://github.com/symfony/options-resolver/tree/5.3"
},
"funding": [
{
......@@ -1823,13 +1829,19 @@
"source": {
"type": "git",
"url": "https://github.com/symfony/property-access.git",
"reference": "12e1e517a315fa3a108dfcd3674e31542055d133"
"reference": "d6ef552ac9b41f96e94e1e81d3a8746dfee3b34b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/property-access/zipball/12e1e517a315fa3a108dfcd3674e31542055d133",
"reference": "12e1e517a315fa3a108dfcd3674e31542055d133",
"shasum": ""
"url": "https://api.github.com/repos/symfony/property-access/zipball/d6ef552ac9b41f96e94e1e81d3a8746dfee3b34b",
"reference": "d6ef552ac9b41f96e94e1e81d3a8746dfee3b34b",
"shasum": "",
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
},
"require": {
"php": ">=7.2.5",
......@@ -1843,7 +1855,7 @@
"suggest": {
"psr/cache-implementation": "To cache access methods."
},
"time": "2021-07-21T12:43:48+00:00",
"time": "2021-08-04T21:21:08+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
......
......@@ -5,7 +5,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '861567a2f520ba42d5e5d7ecadf329b44b1ef0e1',
'reference' => 'f416044e10b1d67b729f931c0f3a7bff6994ce3a',
'name' => 'bp/pay',
'dev' => true,
),
......@@ -20,12 +20,12 @@
'dev_requirement' => false,
),
'api/php_utils' => array(
'pretty_version' => 'v1.0.2',
'version' => '1.0.2.0',
'pretty_version' => 'v1.0.6',
'version' => '1.0.6.0',
'type' => 'library',
'install_path' => __DIR__ . '/../api/php_utils',
'aliases' => array(),
'reference' => '98d1aea6e76f55b2bfdd38c897fc6a8faa2bc722',
'reference' => '8e8e414961ea10f32b79dbaeeb60d9e441a97ad6',
'dev_requirement' => false,
),
'bacon/bacon-qr-code' => array(
......@@ -43,7 +43,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '861567a2f520ba42d5e5d7ecadf329b44b1ef0e1',
'reference' => 'f416044e10b1d67b729f931c0f3a7bff6994ce3a',
'dev_requirement' => false,
),
'dasprid/enum' => array(
......@@ -230,7 +230,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/options-resolver',
'aliases' => array(),
'reference' => 'a603e5701bd6e305cfc777a8b50bf081ef73105e',
'reference' => '4b78e55b179003a42523a362cc0e8327f7a69b5e',
'dev_requirement' => false,
),
'symfony/polyfill-ctype' => array(
......@@ -305,7 +305,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/property-access',
'aliases' => array(),
'reference' => '12e1e517a315fa3a108dfcd3674e31542055d133',
'reference' => 'd6ef552ac9b41f96e94e1e81d3a8746dfee3b34b',
'dev_requirement' => false,
),
'symfony/property-info' => array(
......
......@@ -942,6 +942,7 @@ class OptionsResolver implements Options
* @throws OptionDefinitionException If there is a cyclic dependency between
* lazy options and/or normalizers
*/
#[\ReturnTypeWillChange]
public function offsetGet($option, bool $triggerDeprecation = true)
{
if (!$this->locked) {
......@@ -1199,6 +1200,7 @@ class OptionsResolver implements Options
*
* @see \ArrayAccess::offsetExists()
*/
#[\ReturnTypeWillChange]
public function offsetExists($option)
{
if (!$this->locked) {
......@@ -1215,6 +1217,7 @@ class OptionsResolver implements Options
*
* @throws AccessException
*/
#[\ReturnTypeWillChange]
public function offsetSet($option, $value)
{
throw new AccessException('Setting options via array access is not supported. Use setDefault() instead.');
......@@ -1227,6 +1230,7 @@ class OptionsResolver implements Options
*
* @throws AccessException
*/
#[\ReturnTypeWillChange]
public function offsetUnset($option)
{
throw new AccessException('Removing options via array access is not supported. Use remove() instead.');
......@@ -1243,6 +1247,7 @@ class OptionsResolver implements Options
*
* @see \Countable::count()
*/
#[\ReturnTypeWillChange]
public function count()
{
if (!$this->locked) {
......
......@@ -154,6 +154,7 @@ class PropertyPath implements \IteratorAggregate, PropertyPathInterface
*
* @return PropertyPathIteratorInterface
*/
#[\ReturnTypeWillChange]
public function getIterator()
{
return new PropertyPathIterator($this);
......
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