本文整理匯總了PHP中Doo::logger方法的典型用法代碼示例。如果您正苦於以下問題:PHP Doo::logger方法的具體用法?PHP Doo::logger怎麽用?PHP Doo::logger使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Doo
的用法示例。
在下文中一共展示了Doo::logger方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: execute
/**
* db 處理統一接口
*/
public function execute($sql = '', $type = 's')
{
$res['status'] = 1;
$dbRes = false;
switch ($type) {
//select
case 's':
$dbRes = mysqli_query($this->conn, $sql);
$data = $this->fetch_all_result($dbRes, 1);
$res['data'] = $data[0];
break;
//insert
//insert
case 'i':
$dbRes = mysqli_query($this->conn, $sql);
$res['id'] = mysqli_insert_id($this->conn);
break;
//update
//update
case 'u':
$dbRes = mysqli_query($this->conn, $sql);
break;
//delete
//delete
case 'd':
$dbRes = mysqli_query($this->conn, $sql);
break;
default:
# code...
break;
}
if ($dbRes == true) {
$res['status'] = 0;
}
Doo::logger()->info('time:' . date("Y-m-d H:i:s", time()) . "\tip:" . getIP() . "\tsql:" . $sql . "\t" . var_export($res['status'], true), 'DB');
return $res;
}
示例2: get_new_movie_by_category
function get_new_movie_by_category($cat, $search = "", $start = 0, $limit = 20)
{
$cache_name = 'get_new_movie_by_category_' . $cat . $search;
$qsearch = "";
if ($search) {
$qsearch = " AND ( ov.vod_name like '{$search}%' OR ov.vod_name like '%{$search}%' OR ov.vod_name like '%{$search}' ) ";
}
/* $query = "SELECT *
FROM tv_category_item tci
LEFT JOIN tv_program tp ON (tci.content_code = tp.code)
LEFT JOIN tv_video tv ON (tci.content_code = tv.content_code)
WHERE tci.category_code = '{$cat}' AND tci.visible_status = 0 {$qsearch} ORDER BY tci.insert_time DESC"; */
$query = "SELECT ov.*, ovrc.*, ovc.*, ov.id as vod_id FROM {$this->db_ottmobile}.ott_vod ov \n\t\t\t\t INNER JOIN {$this->db_ottmobile}.ott_vod_relation_category ovrc ON (ov.id = ovrc.vod_id)\n\t\t\t\t INNER JOIN {$this->db_ottmobile}.ott_vod_category ovc ON (ovrc.vod_category_id = ovc.id )\n\t\t\t\t WHERE ovc.vod_category_code ='{$cat}' and ovc.vod_category_status='publish' and ov.vod_status='publish' GROUP BY ov.id ORDER BY episode_group asc, vod_name asc\n\t\t\t\t LIMIT {$start}, {$limit}";
//echo $query;
try {
//$rs = $this->cache->get($cache_name);
//if(!$rs || $this->clearcache){
$rs = $this->dbMobile()->fetchAll($query);
// $this->cache->set($cache_name,$rs,$this->cache_time);
//}
} catch (Exception $e) {
Doo::logger()->alert($e);
Doo::logger()->writeLogs("log" + date('Y-m-d') + ".txt", false);
}
return $rs;
}
示例3: getRegion
function getRegion()
{
$query = "SELECT region_code, region FROM ott_geoip_region WHERE country_code ='ID'";
try {
$rs = $this->dbMobile()->fetchAll($query);
} catch (Exception $e) {
Doo::logger()->alert($e);
Doo::logger()->writeLogs("log" + date('Y-m-d') + ".txt", false);
}
return $rs;
}
示例4: date
include '../protected/config/common.conf.php';
include '../protected/config/routes.default.conf.php';
include '../protected/config/db.default.conf.php';
include '../protected/config/timezone.conf.php';
include '../protected/config/area.conf.php';
include '../protected/module/default/class/func.php';
// 舊方法庫
#Just include this for production mode
//include $config['BASE_PATH'].'deployment/deploy.php';
include $config['BASE_PATH'] . 'Doo.php';
include $config['BASE_PATH'] . 'app/DooConfig.php';
# Uncomment for auto loading the framework classes.
//spl_autoload_register('Doo::autoload');
Doo::conf()->set($config);
# remove this if you wish to see the normal PHP error view.
include $config['BASE_PATH'] . 'diagnostic/debug.php';
# database usage
//Doo::useDbReplicate(); #for db replication master-slave usage
//Doo::db()->setMap($dbmap);
Doo::conf()->add('dbconfig', $dbconfig);
Doo::loadClassAt('DBproxy', 'default');
// Doo::db()->setDb($dbconfig, $config['APP_MODE']);
// Doo::db()->sql_tracking = true; #for debugging/profiling purpose
Doo::app()->route = $route;
# Uncomment for DB profiling
//Doo::logger()->beginDbProfile('doowebsite');
Doo::app()->run();
//Doo::logger()->endDbProfile('doowebsite');
Doo::logger()->rotateFile(102400);
Doo::logger()->writeLogs('framework/' . date('Ym') . '/' . date('d') . '.log', false);
示例5: get_spincard
function get_spincard($fld = '', $whered = '', $startd = '', $limitd = '')
{
$cache_name = "get_spincard_{$fld}_{$whered}_{$startd}_{$limitd}";
$rs = false;
$where = '';
$fields = "*";
$limit = '';
$order = '';
$start = 0;
if ($startd) {
$start = $startd;
}
if ($fld) {
$fields = $fld;
}
if ($whered) {
$where = " WHERE {$whered} ";
}
if ($limitd) {
$limit = " LIMIT {$start},{$limitd} ";
}
$query = "SELECT SQL_CALC_FOUND_ROWS {$fields} FROM ott_spincard_used {$where} GROUP BY spincard ORDER BY created desc {$limit} ";
/* echo $query; */
try {
//$rs = $this->cache->get($cache_name);
//if(!$rs || $this->clearcache){
$rs = $this->dbAAA2()->fetchAll($query);
// $this->cache->set($cache_name,$rs,$this->cache_time);
//}
} catch (Exception $e) {
Doo::logger()->alert($e);
Doo::logger()->writeLogs("log" + date('Y-m-d') + ".txt", false);
}
return $rs;
}
示例6: orderPrintPaySUCCESS
private function orderPrintPaySUCCESS($orderid = 0)
{
// $params['orderid'] = '12413237022015092911210327222';
$params['orderid'] = $orderid;
$params['pagesize'] = $this->getCurPage() . ',' . Doo::conf()->pagesize;
//驗證此訂單是本人的,店長打印則跳開
if ($this->shopMaster() == false) {
$params['uid'] = $_SESSION['uid'];
}
if (!isset($params['orderid']) || trim($params['orderid']) == '') {
$this->alert('data null2');
exit;
}
$order = DBproxy::getProcedure('Manage')->setDimension(2)->getOrder($params);
if ($order['total'] < '1') {
$this->alert('data null2');
exit;
}
//打印處理
if ($order['data'][$params['orderid']]['0']['printStatus'] > 0 && $this->shopMaster() == false) {
$this->alert('已經打印過了');
exit;
}
//訂單的狀態是否能打印,在微信接口驗證
$orderStatus = $this->queryOrder($params['orderid'], $order['data'][$params['orderid']][0]['status']);
if ($orderStatus != 'SUCCESS') {
$this->alert('未支付成功,order status err ');
exit;
}
//D($order['data'][$params['orderid']]);
foreach ($order['data'][$params['orderid']] as $key => $value) {
$title[] = $value['title'] . ' ' . $value['wxprice'] . ' (' . $value['sum'] . ')';
}
$msgNo = time() + rand(1, 9999);
/*
自由格式的打印內容
*/
if ($order['data'][$params['orderid']]['0']['waimai'] == '1') {
$waimai = '外賣單 ';
$sb = ' ******';
$addr = "\r\n" . '送貨地址:' . $order['data'][$params['orderid']]['0']['addr'] . "\r\n";
} else {
$waimai = '堂食單';
$addr = '';
$sb = '';
}
$freeMessage = array('memberCode' => MEMBER_CODE, 'msgDetail' => '
微微樂餐飲歡迎您訂購
' . $waimai . ': 序號:' . $order['data'][$params['orderid']]['0']['oid'] . $sb . '
條目 單價(元) 數量
-----------------
' . implode("\r\n", $title) . '
-----------------
合計:' . $order['data'][$params['orderid']]['0']['allPrice'] . '元
店名:' . $order['data'][$params['orderid']]['0']['shopname'] . $addr . '
聯係電話:' . $order['data'][$params['orderid']]['0']['phone'] . '
訂購時間:' . date('Y-m-d H:i:s', $order['data'][$params['orderid']]['0']['addtime']) . '
', 'deviceNo' => DEVICE_NO, 'msgNo' => $msgNo);
$order = DBproxy::getProcedure('Manage')->setDimension(2)->upOrderPrint($order['data'][$params['orderid']]['0']['oid']);
$printStatus = $this->sendFreeMessage($freeMessage);
Doo::logger()->info('time:' . date("Y-m-d H:i:s", time()) . "\tip:" . getIP() . "\tprintStatus:" . $printStatus, 'print');
if ($printStatus == 0) {
echo '打印請求/任務中隊列中,等待打印';
$order = DBproxy::getProcedure('Manage')->setDimension(2)->upOrderPrint($order['data'][$params['orderid']]['0']['oid']);
} elseif ($printStatus == 1) {
echo '打印任務已完成/請求數據已打印';
$order = DBproxy::getProcedure('Manage')->setDimension(2)->upOrderPrint($order['data'][$params['orderid']]['0']['oid']);
} elseif ($printStatus == 2) {
echo '打印任務/請求失敗';
} else {
echo $printStatus;
}
return $msgNo;
}
示例7: afterRun
/**
* 後置控製器
* @param [type] $routeResult [description]
* @return [type] [description]
*/
public function afterRun($routeResult)
{
parent::afterRun($routeResult);
switch ($this->_action) {
case 'add':
case 'del':
case 'mod':
Doo::logger()->info(' ip:' . getIP() . ' user:' . $this->_opname, $this->_action);
break;
default:
Doo::logger()->info(' ip:' . getIP() . ' user:' . $this->_opname);
break;
}
}
示例8: destroy
public function destroy()
{
try {
//init model
Doo::db()->beginTransaction();
$m = new $this->model();
//set id
$m->id = $this->params['id'];
//delete
$m->delete();
//commit
Doo::db()->commit();
$this->res->success = true;
$this->res->data = $id;
} catch (Exception $e) {
Doo::db()->rollBack();
$this->res->success = false;
$this->res->message .= "Unable to Delete! ";
$this->res->data = mySQLExceptions::parse($e->getMessage());
Doo::logger()->err("DB Delete Error! " . $e->getMessage(), 'db');
}
}
示例9:
<?php
require_once 'version.php';
include './protected/config/common.conf.php';
include './protected/config/routes.conf.php';
include './protected/config/db.conf.php';
#Just include this for production mode
//include $config['BASE_PATH'].'deployment/deploy.php';
include $config['BASE_PATH'] . 'Doo.php';
include $config['BASE_PATH'] . 'app/DooConfig.php';
# Uncomment for auto loading the framework classes.
//spl_autoload_register('Doo::autoload');
//var_dump($config); exit;
Doo::conf()->set($config);
# remove this if you wish to see the normal PHP error view.
//include $config['BASE_PATH'].'diagnostic/debug.php';
# database usage
//Doo::useDbReplicate(); #for db replication master-slave usage
//Doo::db()->setMap($dbmap);
Doo::db()->setDb($dbconfig, $config['APP_MODE']);
Doo::db()->sql_tracking = true;
#for debugging/profiling purpose
Doo::app()->route = $route;
# Uncomment for DB profiling
Doo::logger()->beginDbProfile('doowebsite');
Doo::app()->run();
Doo::logger()->endDbProfile('doowebsite');
Doo::logger()->rotateFile(20);
echo Doo::logger()->writeDbProfiles();
//Doo::logger()->trace('message...');
//echo Doo::logger()->showLogs();