<?php
/**
 * ------------------------ 
 *  版权所有  www.tecmz.com
 *  商业版本请购买正版授权使用
 * ------------------------
*/ namespace ModStart\Core\Util; use ModStart\Core\Exception\BizException; use ModStart\ModStart; class QrcodeUtil { public static function png($rFmqf, $sg5_F = 200) { goto iOXXY; wQX0y: $W7WH0 = new \BaconQrCode\Writer($i0gNE); goto NNvOi; NNvOi: return $W7WH0->writeString($rFmqf); goto CN7aN; iOXXY: if (class_exists(\BaconQrCode\Renderer\Image\Png::class)) { goto b6Qqw; jp34S: $i0gNE->setHeight($sg5_F); goto d1gBJ; d1gBJ: $i0gNE->setWidth($sg5_F); goto B4aiH; b6Qqw: $i0gNE = new \BaconQrCode\Renderer\Image\Png(); goto ESJKq; ESJKq: $i0gNE->setMargin(0); goto jp34S; B4aiH: } else { BizException::throwsIf('Please Install imagick extension', !extension_loaded('imagick')); $i0gNE = new \BaconQrCode\Renderer\ImageRenderer(new \BaconQrCode\Renderer\RendererStyle\RendererStyle(400), new \BaconQrCode\Renderer\Image\ImagickImageBackEnd()); } goto wQX0y; CN7aN: } public static function pngBase64String($rFmqf, $sg5_F = 200) { return 'data:image/png;base64,' . base64_encode(self::png($rFmqf, $sg5_F)); } }