本文整理汇总了PHP中QRtools::log方法的典型用法代码示例。如果您正苦于以下问题:PHP QRtools::log方法的具体用法?PHP QRtools::log怎么用?PHP QRtools::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QRtools
的用法示例。
在下文中一共展示了QRtools::log方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: encodePNG
public function encodePNG($intext, $outfile = false, $saveandprint = false)
{
try {
ob_start();
$tab = $this->encode($intext);
$err = ob_get_contents();
ob_end_clean();
if ($err != '') {
QRtools::log($outfile, $err);
}
$maxSize = (int) (QR_PNG_MAXIMUM_SIZE / (count($tab) + 2 * $this->margin));
QRimage::png($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin, $saveandprint);
} catch (Exception $e) {
QRtools::log($outfile, $e->getMessage());
}
}
示例2: encodeJPG
public function encodeJPG($intext, $outfile = false, $q = 85, $rgb_color = '0,0,0', $rgb_bg_color = '255,255,255')
{
try {
ob_start();
$tab = $this->encode($intext);
$err = ob_get_contents();
ob_end_clean();
if ($err != '') {
QRtools::log($outfile, $err);
}
$maxSize = (int) (QR_JPG_MAXIMUM_SIZE / (count($tab) + 2 * $this->margin));
QRimage::jpg($tab, $outfile, min(max(1, $this->size), $maxSize), $this->margin, $q, $rgb_color, $rgb_bg_color);
} catch (Exception $e) {
QRtools::log($outfile, $e->getMessage());
}
}
示例3: _qr_img
protected static function _qr_img($data)
{
require_once self::$o->core_dir . 'libs/phpqrcode/qrlib.php';
require_once self::$o->core_dir . 'libs/phpqrcode/qsot-qrimage.php';
ob_start();
// create the encoder
$enc = QRencode::factory('L', 3, 1);
$outfile = false;
try {
// attempt to encode the data
ob_start();
$tab = $enc->encode($data);
$err = ob_get_contents();
ob_end_clean();
// log any errors produced
if ($err != '') {
QRtools::log($outfile, $err);
}
// calculate the dimensions of the image
$maxSize = (int) (QR_PNG_MAXIMUM_SIZE / (count($tab) + 2 * $enc->margin));
// render the image
$img_data = QSOT_QRimage::jpg_base64($tab, 2.5, $enc->margin, 100);
} catch (Exception $e) {
$img_data = array('data:image/jpeg;base64,', 0, 0);
// log any exceptions
QRtools::log($outfile, $e->getMessage());
}
return $img_data;
}
示例4: list
$out[] = '';
} else {
$out[] = $matches[0][3];
}
}
return $out;
}
// validate signature
list($key, $salt) = qsot_fetch_defines(array('NONCE_KEY', 'NONCE_SALT'), $d['p']);
$test = sha1($key . @json_encode($d) . $salt);
if ($test != $sig) {
die($debug ? '<!-- hash mismatch : ' . $sig . ' / ' . $test . ' -->' : '');
}
// end abuse protection
include_once 'qrlib.php';
//QRCode::png($d, false, 'L', 3, 1);
$enc = QRencode::factory('L', 3, 1);
$outfile = false;
try {
ob_start();
$tab = $enc->encode($d['d']);
$err = ob_get_contents();
ob_end_clean();
if ($err != '') {
QRtools::log($outfile, $err);
}
$maxSize = (int) (QR_PNG_MAXIMUM_SIZE / (count($tab) + 2 * $enc->margin));
QRimage::jpg($tab, $outfile, 2.5, $enc->margin, 100);
} catch (Exception $e) {
QRtools::log($outfile, $e->getMessage());
}