<?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($DTnPC, $VRgM7 = 200) { goto iy11u; iy11u: if (class_exists(\BaconQrCode\Renderer\Image\Png::class)) { goto qVv67; b_WcU: $edhxT->setMargin(0); goto R4Zp8; R4Zp8: $edhxT->setHeight($VRgM7); goto lFKVQ; qVv67: $edhxT = new \BaconQrCode\Renderer\Image\Png(); goto b_WcU; lFKVQ: $edhxT->setWidth($VRgM7); goto hahlg; hahlg: } else { BizException::throwsIf('Please Install imagick extension', !extension_loaded('imagick')); $edhxT = new \BaconQrCode\Renderer\ImageRenderer(new \BaconQrCode\Renderer\RendererStyle\RendererStyle(400), new \BaconQrCode\Renderer\Image\ImagickImageBackEnd()); } goto vbjnw; V4zvO: return $y3TrO->writeString($DTnPC, 'UTF-8'); goto WC5A0; vbjnw: $y3TrO = new \BaconQrCode\Writer($edhxT); goto V4zvO; WC5A0: } public static function pngBase64String($DTnPC, $VRgM7 = 200) { return 'data:image/png;base64,' . base64_encode(self::png($DTnPC, $VRgM7)); } }