Commit ab7fe822 authored by mengweifu's avatar mengweifu

update:php_services to 1.0.15

parent fbcd418b
......@@ -7,7 +7,7 @@
"php": "7.2.*",
"ext-json": "*",
"api/php_utils":"1.0.12",
"api/php_services":"1.0.9",
"api/php_services":"1.0.15",
"ext-openssl": "*"
},
"minimum-stability": "dev",
......
This diff is collapsed.
......@@ -6,6 +6,7 @@ use Api\PhpUtils\Cache\ApcuUtil;
use Api\PhpUtils\Log\DaemonLog;
use Api\PhpUtils\Message\Email;
use Yaf\Application;
use App\Exception\ExceptionErrorCatch;
class Daemon
{
......@@ -266,7 +267,7 @@ class Daemon
ini_set('date.timezone','Asia/Shanghai');
ini_set("memory_limit", '2048M');
error_reporting(E_ALL);
set_error_handler([ExceptionErrorCatch::class, 'appError'], E_ALL & ~E_DEPRECATED);
//日志存储到 php-error.log
/*
//创建任务日志文件
......
......@@ -37,8 +37,17 @@ class JwUser
}
$params = ["mobilePhone" => $params['mobile']];
//$user_info = (new TimeOut())->runGet($url, $params);
$begin = microtime(true);
$user_info = (new Request())->get($url, $params);
$end = microtime(true);
$total_time = round(($end - $begin), 4) * 1000;
if (!empty($user_info['response'])) {
$code = $user_info['response']['code'];
} else {
$code = -1;
}
$env = \Yaf\Application::app()->environ() ?? "test";
MonUtil::proxyMon($url, $code, 'jw_user_'.$env, $total_time);
FileLog::info('jw_user_getUserInfo', json_encode($user_info));
if (!$user_info) {
throw new CodeSpecialException("timeout");
......@@ -61,7 +70,6 @@ class JwUser
}
$params = ["userId" => $params['user_id']];
//$user_info = (new TimeOut())->runPost($url, $params);
$begin = microtime(true);
$user_info = (new Request())->post($url, $params);
$end = microtime(true);
......@@ -71,7 +79,9 @@ class JwUser
} else {
$code = -1;
}
MonUtil::proxyMon($url, $code, 'jw_user', $total_time);
$env = \Yaf\Application::app()->environ() ?? "test";
MonUtil::proxyMon($url, $code, 'jw_user_'.$env, $total_time);
FileLog::info('jw_user_getUserByUserId', json_encode($user_info));
if (!$user_info) {
throw new CodeSpecialException("timeout");
......@@ -91,8 +101,17 @@ 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');
$begin = microtime(true);
$user_info = (new Request())->post($url, $params);
$end = microtime(true);
$total_time = round(($end - $begin), 4) * 1000;
if (!empty($user_info['response'])) {
$code = $user_info['response']['code'];
} else {
$code = -1;
}
$env = \Yaf\Application::app()->environ() ?? "test";
MonUtil::proxyMon($url, $code, 'jw_user_'.$env, $total_time);
FileLog::info('jw_user_getUserList', json_encode($user_info));
if (!$user_info) {
throw new CodeSpecialException("timeout");
......@@ -139,7 +158,17 @@ class JwUser
throw new CodeSpecialException("failed");
}
//$pushToken = (new TimeOut())->runPost($url, $params);
$pushToken = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
$begin = microtime(true);
$pushToken = (new Request())->post($url, $params);
$end = microtime(true);
$total_time = round(($end - $begin), 4) * 1000;
if (!empty($pushToken['response'])) {
$code = $pushToken['response']['code'];
} else {
$code = -1;
}
$env = \Yaf\Application::app()->environ() ?? "test";
MonUtil::proxyMon($url, $code, 'jw_user_'.$env, $total_time);
FileLog::info('jw_user_savePushToken', json_encode($pushToken));
if (!$pushToken) {
throw new CodeSpecialException("timeout");
......@@ -163,8 +192,17 @@ class JwUser
}
$params = ["userIds" => $params['user_id']];
//$list = (new TimeOut())->runPost($url, $params);
$list = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
$begin = microtime(true);
$list = (new Request())->post($url, $params);
$end = microtime(true);
$total_time = round(($end - $begin), 4) * 1000;
if (!empty($list['response'])) {
$code = $list['response']['code'];
} else {
$code = -1;
}
$env = \Yaf\Application::app()->environ() ?? "test";
MonUtil::proxyMon($url, $code, 'jw_user_'.$env, $total_time);
FileLog::info('jw_user_getUserListWithDynamic', json_encode($list));
if (!$list) {
throw new CodeSpecialException("timeout");
......@@ -188,8 +226,17 @@ class JwUser
}
$params = ["userId" => $params['user_id']];
//$list = (new TimeOut())->runPost($url, $params);
$list = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
$begin = microtime(true);
$list = (new Request())->post($url, $params);
$end = microtime(true);
$total_time = round(($end - $begin), 4) * 1000;
if (!empty($list['response'])) {
$code = $list['response']['code'];
} else {
$code = -1;
}
$env = \Yaf\Application::app()->environ() ?? "test";
MonUtil::proxyMon($url, $code, 'jw_user_'.$env, $total_time);
FileLog::info('jw_user_getUserDigg', json_encode($list));
if (!$list) {
throw new CodeSpecialException("timeout");
......@@ -206,8 +253,17 @@ class JwUser
if (!$url) {
throw new CodeSpecialException("failed");
}
//$ret = (new TimeOut())->runPost($url, $params);
$ret = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
$begin = microtime(true);
$ret = (new Request())->post($url, $params);
$end = microtime(true);
$total_time = round(($end - $begin), 4) * 1000;
if (!empty($ret['response'])) {
$code = $ret['response']['code'];
} else {
$code = -1;
}
$env = \Yaf\Application::app()->environ() ?? "test";
MonUtil::proxyMon($url, $code, 'jw_user_'.$env, $total_time);
FileLog::info('jw_user_saveUpdateLife', json_encode($ret));
if (!$ret) {
throw new CodeSpecialException("timeout");
......@@ -224,8 +280,17 @@ class JwUser
if (!$url) {
throw new CodeSpecialException("failed");
}
//$ret = (new TimeOut())->runPost($url, $params);
$ret = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
$begin = microtime(true);
$ret = (new Request())->post($url, $params);
$end = microtime(true);
$total_time = round(($end - $begin), 4) * 1000;
if (!empty($ret['response'])) {
$code = $ret['response']['code'];
} else {
$code = -1;
}
$env = \Yaf\Application::app()->environ() ?? "test";
MonUtil::proxyMon($url, $code, 'jw_user_'.$env, $total_time);
FileLog::info('getWechatOpenid', json_encode($ret));
if (!$ret) {
throw new CodeSpecialException("timeout");
......@@ -243,8 +308,17 @@ class JwUser
if (!$url) {
throw new CodeSpecialException("failed");
}
//$ret = (new TimeOut())->runPost($url, $params);
$ret = (new Request())->post($url, $params, 0, '', '', 0, true, 'jw_user');
$begin = microtime(true);
$ret = (new Request())->post($url, $params);
$end = microtime(true);
$total_time = round(($end - $begin), 4) * 1000;
if (!empty($ret['response'])) {
$code = $ret['response']['code'];
} else {
$code = -1;
}
$env = \Yaf\Application::app()->environ() ?? "test";
MonUtil::proxyMon($url, $code, 'jw_user_'.$env, $total_time);
FileLog::info('getWechatOpenid', json_encode($ret));
if (!$ret) {
throw new CodeSpecialException("timeout");
......
......@@ -44,6 +44,23 @@ class FeiPrinter extends \Api\PhpServices\Printer\Printer
*/
private const API_ADD_PRINTER = "Open_printerAddlist";
/**
* 打印(标签)
*/
private const API_LABEL_PRINT = "Open_printLabelMsg";
/**
* 标签打印常量
*/
private const LABEL_WIDTH = 320;
private const LABEL_HIGH = 240;
private const LABEL_FONT = 12;
private const LABEL_MARGIN_WIDTH = 20;
private const LABEL_MARGIN_HIGH = 20;
private const LABEL_PADDING = 45;
private const LABEL_FIELD_PADDING = 30;
private const LABEL_WORD_FULL_WIDTH = 22.4;
private const LABEL_WORD_HALF_WIDTH = 11.2;
/**
* @param string $apiName api 名字
......@@ -77,6 +94,23 @@ class FeiPrinter extends \Api\PhpServices\Printer\Printer
return HttpUtil::post(self::API, http_build_query($param));
}
private function _printContent(string $printerId,string $content): string
{
$res = $this->request(self::API_PRINT, [
'sn' => $printerId,
'content' => $content,
'times' => 1,// 打印联数
]);
if ($res['code'] == 0 && isset($res['response'])) {
if ($res['response']['ret'] == 0) {
return $res['response']['data'];
}
throw new \Exception($res['response']['msg']);
}
throw new \Exception("接口调用异常");
}
/**
* @inheritDoc
* @throws \Exception
......@@ -145,16 +179,31 @@ class FeiPrinter extends \Api\PhpServices\Printer\Printer
$formattedContent .= "$formattedRow<BR>";
}
$first = false;
if (strlen($formattedContent) > 4000) {
$return = self::_printContent($printerId, $formattedContent);
$formattedContent = "";
}
}
$res = $this->request(self::API_PRINT, [
'sn' => $printerId,
'content' => $formattedContent,
'times' => 1,// 打印联数
if (!empty($formattedContent))
$return = self::_printContent($printerId, $formattedContent);
return $return;
}
/**
* @inheritDoc
* @throws \Exception
*/
public function getOrderStatus(string $orderId): bool
{
$res = $this->request(self::API_ORDER_STATUS, [
'orderid' => $orderId,
]);
if ($res['code'] == 0 && isset($res['response'])) {
if ($res['response']['ret'] == 0) {
return $res['response']['data'];
return (bool) $res['response']['data'];
}
throw new \Exception($res['response']['msg']);
}
......@@ -162,20 +211,97 @@ class FeiPrinter extends \Api\PhpServices\Printer\Printer
}
/**
* @inheritDoc
* 测试标签打印机
* 570203776
* alter table ota add column `label_printer_sn` varchar(50) NOT NULL DEFAULT '' COMMENT '打印机SN' after `printer_key`, add column `label_printer_key` varchar(50) NOT NULL DEFAULT '' after `label_printer_sn`;
* @param string $printerId
* @param array $content
$content = [
'维多利亚',
'西红柿教育-维多利亚D1015',
'B:干豆角红烧肉+炝炒圆白菜(含米饭)',
'孟维甫 186****5946'
];
* @return string
* @throws \Exception
*/
public function getOrderStatus(string $orderId): bool
public function printLabelContent(string $printerId, array $content): string
{
$res = $this->request(self::API_ORDER_STATUS, [
'orderid' => $orderId,
$rowCount = count($content);
$firstRow = true;
$lastRow = false;
$formatContent = '';
$fontSize = self::LABEL_FONT;
$Y = self::LABEL_MARGIN_HIGH;
foreach (array_values($content) as $key => $row) {
// 判断是否是最后一行
($key + 1) == $rowCount && $lastRow = true;
//获取 换行后的每一行
$wrappedRow = self::_getWrappedRow($row);
foreach ($wrappedRow as $r) {
$wordWidth = mb_strwidth($r) * self::LABEL_WORD_HALF_WIDTH;
if ($lastRow) { // 右对齐
$X = intval(self::LABEL_WIDTH - $wordWidth - self::LABEL_MARGIN_WIDTH);
}
else if($firstRow) { //居中
$X = intval((self::LABEL_WIDTH - self::LABEL_MARGIN_WIDTH * 2 - $wordWidth) / 2) + self::LABEL_MARGIN_WIDTH;
}
else { // 左对齐
$X = self::LABEL_MARGIN_WIDTH;
}
$formatContent .= "<TEXT x=\"{$X}\" y=\"{$Y}\" font=\"{$fontSize}\" w=\"1\" h=\"1\" r=\"0\">{$r}</TEXT>";
$firstRow = false;
$Y += self::LABEL_FIELD_PADDING;
}
$Y += (self::LABEL_PADDING - self::LABEL_FIELD_PADDING);
}
$res = $this->request(self::API_LABEL_PRINT, [
'sn' => $printerId,
'content' => $formatContent,
'times' => 1,// 打印联数
]);
if ($res['code'] == 0 && isset($res['response'])) {
if ($res['response']['ret'] == 0) {
return (bool) $res['response']['data'];
return $res['response']['data'];
}
throw new \Exception($res['response']['msg']);
}
throw new \Exception("接口调用异常");
}
/**
* 自动换行
* @param string $row
* @return array
*/
private static function _getWrappedRow(string $row) : array
{
$wrappedRow = [];
$XCapacity = self::LABEL_WIDTH - self::LABEL_MARGIN_WIDTH * 2;
$wordWidth = mb_strwidth($row) * self::LABEL_WORD_HALF_WIDTH;
if ($wordWidth > $XCapacity) {
$begin = 0;
for ($i = 1; $i <= mb_strlen($row); $i++) {
$r = mb_substr($row, $begin, $i - $begin);
$rWidth = mb_strwidth($r) * self::LABEL_WORD_HALF_WIDTH;
if ($rWidth > $XCapacity) {
$wrappedRow[] = mb_substr($row, $begin, $i - $begin - 1);
$begin = $i - 1;
}
}
$wrappedRow[] = mb_substr($row, $begin);
}
else {
$wrappedRow[] = $row;
}
return $wrappedRow;
}
}
\ No newline at end of file
......@@ -42,6 +42,14 @@ abstract class Printer
*/
abstract public function printContent(string $printerId, array $content): string;
/**
* 打印
* @param string $printerId
* @param array $content 要打印的内容 支持一位数组 二维数组
* @return string 打印OrderID, ID
*/
abstract public function printLabelContent(string $printerId, array $content): string;
/**
* 查询打印状态
* @param string $orderId 为printContent 返回
......
......@@ -43,6 +43,7 @@ class WechatBind
if ((strtotime($userInfo['create_time']) + $timeInterval) > time()) {
return true;
}
return false;
}
// 没有查询到对应的openid数据
FileLog::error("调用isNewWechatUser方法未获取到数据:", json_encode(['openid' => $openid, 'timeInterval' => $timeInterval, 'res' => $res]));
......
......@@ -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',
'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 ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf
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',
'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 (
......
This diff is collapsed.
......@@ -5,18 +5,18 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '831ef95de225db85543c355ed675b00ff61030cd',
'reference' => 'fbcd418b6a1b47fab2b71637dc63a9e415392206',
'name' => 'yidian/yaf_demo',
'dev' => true,
),
'versions' => array(
'api/php_services' => array(
'pretty_version' => 'v1.0.9',
'version' => '1.0.9.0',
'pretty_version' => '1.0.15',
'version' => '1.0.15.0',
'type' => 'library',
'install_path' => __DIR__ . '/../api/php_services',
'aliases' => array(),
'reference' => 'cd08caa8f11627220db0d5f13cfb99198a1e7076',
'reference' => '590b209014d0ccb8de96dd4cb243eeee41cae47d',
'dev_requirement' => false,
),
'api/php_utils' => array(
......@@ -103,7 +103,7 @@
'aliases' => array(
0 => '1.4.x-dev',
),
'reference' => '8e7d04f1f6450fef59366c399cfad4b9383aa30d',
'reference' => 'c1dd809c8f51a477701052f4b9e5b4bb5c1061aa',
'dev_requirement' => false,
),
'guzzlehttp/psr7' => array(
......@@ -112,7 +112,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../guzzlehttp/psr7',
'aliases' => array(),
'reference' => 'dc960a912984efb74d0a90222870c72c87f10c91',
'reference' => '9d006741ba865a45adccfac45d8e1053086a5a3f',
'dev_requirement' => false,
),
'khanamiryan/qrcode-detector-decoder' => array(
......@@ -212,7 +212,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/options-resolver',
'aliases' => array(),
'reference' => 'f1b99f10ea04aa9d0aafddcd8ba3d65545403bab',
'reference' => 'cd63dbab0428a47f8576e4e58148aeae2e32e91c',
'dev_requirement' => false,
),
'symfony/polyfill-ctype' => array(
......@@ -256,7 +256,7 @@
'aliases' => array(
0 => '1.23.x-dev',
),
'reference' => '9174a3d80210dca8daa7f31fec659150bbeabfc6',
'reference' => '344e456152e22a1bce3048c6c311059ea14bde47',
'dev_requirement' => false,
),
'symfony/polyfill-php73' => array(
......@@ -267,7 +267,7 @@
'aliases' => array(
0 => '1.23.x-dev',
),
'reference' => 'fba8933c384d6476ab14fb7b8526e5287ca7e010',
'reference' => 'cc5db0e22b3cb4111010e48785a97f670b350ca5',
'dev_requirement' => false,
),
'symfony/polyfill-php80' => array(
......@@ -278,7 +278,7 @@
'aliases' => array(
0 => '1.23.x-dev',
),
'reference' => '1100343ed1a92e3a38f9ae122fc0eb21602547be',
'reference' => '57b712b08eddb97c762a8caa32c84e037892d2e9',
'dev_requirement' => false,
),
'symfony/property-access' => array(
......@@ -287,7 +287,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/property-access',
'aliases' => array(),
'reference' => '7831b0331b786db39026d190faa4914f94adb212',
'reference' => 'bd3efa2a2d856d167dde8e7b883c65119064b7f5',
'dev_requirement' => false,
),
'symfony/property-info' => array(
......@@ -296,7 +296,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/property-info',
'aliases' => array(),
'reference' => '3565216f9640b26b646855e39e7bfafc550c75db',
'reference' => '903f3f3f6a360bc4739f8390e5031acc70d9cd9f',
'dev_requirement' => false,
),
'symfony/string' => array(
......@@ -305,7 +305,7 @@
'type' => 'library',
'install_path' => __DIR__ . '/../symfony/string',
'aliases' => array(),
'reference' => '2342deb63fb5f8c45c5c190656d9aa0377792143',
'reference' => 'fa2c5cc3f7dac23d87429652fe0daf28d65cbd5b',
'dev_requirement' => false,
),
'yidian/yaf_demo' => array(
......@@ -314,7 +314,7 @@
'type' => 'project',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'reference' => '831ef95de225db85543c355ed675b00ff61030cd',
'reference' => 'fbcd418b6a1b47fab2b71637dc63a9e415392206',
'dev_requirement' => false,
),
),
......
Copyright (c) 2015-2016 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
The MIT License (MIT)
Copyright (c) 2015 Michael Dowling <mtdowling@gmail.com>
Copyright (c) 2015 Graham Campbell <hello@gjcampbell.co.uk>
Copyright (c) 2017 Tobias Schultze <webmaster@tubo-world.de>
Copyright (c) 2020 Tobias Nyholm <tobias.nyholm@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -530,3 +530,18 @@ A static API was first introduced in 1.4.0, in order to mitigate problems with f
| `is_rejected` | `Is::rejected` |
| `is_settled` | `Is::settled` |
| `coroutine` | `Coroutine::of` |
## Security
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/promises/security/policy) for more information.
## License
Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
## For Enterprise
Available as part of the Tidelift Subscription
The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-promises?utm_source=packagist-guzzlehttp-promises&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
......@@ -4,10 +4,25 @@
"keywords": ["promise"],
"license": "MIT",
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
}
],
"require": {
......@@ -35,5 +50,9 @@
"branch-alias": {
"dev-master": "1.4-dev"
}
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
}
name: BC Check
on:
pull_request:
jobs:
roave-bc-check:
name: Roave BC Check
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Roave BC Check
uses: docker://nyholm/roave-bc-check-ga
......@@ -10,7 +10,7 @@ jobs:
strategy:
max-parallel: 10
matrix:
php: ['5.6', '7.0', '7.1', '7.2', '7.3', '7.4']
php: ['5.5', '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0', '8.1']
steps:
- name: Set up PHP
......@@ -23,8 +23,12 @@ jobs:
- name: Checkout code
uses: actions/checkout@v2
- name: Mimic PHP 8.0
run: composer config platform.php 8.0.999
if: matrix.php > 8
- name: Install dependencies
run: composer update --no-interaction --no-progress --prefer-dist
run: composer update --no-interaction --no-progress
- name: Run tests
run: make test
......@@ -26,7 +26,7 @@ jobs:
- name: Download dependencies
uses: ramsey/composer-install@v1
with:
composer-options: --no-interaction --prefer-dist --optimize-autoloader
composer-options: --no-interaction --optimize-autoloader
- name: Start server
run: php -S 127.0.0.1:10002 tests/Integration/server.php &
......
Copyright (c) 2015 Michael Dowling, https://github.com/mtdowling <mtdowling@gmail.com>
The MIT License (MIT)
Copyright (c) 2015 Michael Dowling <mtdowling@gmail.com>
Copyright (c) 2015 Márk Sági-Kazár <mark.sagikazar@gmail.com>
Copyright (c) 2015 Graham Campbell <hello@gjcampbell.co.uk>
Copyright (c) 2016 Tobias Schultze <webmaster@tubo-world.de>
Copyright (c) 2016 George Mponos <gmponos@gmail.com>
Copyright (c) 2018 Tobias Nyholm <tobias.nyholm@gmail.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
......@@ -807,3 +807,18 @@ Whether two URIs can be considered equivalent. Both URIs are normalized automati
`$normalizations` bitmask. The method also accepts relative URI references and returns true when they are equivalent.
This of course assumes they will be resolved against the same base URI. If this is not the case, determination of
equivalence or difference of relative references does not mean anything.
## Security
If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/psr7/security/policy) for more information.
## License
Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.
## For Enterprise
Available as part of the Tidelift Subscription
The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-psr7?utm_source=packagist-guzzlehttp-psr7&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
{
"name": "guzzlehttp/psr7",
"type": "library",
"description": "PSR-7 message implementation that also provides common utility methods",
"keywords": ["request", "response", "message", "stream", "http", "uri", "url", "psr-7"],
"license": "MIT",
"authors": [
{
"name": "Graham Campbell",
"email": "hello@gjcampbell.co.uk",
"homepage": "https://github.com/GrahamCampbell"
},
{
"name": "Michael Dowling",
"email": "mtdowling@gmail.com",
"homepage": "https://github.com/mtdowling"
},
{
"name": "George Mponos",
"email": "gmponos@gmail.com",
"homepage": "https://github.com/gmponos"
},
{
"name": "Tobias Nyholm",
"email": "tobias.nyholm@gmail.com",
"homepage": "https://github.com/Nyholm"
},
{
"name": "Márk Sági-Kazár",
"email": "mark.sagikazar@gmail.com",
"homepage": "https://github.com/sagikazarmark"
},
{
"name": "Tobias Schultze",
"email": "webmaster@tubo-world.de",
"homepage": "https://github.com/Tobion"
}
],
......@@ -45,5 +65,9 @@
"branch-alias": {
"dev-master": "1.7-dev"
}
},
"config": {
"preferred-install": "dist",
"sort-packages": true
}
}
......@@ -434,6 +434,8 @@ class OptionsResolver implements Options
* @param string $package The name of the composer package that is triggering the deprecation
* @param string $version The version of the package that introduced the deprecation
* @param string|\Closure $message The deprecation message to use
*
* @return $this
*/
public function setDeprecated(string $option/*, string $package, string $version, $message = 'The option "%name%" is deprecated.' */): self
{
......
......@@ -602,6 +602,9 @@ final class Mbstring
if (80000 > \PHP_VERSION_ID) {
return false;
}
if (\is_int($c) || 'long' === $c || 'entity' === $c) {
return false;
}
throw new \ValueError('Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint');
}
......
......@@ -9,6 +9,8 @@
* file that was distributed with this source code.
*/
class JsonException extends Exception
{
if (\PHP_VERSION_ID < 70300) {
class JsonException extends Exception
{
}
}
<?php
class UnhandledMatchError extends Error
{
if (\PHP_VERSION_ID < 80000) {
class UnhandledMatchError extends Error
{
}
}
<?php
class ValueError extends Error
{
if (\PHP_VERSION_ID < 80000) {
class ValueError extends Error
{
}
}
......@@ -313,10 +313,8 @@ class PropertyAccessor implements PropertyAccessorInterface
if (!$zval[self::VALUE] instanceof \ArrayAccess && !\is_array($zval[self::VALUE])) {
return false;
}
} else {
if (!$this->isPropertyWritable($zval[self::VALUE], $propertyPath->getElement($i))) {
return false;
}
} elseif (!\is_object($zval[self::VALUE]) || !$this->isPropertyWritable($zval[self::VALUE], $propertyPath->getElement($i))) {
return false;
}
if (\is_object($zval[self::VALUE])) {
......@@ -663,10 +661,6 @@ class PropertyAccessor implements PropertyAccessorInterface
*/
private function isPropertyWritable(object $object, string $property): bool
{
if (!\is_object($object)) {
return false;
}
$mutatorForArray = $this->getWriteInfo(\get_class($object), $property, []);
if (PropertyWriteInfo::TYPE_NONE !== $mutatorForArray->getType() || ($object instanceof \stdClass && property_exists($object, $property))) {
......
......@@ -44,6 +44,8 @@ class PropertyAccessorBuilder
/**
* Enables the use of all magic methods by the PropertyAccessor.
*
* @return $this
*/
public function enableMagicMethods(): self
{
......@@ -54,6 +56,8 @@ class PropertyAccessorBuilder
/**
* Disable the use of all magic methods by the PropertyAccessor.
*
* @return $this
*/
public function disableMagicMethods(): self
{
......@@ -86,6 +90,8 @@ class PropertyAccessorBuilder
/**
* Enables the use of "__set" by the PropertyAccessor.
*
* @return $this
*/
public function enableMagicSet(): self
{
......@@ -108,6 +114,8 @@ class PropertyAccessorBuilder
/**
* Disables the use of "__get" by the PropertyAccessor.
*
* @return $this
*/
public function disableMagicGet(): self
{
......@@ -118,6 +126,8 @@ class PropertyAccessorBuilder
/**
* Disables the use of "__set" by the PropertyAccessor.
*
* @return $this
*/
public function disableMagicSet(): self
{
......@@ -227,7 +237,7 @@ class PropertyAccessorBuilder
/**
* Sets a cache system.
*
* @return PropertyAccessorBuilder
* @return $this
*/
public function setCacheItemPool(CacheItemPoolInterface $cacheItemPool = null)
{
......
......@@ -10,7 +10,7 @@ CHANGELOG
5.2.0
-----
* deprecated the `enable_magic_call_extraction` context option in `ReflectionExtractor::getWriteInfo()` and `ReflectionExtractor::getReadInfo()`. in favor of `enable_magic_methods_extraction`
* deprecated the `enable_magic_call_extraction` context option in `ReflectionExtractor::getWriteInfo()` and `ReflectionExtractor::getReadInfo()` in favor of `enable_magic_methods_extraction`
5.1.0
-----
......
......@@ -552,8 +552,8 @@ class ReflectionExtractor implements PropertyListExtractorInterface, PropertyTyp
$types = [];
$nullable = $reflectionType->allowsNull();
foreach ($reflectionType instanceof \ReflectionUnionType ? $reflectionType->getTypes() : [$reflectionType] as $type) {
$phpTypeOrClass = $reflectionType instanceof \ReflectionNamedType ? $reflectionType->getName() : (string) $type;
foreach (($reflectionType instanceof \ReflectionUnionType || $reflectionType instanceof \ReflectionIntersectionType) ? $reflectionType->getTypes() : [$reflectionType] as $type) {
$phpTypeOrClass = $type->getName();
if ('null' === $phpTypeOrClass || 'mixed' === $phpTypeOrClass || 'never' === $phpTypeOrClass) {
continue;
}
......
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