You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pdd-order-api/app/libs/tool/class.DebugData.php

34 lines
591 B
PHTML

11 months ago
<?php
class DebugData {
private static $data;
public static function isDisplayError() {
if (AppConst::isPre() || Zc::C('env') != 'live') {
return true;
}
return false;
}
public static function add($key, $value) {
if (!self::isDisplayError()) {
return;
}
self::$data[] = [
$key => $value
];
}
public static function get() {
return self::$data;
}
public static function has() {
return !empty(self::$data);
}
public static function log($prefix = '') {
Zc::getLog('tool/debugData')->info($prefix . ' data: ' . print_r(self::$data, true));
}
}