Commit 704652bb authored by 卢洪光's avatar 卢洪光

Merge branch 'feature_ota_manage' into 'pre_release'

Feature ota manage

See merge request bp/goods!61
parents 392cf986 17fb594a
......@@ -16,6 +16,9 @@ class GoodsException extends BaseException
const OTA_NOT_EXIST = 38;
const RULE_LIMIT_ERROR = 50;
const NOT_FIND_MARKETING = 51;
const LABEL_PRINTER_ALREADY_EXIST = 53;
const PRINTER_BIND_ERROR = 54;
const PRINTER_SN_ERROR = 55;
protected $cus = [
0 => '商品创建失败,请稍后重试',
......@@ -71,5 +74,8 @@ class GoodsException extends BaseException
self::RULE_LIMIT_ERROR => '单人可买上限填写错误',
self::NOT_FIND_MARKETING => '找不到活动',
52 => '过期时间不得小于等于上架开始时间',
self::LABEL_PRINTER_ALREADY_EXIST => '标签打印机已被%s绑定',
self::PRINTER_BIND_ERROR => '打印机绑定失败:%s',
self::PRINTER_SN_ERROR => '打印机sn号码有误',
];
}
\ No newline at end of file
......@@ -14,6 +14,10 @@ class OtaValidate extends \Validate\BaseValidate
protected $rule = [
'ota_name' => 'require',
'ota_id' => 'require',
// 'address' => 'require',
// 'location' => 'require',
// 'longitude' => 'require',
// 'latitude' => 'require',
'offset' => 'egt:0',
'limit' => 'elt:100',
];
......@@ -22,6 +26,10 @@ class OtaValidate extends \Validate\BaseValidate
protected $message = [
"ota_name" => "供应商名称不能为空",
"ota_id" => "ota_id不能为空",
"address" => "详细地址不能为空",
"location" => "高德地图详细地址不能为空",
"longitude" => "经度不能为空",
"latitude" => "纬度不能为空",
"offset" => "偏移量不能小于0",
"limit" => "单次不能大于100条",
];
......@@ -41,12 +49,25 @@ class OtaValidate extends \Validate\BaseValidate
return $this->only(['ota_id']);
}
public function sceneUpdate()
public function sceneUndelete()
{
return $this->only(['ota_id']);
}
public function sceneUpdate()
{
return $this->only(['ota_id', 'ota_name']);
}
public function sceneListByIds()
{
return $this->only(['ota_id']);
}
public function is_label_printer_sn($value){
if( substr($value, 3, 1) != '2' ){
return false;
}
return true;
}
}
\ No newline at end of file
......@@ -22,9 +22,12 @@ class OtaController extends Base
$name = $this->params['ota_name'] ?? '';
$printerSn = $this->params['printer_sn'] ?? '';
$printerKey = $this->params['printer_key'] ?? '';
$labelPrinterSn = $this->params['label_printer_sn'] ?? '';
$labelPrinterKey = $this->params['label_printer_key'] ?? '';
$isNormal = $this->params['is_normal'] ?? false;
$offset = $this->params['offset'] ?? 0;
$limit = $this->params['limit'] ?? 20;
$res = OtaService::list($name, $printerSn, $printerKey, $offset, $limit);
$res = OtaService::list($name, $printerSn, $printerKey,$labelPrinterSn, $labelPrinterKey, $isNormal, $offset, $limit);
$this->success(['result' => $res]);
}
......@@ -67,6 +70,18 @@ class OtaController extends Base
$this->success(['status' => $res ? 'success' : 'failed']);
}
/**
* 删除一个供应商
* @throws \App\Exception\custom\ParamException
*/
public function undeleteAction()
{
(new OtaValidate())->scene('undelete')->validate();
$res = OtaService::undeleteOne($this->params['ota_id']);
$this->success(['status' => $res ? 'success' : 'failed']);
}
/**
* 更新供应商
......@@ -75,7 +90,7 @@ class OtaController extends Base
public function updateAction()
{
(new OtaValidate())->scene('update')->validate();
$res = OtaService::update($this->params);
$res = OtaService::update($this->params, true);
$this->success(['status' => $res ? 'success' : 'failed']);
}
......
......@@ -4,10 +4,12 @@ namespace App\Services\goods;
use App\Exception\custom\GoodsException;
use App\Models\goods\mysql\Ota;
use Api\PhpServices\Printer\PrinterFactory;
use Validate\OtaValidate;
class OtaService
{
const COLUMNS = ['ota_id','ota_name','printer_sn','printer_key'];
const COLUMNS = ['ota_id','ota_name','printer_sn','printer_key','label_printer_sn','label_printer_key', 'longitude', 'latitude', 'location', 'address', 'status'];
/**
* 获取供应商列表(op 后台)
* @param string $otaName
......@@ -17,13 +19,15 @@ class OtaService
* @param int $limit
* @return \Api\PhpUtils\Mysql\MysqlBase
*/
public static function list($otaName='',$printerSN='',$printerKey='',$offset=0,$limit=20)
public static function list($otaName='',$printerSN='',$printerKey='', $labelPrinterSN='',$labelPrinterKey='', $isNormal = false,$offset=0,$limit=20)
{
$otaName && $where['ota_name'] = $otaName;
$printerSN && $where["printer_sn"] = $printerSN;
$printerKey && $where['printer_key'] = $printerKey;
$labelPrinterSN && $where["label_printer_sn"] = $labelPrinterSN;
$labelPrinterKey && $where['label_printer_key'] = $labelPrinterKey;
$where['status'] = Ota::STATUS_NORMAL;
$isNormal &&$where['status'] = Ota::STATUS_NORMAL;
$where['ORDER'] = ['ota_id' => 'DESC'];
$where['LIMIT'] = [$offset, $limit];
......@@ -74,18 +78,65 @@ class OtaService
//检查打印机是否已存在 -- 打印机已被(商家名称)绑定
if(isset($params['printer_sn']) && $params['printer_sn']) {
if ((new OtaValidate())->is_label_printer_sn($params['printer_sn'])) {
throw new GoodsException(['cus' => GoodsException::PRINTER_SN_ERROR]);
}
$printer = self::list('',$params['printer_sn']);
if ($printer['total'] > 0) {
throw new GoodsException(
['cus' => GoodsException::PRINTER_ALREADY_EXIST,'data'=>[$printer['list'][0]['ota_name']]]
);
}
}
//检查标签打印机是否已存在 -- 打印机已被(商家名称)绑定
if(isset($params['label_printer_sn']) && $params['label_printer_sn']) {
if (!(new OtaValidate())->is_label_printer_sn($params['label_printer_sn'])) {
throw new GoodsException(['cus' => GoodsException::PRINTER_SN_ERROR]);
}
$printer = self::list('','', '', $params['label_printer_sn']);
if ($printer['total'] > 0) {
throw new GoodsException(
['cus' => GoodsException::LABEL_PRINTER_ALREADY_EXIST,'data'=>[$printer['list'][0]['ota_name']]]
);
}
}
try {
if(isset($params['printer_sn']) && $params['printer_sn']) {
$FeiPrinter = PrinterFactory::getPrinter('Fei');
$FeiPrinter->addPrinter([
'printer_sn' => $params['printer_sn'],
'printer_key' => $params['printer_key'],
'ota_name' => $params['ota_name'],
]);
}
if(isset($params['label_printer_sn']) && $params['label_printer_sn']) {
$FeiPrinter = PrinterFactory::getPrinter('Fei');
$FeiPrinter->addPrinter([
'printer_sn' => $params['label_printer_sn'],
'printer_key' => $params['label_printer_key'],
'ota_name' => $params['ota_name'],
]);
}
} catch (\Exception $e) {
throw new GoodsException(
['cus' => GoodsException::PRINTER_BIND_ERROR,'data'=>[$e->getMessage()]]
);
}
$data['ota_name'] = $params['ota_name'];
$data['printer_sn'] = $params['printer_sn'] ?? '';
$data['printer_key'] = $params['printer_key'] ?? '';
$data['label_printer_sn'] = $params['label_printer_sn'] ?? '';
$data['label_printer_key'] = $params['label_printer_key'] ?? '';
$data['longitude'] = $params['longitude'] ?? 0;
$data['latitude'] = $params['latitude'] ?? 0;
$data['location'] = $params['location'] ?? '';
$data['address'] = $params['address'] ?? '';
return Ota::insert($data);
}
......@@ -100,27 +151,108 @@ class OtaService
return self::update(['ota_id'=>$otaId,'status'=>Ota::STATUS_DELETE]);
}
/**
* 取消删除供应商
* @param $otaId
* @return \Api\PhpUtils\Mysql\MysqlBase
*/
public static function unDeleteOne($otaId)
{
return self::update(['ota_id'=>$otaId,'status'=>Ota::STATUS_NORMAL]);
}
/**
* 更新供应商信息
* @param $params
* @return \Api\PhpUtils\Mysql\MysqlBase
* @throws GoodsException
*/
public static function update($params)
public static function update($params, $canUnBind = false)
{
if(empty($params['ota_id'])) {
throw new GoodsException(['cus' => GoodsException::EMPTY_OTA_ID]);
}
$otaDetail = self::detail($params['ota_id']);
//检查供应商是否存在
if (empty(self::detail($params['ota_id']))) {
if (empty($otaDetail)) {
throw new GoodsException(['cus' => GoodsException::OTA_NOT_EXIST]);
}
//检查打印机是否已存在 -- 打印机已被(商家名称)绑定
if(isset($params['printer_sn']) && $params['printer_sn'] && $otaDetail['printer_sn'] != $params['printer_sn']) {
if ((new OtaValidate())->is_label_printer_sn($params['printer_sn'])) {
throw new GoodsException(['cus' => GoodsException::PRINTER_SN_ERROR]);
}
$printer = self::list('',$params['printer_sn']);
if ($printer['total'] > 0) {
throw new GoodsException(
['cus' => GoodsException::PRINTER_ALREADY_EXIST,'data'=>[$printer['list'][0]['ota_name']]]
);
}
try {
$FeiPrinter = PrinterFactory::getPrinter('Fei');
$FeiPrinter->addPrinter([
'printer_sn' => $params['printer_sn'],
'printer_key' => $params['printer_key'],
'ota_name' => $params['ota_name'],
]);
} catch (\Exception $e) {
throw new GoodsException(['cus' => GoodsException::PRINTER_BIND_ERROR,'data'=>[$e->getMessage()]]);
}
}
//检查标签打印机是否已存在 -- 打印机已被(商家名称)绑定
if(isset($params['label_printer_sn']) && $params['label_printer_sn'] && $otaDetail['label_printer_sn'] != $params['label_printer_sn']) {
if (!(new OtaValidate())->is_label_printer_sn($params['label_printer_sn'])) {
throw new GoodsException(['cus' => GoodsException::PRINTER_SN_ERROR]);
}
$printer = self::list('','', '', $params['label_printer_sn']);
if ($printer['total'] > 0) {
throw new GoodsException(
['cus' => GoodsException::LABEL_PRINTER_ALREADY_EXIST,'data'=>[$printer['list'][0]['ota_name']]]
);
}
try {
$FeiPrinter = PrinterFactory::getPrinter('Fei');
$FeiPrinter->addPrinter([
'printer_sn' => $params['label_printer_sn'],
'printer_key' => $params['label_printer_key'],
'ota_name' => $params['ota_name'],
]);
} catch (\Exception $e) {
throw new GoodsException(['cus' => GoodsException::PRINTER_BIND_ERROR,'data'=>[$e->getMessage()]]);
}
}
$data = [];
isset($params['ota_name']) && $data['ota_name'] = $params['ota_name'];
isset($params['printer_sn']) && $data['printer_sn'] = $params['printer_sn'];
isset($params['printer_key']) && $data['printer_key'] = $params['printer_key'];
isset($params['label_printer_sn']) && $data['label_printer_sn'] = $params['label_printer_sn'];
isset($params['label_printer_key']) && $data['label_printer_key'] = $params['label_printer_key'];
isset($params['longitude']) && $data['longitude'] = $params['longitude'];
isset($params['latitude']) && $data['latitude'] = $params['latitude'];
isset($params['location']) && $data['location'] = $params['location'];
isset($params['address']) && $data['address'] = $params['address'];
isset($params['status']) && $data['status'] = $params['status'];
// 解绑
if ($canUnBind && !empty($otaDetail['printer_sn']) && empty($params['printer_sn']) && empty($params['printer_key'])) {
$data['printer_sn'] = $data['printer_key'] = '';
}
if ($canUnBind && !empty($otaDetail['label_printer_sn']) && empty($params['label_printer_sn']) && empty($params['label_printer_key'])) {
$data['label_printer_sn'] = $data['label_printer_key'] = '';
}
return Ota::update(
$data,
['ota_id'=>$params['ota_id']]
......
......@@ -6,8 +6,8 @@
"require": {
"php": "7.2.*",
"ext-json": "*",
"api/php_services":"1.0.15",
"api/php_utils":"1.0.17",
"api/php_services":"1.0.14",
"ext-openssl": "*"
},
"minimum-stability": "dev",
......
This diff is collapsed.
......@@ -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 名字
......@@ -105,7 +122,13 @@ class FeiPrinter extends \Api\PhpServices\Printer\Printer
]);
if ($res['code'] == 0 && isset($res['response'])) {
if ($res['response']['ret'] == 0) {
return $res['response']['data'];
if (is_array($res['response']['data']['ok']) && count($res['response']['data']['ok']) > 0) {
return true;
}
if (strpos($res['response']['data']['no'][0], '已被添加过')) {
return true;
}
throw new \Exception($res['response']['data']['no'][0]);
}
throw new \Exception($res['response']['msg']);
}
......@@ -186,4 +209,99 @@ class FeiPrinter extends \Api\PhpServices\Printer\Printer
}
throw new \Exception("接口调用异常");
}
/**
* 测试标签打印机
* 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 printLabelContent(string $printerId, array $content): string
{
$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 $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 返回
......
......@@ -4,4 +4,4 @@
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInit14d712e6ba9ca61e9e636d6cf65f43bf::getLoader();
return ComposerAutoloaderInit147d97defc074a277015f080b27e01c6::getLoader();
......@@ -338,7 +338,7 @@ class ClassLoader
* Loads the given class or interface.
*
* @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)
{
......@@ -347,6 +347,8 @@ class ClassLoader
return true;
}
return null;
}
/**
......
This diff is collapsed.
......@@ -141,6 +141,7 @@ return array(
'App\\Models\\user\\mysql\\UserWechatBind' => $baseDir . '/application/models/user/mysql/UserWechatBind.php',
'App\\Plugins\\Hook' => $baseDir . '/application/plugins/Hook.php',
'App\\Services\\common\\CommonService' => $baseDir . '/application/services/common/CommonService.php',
'App\\Services\\common\\KafkaService' => $baseDir . '/application/services/common/KafkaService.php',
'App\\Services\\demo\\ElasticService' => $baseDir . '/application/services/demo/ElasticService.php',
'App\\Services\\demo\\MongoService' => $baseDir . '/application/services/demo/MongoService.php',
'App\\Services\\demo\\MysqlService' => $baseDir . '/application/services/demo/MysqlService.php',
......
......@@ -8,18 +8,18 @@ $baseDir = dirname($vendorDir);
return array(
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => $vendorDir . '/symfony/deprecation-contracts/function.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',
'e69f7f6ee287b969198c3c9d6777bd38' => $vendorDir . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'8825ede83f2f289127722d4e842cf7e8' => $vendorDir . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => $vendorDir . '/symfony/polyfill-ctype/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',
'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',
);
......@@ -2,7 +2,7 @@
// autoload_real.php @generated by Composer
class ComposerAutoloaderInit14d712e6ba9ca61e9e636d6cf65f43bf
class ComposerAutoloaderInit147d97defc074a277015f080b27e01c6
{
private static $loader;
......@@ -24,15 +24,15 @@ class ComposerAutoloaderInit14d712e6ba9ca61e9e636d6cf65f43bf
require __DIR__ . '/platform_check.php';
spl_autoload_register(array('ComposerAutoloaderInit14d712e6ba9ca61e9e636d6cf65f43bf', 'loadClassLoader'), true, true);
spl_autoload_register(array('ComposerAutoloaderInit147d97defc074a277015f080b27e01c6', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(\dirname(__FILE__)));
spl_autoload_unregister(array('ComposerAutoloaderInit14d712e6ba9ca61e9e636d6cf65f43bf', 'loadClassLoader'));
spl_autoload_unregister(array('ComposerAutoloaderInit147d97defc074a277015f080b27e01c6', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf::getInitializer($loader));
call_user_func(\Composer\Autoload\ComposerStaticInit147d97defc074a277015f080b27e01c6::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
......@@ -53,19 +53,19 @@ class ComposerAutoloaderInit14d712e6ba9ca61e9e636d6cf65f43bf
$loader->register(true);
if ($useStaticLoader) {
$includeFiles = Composer\Autoload\ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf::$files;
$includeFiles = Composer\Autoload\ComposerStaticInit147d97defc074a277015f080b27e01c6::$files;
} else {
$includeFiles = require __DIR__ . '/autoload_files.php';
}
foreach ($includeFiles as $fileIdentifier => $file) {
composerRequire14d712e6ba9ca61e9e636d6cf65f43bf($fileIdentifier, $file);
composerRequire147d97defc074a277015f080b27e01c6($fileIdentifier, $file);
}
return $loader;
}
}
function composerRequire14d712e6ba9ca61e9e636d6cf65f43bf($fileIdentifier, $file)
function composerRequire147d97defc074a277015f080b27e01c6($fileIdentifier, $file)
{
if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
require $file;
......
......@@ -4,25 +4,25 @@
namespace Composer\Autoload;
class ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf
class ComposerStaticInit147d97defc074a277015f080b27e01c6
{
public static $files = array (
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
'6e3fae29631ef280660b3cdad06f25a8' => __DIR__ . '/..' . '/symfony/deprecation-contracts/function.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',
'e69f7f6ee287b969198c3c9d6777bd38' => __DIR__ . '/..' . '/symfony/polyfill-intl-normalizer/bootstrap.php',
'8825ede83f2f289127722d4e842cf7e8' => __DIR__ . '/..' . '/symfony/polyfill-intl-grapheme/bootstrap.php',
'320cde22f66dd4f5d3fd621d3e88b98f' => __DIR__ . '/..' . '/symfony/polyfill-ctype/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',
'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 (
......@@ -370,6 +370,7 @@ class ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf
'App\\Models\\user\\mysql\\UserWechatBind' => __DIR__ . '/../..' . '/application/models/user/mysql/UserWechatBind.php',
'App\\Plugins\\Hook' => __DIR__ . '/../..' . '/application/plugins/Hook.php',
'App\\Services\\common\\CommonService' => __DIR__ . '/../..' . '/application/services/common/CommonService.php',
'App\\Services\\common\\KafkaService' => __DIR__ . '/../..' . '/application/services/common/KafkaService.php',
'App\\Services\\demo\\ElasticService' => __DIR__ . '/../..' . '/application/services/demo/ElasticService.php',
'App\\Services\\demo\\MongoService' => __DIR__ . '/../..' . '/application/services/demo/MongoService.php',
'App\\Services\\demo\\MysqlService' => __DIR__ . '/../..' . '/application/services/demo/MysqlService.php',
......@@ -1314,9 +1315,9 @@ class ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit14d712e6ba9ca61e9e636d6cf65f43bf::$classMap;
$loader->prefixLengthsPsr4 = ComposerStaticInit147d97defc074a277015f080b27e01c6::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInit147d97defc074a277015f080b27e01c6::$prefixDirsPsr4;
$loader->classMap = ComposerStaticInit147d97defc074a277015f080b27e01c6::$classMap;
}, null, ClassLoader::class);
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -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)
{
......
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