<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use BaconQrCode\Encoder\Encoder; use ModStart\Core\Exception\BizException; use ModStart\ModStart; class QrcodeUtil { public static function png($vVYCS, $DlhlZ = 200) { goto PgUSR; khPuY: return $yVrz5->writeString($vVYCS, 'UTF-8'); goto scEBy; PgUSR: if (class_exists(\BaconQrCode\Renderer\Image\Png::class)) { goto pBMr9; pBMr9: $t3Aok = new \BaconQrCode\Renderer\Image\Png(); goto iLZ_E; N4Huc: $t3Aok->setWidth($DlhlZ); goto zNmx2; JGW8K: $t3Aok->setHeight($DlhlZ); goto N4Huc; iLZ_E: $t3Aok->setMargin(0); goto JGW8K; zNmx2: } else { BizException::throwsIf('Please Install imagick extension', !extension_loaded('imagick')); $t3Aok = new \BaconQrCode\Renderer\ImageRenderer(new \BaconQrCode\Renderer\RendererStyle\RendererStyle(400), new \BaconQrCode\Renderer\Image\ImagickImageBackEnd()); } goto OlR_B; OlR_B: $yVrz5 = new \BaconQrCode\Writer($t3Aok); goto khPuY; scEBy: } public static function pngBase64String($vVYCS, $DlhlZ = 200) { return 'data:image/png;base64,' . base64_encode(self::png($vVYCS, $DlhlZ)); } }