本文整理汇总了PHP中Common::debug方法的典型用法代码示例。如果您正苦于以下问题:PHP Common::debug方法的具体用法?PHP Common::debug怎么用?PHP Common::debug使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Common
的用法示例。
在下文中一共展示了Common::debug方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: image
public function image()
{
$image = new Image('http://sinastorage.com/sandbox/test.jpg');
$image->rotate(50);
$s3 = new S3();
$result = $s3->plainWrite('test.jpg', $image->getContent(), $image->getSize(), $image->getMimeType());
Common::debug($result);
}
示例2: setOnlineDebug
public function setOnlineDebug()
{
if ($_GET['status'] == 'on') {
Common::debug('1', 'cookie');
setcookie('dagger_online_debug', '1', 0, '/', '.sina.com.cn', false, true);
Message::showSucc('设置online_debug成功');
} else {
Common::debug('', 'cookie');
setcookie('dagger_online_debug', '', 0, '/', '.sina.com.cn', false, true);
Message::showSucc('权限online_debug成功');
}
}
示例3: Lists
public function Lists()
{
$listDB = new AlarmListModelDB();
$messageDB = new AlarmMessageModelDB();
$userDB = new AlarmUserModelDB();
$sql = "SELECT `id` FROM `" . $userDB->getTableName() . "` WHERE `username` = ?";
$userId = $userDB->getFirst($sql, array($_GET['username']));
$whereArr = array();
$whereArr[] = $userId;
$_GET['first_id'] = intval($_GET['first_id']);
if (!empty($_GET['first_id'])) {
$whereStr = " AND `message_id` < ?";
//Question 这里应该是大于吧... todo
$whereArr[] = $_GET['first_id'];
}
$sql = "SELECT * FROM `" . $listDB->getTableName() . "` WHERE `user_id` = ?{$whereStr} AND `send_user` = 0 ORDER BY `id` DESC LIMIT 10";
$data = $listDB->getData($sql, $whereArr);
$data = Common::arrayOrderBy($data, 'id', 'ASC');
$messageIds = array();
foreach ($data as $key => $val) {
$messageIds[$val['message_id']] = $val['message_id'];
}
if (!empty($messageIds)) {
$sql = "SELECT * FROM `" . $messageDB->getTableName() . "` WHERE `id` IN ?";
$messageData = $messageDB->getData($sql, array($messageIds));
$messageFkData = array();
foreach ($messageData as $v) {
$messageFkData[$v['id']] = $v;
}
}
$showArr = array();
Common::debug($data);
foreach ($data as $k => $v) {
if (!empty($messageFkData[$v['message_id']]['message'])) {
$showArr[$k]['id'] = $v['message_id'];
if (preg_match_all("/http(s)?:\\/\\/([\\w-]+\\.)+[\\w-]+(\\/[\\w- .\\/?%&=]*)?/", $messageFkData[$v['message_id']]['message'], $match)) {
$showArr[$k]['link'] = $match[0][0];
} else {
$showArr[$k]['link'] = "";
}
$showArr[$k]['message'] = preg_replace("/http(s)?:\\/\\/([\\w-]+\\.)+[\\w-]+(\\/[\\w- .\\/?%&=]*)?/", "", $messageFkData[$v['message_id']]['message']);
$showArr[$k]['time'] = $messageFkData[$v['message_id']]['time'];
$showArr[$k]['level'] = $messageFkData[$v['message_id']]['level'];
$showArr[$k]['session'] = $messageFkData[$v['message_id']]['session'];
}
}
if (empty($showArr)) {
$showArr[0] = array("id" => "-1", "message" => "暂无更多消息...", "link" => "", "session" => "", "time" => (string) time(), "level" => '1');
}
Message::showSucc('succ', $showArr);
}
示例4: view
public function view()
{
$queueTaskLogDB = new QueueTaskLogModelDB();
//普通条件,检查GET参数
$whereStr = count($where) > 0 ? implode(" AND ", $where) : '1=1';
if (preg_match("/\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{1,2}/", $_GET['begin_time_start']) || preg_match("/\\d{4}-\\d{1,2}-\\d{1,2}\\s\\d{1,2}:\\d{1,2}/", $_GET['begin_time_end'])) {
$whereStr = $whereStr == '1=1' ? "`begin_time` > ? AND `begin_time` < ?" : $whereStr . " AND `begin_time` > ? AND `begin_time` < ?";
$whereArr[] = strtotime($_GET['begin_time_start']);
$whereArr[] = strtotime($_GET['begin_time_end']);
}
if (!empty($_GET['project_id'])) {
Common::debug('111');
$whereStr = $whereStr . " AND `project_id` = ?";
$whereArr[] = $_GET['project_id'];
}
if (is_numeric($_GET['status'])) {
$whereStr = $whereStr . " AND `status` = ?";
$whereArr[] = $_GET['status'];
}
if (!empty($_GET['task'])) {
$whereStr = $whereStr . " AND `task` LIKE ?";
$whereArr[] = "%" . $_GET['task'] . "%";
}
//排序条件
$orderStr = '`id` DESC';
if (!empty($_POST['order'])) {
foreach ($_POST['order'] as $k => $v) {
$orderArr[] = "`{$k}` {$v}";
}
$orderStr = implode(',', $orderArr);
}
//查询操作
$sql = "SELECT * FROM `" . $queueTaskLogDB->getTableName() . "` WHERE {$whereStr} ORDER BY {$orderStr}";
$data = $queueTaskLogDB->getData($sql, $whereArr, 40);
$pageStr = $queueTaskLogDB->getPageStr();
$pageJump = $queueTaskLogDB->getPageJump();
//读取外键数据
$projectFkArr = QueueTaskLogModel::getProject();
$this->setView('projectFkArr', $projectFkArr);
//模版显示
$this->setView('pageStr', $pageStr);
$this->setView('pageJump', $pageJump);
$this->setView('data', $data);
$this->display('QueueTaskLog.html');
}
示例5: sendSms
public function sendSms($project, $submodule, $message)
{
$messageSend = "{$project['name']}的{$submodule['name']}({$submodule['code']})错误";
$projectUids = Common::checkboxStrDecode($project['monitors']);
$submoduleUids = Common::checkboxStrDecode($submodule['monitors']);
$uids = array_merge($projectUids, $submoduleUids);
$monitorDB = new MonitorModelDB();
$monitorsPhone = $monitorDB->getData('SELECT phone FROM ' . $monitorDB->getTableName() . ' WHERE id in ?', array($uids));
$phone = array();
foreach ($monitorsPhone as $monitorPhone) {
$phone[] = $monitorPhone['phone'];
}
$str = 'user=general&password=nbaa8a2a1d5b981deacb8c1e2general&phone=' . urlencode(implode(',', $phone)) . '&msg=' . urlencode($messageSend) . '&level=' . urlencode($submodule['level']);
$ret = Http::get("http://202.108.35.62/serverguard/SendV2.php?{$str}");
Common::debug($ret);
if ($ret['error'] != 0) {
$ret = Http::get("http://202.108.43.183/serverguard/SendV2.php?{$str}");
}
Common::debug($ret, 'sms');
$warningMessageDB = new WarningMessageModelDB();
$warningMessageDB->insert(array('type' => 2, 'message' => "{$project['name']}的{$submodule['name']}({$submodule['code']})错误:{$message}", 'monitors' => Common::checkboxStrEncode($uids), 'create_time' => time()));
}
示例6: waterfall
public function waterfall()
{
$sid = intval($_GET['sub_mid']);
$pageId = max(intval($_GET['page']), 1);
$limit = 10;
$start = ($pageId - 1) * $limit;
$stop = $start + $limit;
$submoduleDB = new SubmoduleModelDB();
$submodule = $submoduleDB->getRow('SELECT mid, code FROM `' . $submoduleDB->getTableName() . '` WHERE id=?', array(intval($sid)));
$details = MyRedis::getSubmoduleDetail($submodule, $start, $stop);
Common::debug($details);
foreach ($details['messages'] as $key => $value) {
if ($tmp = unserialize($value)) {
$value = array_map('urldecode', array_map('htmlspecialchars', $tmp));
// $detail = date('[Y-m-d H:i:s] ', $time)."{$submodule['name']} 错误号:{$submodule['code']} 详细:{$message}, 邮件:第{$mailMsgCount}次,短信:第{$smsMsgCount}次,来自{$client_ip}/{$onlineip},xhprofId[{$xhprofId}]";
$details['messages'][$key] = date('[Y-m-d H:i:s] ', $value['time']) . "{$value['name']} 错误号:{$value['code']},脚本:{$value['script']},详细:{$value['message']},来自{$value['clientIp']}/{$value['serverIp']}";
} else {
$details['messages'][$key] = htmlspecialchars($value);
}
}
Message::showSucc('详细信息', $details['messages']);
}
示例7: view
public function view()
{
$key = isset($_GET['key']) ? $_GET['key'] : '';
$pageId = isset($_GET['page']) ? max(intval($_GET['page']), 1) : 1;
if (empty($key)) {
Message::showError('项目key不能为空');
}
$limit = 50;
$host = '172.16.53.68';
$port = 6381;
$rd = new Redis();
$rd->connect($host, $port);
$count = $rd->lsize($key);
$data = $rd->lRange($key, $limit * ($pageId - 1), $limit * $pageId);
$data = array_map('unserialize', $data);
Common::debug($data);
// $data = unserialize($data);
// Common::debug($data);exit;
$pageModel = new Page($count, $limit);
$this->setView('data', $data);
$this->setView('pageStr', $pageModel->getPageStr());
$this->display('XhprofLog.html');
}
示例8: debug
function debug($message)
{
Common::debug($message);
}
示例9: getDetail
public function getDetail()
{
$pid = intval($_GET['pid']);
if (!$pid) {
$projectDB = new ProjectModelDB();
$pid = $projectDB->getFirst('SELECT id FROM `' . $projectDB->getTableName() . '` WHERE name=?', array($_GET['pname']));
}
$pageId = max(intval($_GET['page']), 1);
$limit = 50;
$start = ($pageId - 1) * $limit;
$stop = $start + $limit;
$detail = MyRedis::getProjectDetail($pid, $start, $stop);
$data = array();
foreach ($detail['messages'] as $i => $v) {
if (($msg = @unserialize($v)) && is_array($msg)) {
$data[$i] = $msg;
} else {
$msg = explode(" ", $v);
$data[$i]['time'] = str_replace(array('[', ']'), '', array_shift($msg) . ' ' . array_shift($msg));
$data[$i]['name'] = array_shift($msg);
$data[$i]['code'] = str_replace(array("错误号:", '{', '}'), '', array_shift($msg));
$otherMsg = array_pop($msg);
$otherMsgArr = explode(",", $otherMsg);
if (count($otherMsgArr) == 4) {
$data[$i]['xhprofId'] = str_replace(array('xhprofId[', ']'), '', array_pop($otherMsgArr));
}
list($data[$i]['clientIp'], $data[$i]['serverIp']) = explode("/", str_replace(array("来自"), '', array_pop($otherMsgArr)));
$data[$i]['email'] = str_replace(array("短信:", '第', '次'), '', array_pop($otherMsgArr));
$data[$i]['sms'] = str_replace(array("邮件:", '第', '次'), '', array_pop($otherMsgArr));
$data[$i]['message'] = str_replace(array("详细:"), '', implode(" ", $msg));
}
}
Common::debug($data, 'Result');
$pageModel = new Page($detail['count'], $limit);
$this->setView('pageTitle', '详细信息');
$this->setView('data', $data);
$this->setView('pageStr', $pageModel->getPageStr());
$this->display('Detail.html');
}
示例10: action_article
//.........这里部分代码省略.........
$sql = "select a.id,a.aid,a.title,a.attrid,a.kindlist,a.webid,a.addtime,a.ishidden,a.themelist,a.iconlist,if(length(ifnull(a.attrid,''))=0,0,1) as order_attrid,if(length(ifnull(a.kindlist,''))=0,0,1) as order_kindlist,if(length(ifnull(a.iconlist,''))=0,0,1) as order_iconlist,if(length(ifnull(a.themelist,''))=0,0,1) as order_themelist,b.isjian,b.displayorder,b.isding,a.modtime,a.templet from sline_article as a left join sline_kindorderlist as b on (b.classid={$kindid} and a.id=b.aid and b.typeid=4) where {$w} {$order} limit {$start},{$limit}";
}
$totalcount_arr = DB::query(Database::SELECT, "select count(*) as num from sline_article a where {$w}")->execute()->as_array();
$list = DB::query(Database::SELECT, $sql)->execute()->as_array();
$new_list = array();
foreach ($list as $k => $v) {
$v['kindname'] = Model_Destinations::getKindnameList($v['kindlist']);
$v['attrname'] = Model_Article_Attr::getAttrnameList($v['attrid']);
$v['modtime'] = Common::myDate('Y-m-d', $v['modtime']);
$v['url'] = Common::getBaseUrl($v['webid']) . '/raiders/show_' . $v['aid'] . '.html';
$new_list[] = $v;
}
$result['total'] = $totalcount_arr[0]['num'];
$result['lists'] = $new_list;
$result['success'] = true;
echo json_encode($result);
} else {
if ($action == 'save') {
} else {
if ($action == 'delete') {
$rawdata = file_get_contents('php://input');
$data = json_decode($rawdata);
$id = $data->id;
if (is_numeric($id)) {
$model = ORM::factory('article', $id);
$model->deleteClear();
}
} else {
if ($action == 'update') {
$id = Arr::get($_POST, 'id');
$field = Arr::get($_POST, 'field');
$val = Arr::get($_POST, 'val');
$kindid = Arr::get($_POST, 'kindid');
if ($field == 'displayorder') {
$displayorder = empty($val) ? 9999 : $val;
if (is_numeric($id)) {
if (empty($kindid)) {
$order = ORM::factory('allorderlist');
$order_mod = $order->where("aid='{$id}' and typeid=4 and webid=0")->find();
if ($order_mod->id) {
$order_mod->displayorder = $displayorder;
} else {
$order_mod->displayorder = $displayorder;
$order_mod->aid = $id;
$order_mod->webid = 0;
$order_mod->typeid = 4;
}
$order_mod->save();
if ($order_mod->saved()) {
echo 'ok';
} else {
echo 'no';
}
} else {
Common::debug('here');
$kindorder = ORM::factory('kindorderlist');
$kindorder_mod = $kindorder->where("aid='{$id}' and typeid=4 and classid={$kindid}")->find();
if ($kindorder_mod->id) {
$kindorder_mod->displayorder = $displayorder;
} else {
$kindorder_mod->displayorder = $displayorder;
$kindorder_mod->aid = $id;
$kindorder_mod->classid = $kindid;
$kindorder_mod->typeid = 4;
}
$kindorder_mod->save();
if ($kindorder->saved()) {
echo 'ok';
} else {
echo 'no';
}
}
}
} else {
if (is_numeric($id)) {
$model = ORM::factory('article', $id);
}
if ($model->id) {
$model->{$field} = $val;
if ($field == 'kindlist') {
$model->{$field} = implode(',', Model_Destinations::getParentsStr($val));
} else {
if ($field == 'attrid') {
$model->{$field} = implode(',', Model_Attrlist::getParentsStr($val, 4));
}
}
$model->save();
if ($model->saved()) {
echo 'ok';
} else {
echo 'no';
}
}
}
}
}
}
}
}
}
示例11: uploadImageFile
/**
* updload image files
*/
private function uploadImageFile($key, $fileName)
{
if (($_FILES['image']["type"][$key] == "image/jpeg" || $_FILES["image"]["type"][$key] == "image/pjpeg") && $_FILES["image"]["size"][$key] < 2 * 1024 * 1024 * 1204) {
if (is_array($_FILES["image"]["error"]) && $_FILES["image"]["error"][$key] > 0) {
Message::showError("Return Code: " . $_FILES["image"]["error"][$key]);
} else {
if (!is_array($_FILES["image"]["error"]) && $_FILES["image"]["error"] > 0) {
Message::showError("Return Code: " . $_FILES["image"]["error"]);
} else {
$i = 0;
while (1) {
$i++;
Common::debug(DAGGER_PATH_ROOT . "images/" . $fileName . '.jpg');
if (file_exists(DAGGER_PATH_ROOT . "images/" . $fileName . '.jpg')) {
Common::debug(DAGGER_PATH_ROOT . "images/" . $fileName . '.jpg' . " already exists. ");
$fileName = $fileName . '_' . $i;
} else {
$fileName .= '.jpg';
move_uploaded_file($_FILES["image"]["tmp_name"][$key], DAGGER_PATH_ROOT . "images/" . $fileName);
break;
}
}
}
}
return $fileName;
} else {
Message::showError("Invalid file");
}
}