include/qrcode.class.php
(开头部分) 3KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
* PHP QR Code porting
*
* @porting author dwi.setiyadi@gmail.com
* @original author http://phpqrcode.sourceforge.net/
*
* @version 1.0
*/
class DedeQrcode
{
var $cacheable = true;
var $cachedir = '/cache/';
var $errorlog = '/logs/';
var $quality = true;
var $size = 1024;
function __construct($config = array()) {
$this->initialize($config);
}
public function initialize($config = array()) {
$this->cacheable = (isset($config['cacheable'])) ? $config['cacheable'] : $this->cacheable;
$this->cachedir = (isset($config['cachedir'])) ? $config['cachedir'] : DEDEDATA.$this->cachedir;
$this->errorlog = (isset($config['errorlog'])) ? $config['errorlog'] : DEDEDATA.$this->errorlog;
$this->quality = (isset($config['quality'])) ? $config['quality'] : $this->quality;
$this->size = (isset($config['size'])) ? $config['size'] : $this->size;
// use cache - more disk reads but less CPU power, masks and format templates are stored there
if (!defined('QR_CACHEABLE')) define('QR_CACHEABLE', $this->cacheable);
// used when QR_CACHEABLE === true
if (!defined('QR_CACHE_DIR')) define('QR_CACHE_DIR', $this->cachedir);
// default error logs dir
if (!defined('QR_LOG_DIR')) define('QR_LOG_DIR', $this->errorlog);
// if true, estimates best mask (spec. default, but extremally slow; set to false to significant performance boost but (propably) worst quality code
if ($this->quality) {
if (!defined('QR_FIND_BEST_MASK')) define('QR_FIND_BEST_MASK', true);
} else {
if (!defined('QR_FIND_BEST_MASK')) define('QR_FIND_BEST_MASK', false);
if (!defined('QR_DEFAULT_MASK')) define('QR_DEFAULT_MASK', $this->quality);
}
// if false, checks all masks available, otherwise value tells count of masks need to be checked, mask id are got randomly
if (!defined('QR_FIND_FROM_RANDOM')) define('QR_FIND_FROM_RANDOM', false);
// maximum allowed png image width (in pixels), tune to make sure GD and PHP can handle such big images
if (!defined('QR_PNG_MAXIMUM_SIZE')) define('QR_PNG_MAXIMUM_SIZE', $this->size);
// call original library
require_once dirname(__FILE__)."/qrcode/qrconst.php";
require_once dirname(__FILE__)."/qrcode/qrtools.php";
require_once dirname(__FILE__)."/qrcode/qrspec.php";
require_once dirname(__FILE__)."/qrcode/qrimage.php";
require_once dirname(__FILE__)."/qrcode/qrinput.php";
require_once dirname(__FILE__)."/qrcode/qrbitstream.php";
require_once dirname(__FILE__)."/qrcode/qrsplit.php";
后面还有 43 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
