本文整理汇总了PHP中addLog函数的典型用法代码示例。如果您正苦于以下问题:PHP addLog函数的具体用法?PHP addLog怎么用?PHP addLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addLog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: query
/**
* 广告分页查询
* position广告位置
* pageNo页码
* pageSize 显示个数
*/
public function query()
{
$notes = "应用" . $this->client_id . ",调用Banners分页查询接口";
addLog("Banners/query", $_GET, $_POST, $notes);
$arr = array('app_index' => 6007, 'app_finance' => 6008, 'app_carousel' => 6009, 'app_life' => 6010);
$position = $this->_post('position', '', "位置参数必须");
if (!isset($arr[$position])) {
$this->apiReturnErr("不支持的位置参数!");
}
$position = $arr[$position];
$curpage = $this->_post('curpage', 0);
$pagesize = $this->_post('pagesize', 10);
$map = array('position' => $position);
$order = " sort asc ";
$page = array('curpage' => $curpage, 'size' => $pagesize);
//分页
$result = apiCall(BannersApi::QUERY, array($map, $page, $order));
if ($result['status']) {
$list = $result['info']['list'];
$list = $this->convertImgUrl($list);
$this->apiReturnSuc($list);
} else {
$this->apiReturnErr("没有相关数据!");
}
}
示例2: index
public function index()
{
addLog("Token/index", $_GET, $_POST, "");
$grant_type = I('get.grant_type', '');
if (empty($grant_type)) {
$grant_type = I('post.grant_type', '');
}
if (empty($grant_type)) {
$this->apiReturnSuc("无效的Token获取类型!");
}
$client_id = I('get.client_id', '');
if (empty($client_id)) {
$client_id = I('post.client_id', '');
}
$client_secret = I('get.client_secret', '');
if (empty($client_secret)) {
$client_secret = I('post.client_secret', '');
}
if (empty($client_id) || empty($grant_type) || empty($client_secret)) {
$this->ajaxReturn(array('code' => -1, 'data' => $grant_type . "参数缺失!" . $client_id), "json");
}
$notes = $client_id . "调用接口";
$_POST['grant_type'] = $grant_type;
$_POST['client_id'] = $client_id;
$_POST['client_secret'] = $client_secret;
unset($_GET['client_id']);
unset($_GET['client_secret']);
unset($_GET['grant_type']);
addLog("Token/index", $_GET, $_POST, "");
$this->credentials($grant_type);
}
示例3: startProcess
function startProcess($db)
{
$businessComfirmUrl = Yii::app()->params['orderUrl'] . "update/order/business-confirm-order";
$time = time();
$formatTime = date('Y-m-d H:i:s', $time);
try {
//查找订单
$payTime = $time - 1800;
$sql = "SELECT b.business_id,o.order_sn from " . get_tables('business_info') . " as b left join " . get_tables('order_info') . " as o on b.business_id=o.business_id WHERE b.express_type in (2, 11, 12) and o.order_status=1 and o.express_type > 0 and o.pay_time <= " . $payTime . " LIMIT 100";
$data = $db->createCommand($sql)->queryAll();
if (!empty($data)) {
foreach ($data as $k => $v) {
$post = ['business_id' => $v['business_id'], 'order_sn' => $v['order_sn'], 'user_id' => 1, 'user_name' => 'jiaoben', 'source' => 'autoStockUp'];
$return = curlPost($businessComfirmUrl, $post);
if ($return['code'] != 0) {
addLog("data:" . json_encode($return, JSON_UNESCAPED_UNICODE) . '|time:' . $formatTime);
echo $v['order_sn'] . ":fail" . "\r\n";
} else {
echo $v['order_sn'] . ":success" . "\r\n";
}
}
echo "data update:" . count($data) . "\r\n";
} else {
echo "no data \r\n";
}
echo 'finish';
} catch (Exception $e) {
$msg = "filename:autoStockUp|functionname:start_process|error:" . $e->getMessage() . "|time:" . $formatTime;
echo $msg . "\r\n";
addLog($msg);
}
}
示例4: hook_level_up
function hook_level_up($db, &$tpl, $player, $args = 0)
{
//No player data
if ($args === 0 || LOGGED_IN == false) {
return $args;
}
//Check if player has leveled up
if ($args->exp >= $args->max_exp) {
//Update the current player variable ($args)
$args->exp = $args->exp - $args->max_exp;
$args->level += 1;
$args->stat_points += 2;
$args->max_exp += 20;
$args->max_energy += 1;
$args->energy += 1;
$args->hp += 5;
$args->max_hp += 5;
//Update the database
$db->execute('UPDATE `<ezrpg>players` SET `exp`=?, `level`=level+1, `stat_points`=stat_points+2, `max_exp`=max_exp+20, `energy`=energy+1, `max_energy`=max_energy+1, `hp`=hp+5, `max_hp`=max_hp+5 WHERE `id`=?', array(intval($args->exp), intval($args->id)));
//Add event log
$msg = 'You have leveled up! You gained +2 stat points and +1 max energy!';
addLog(intval($args->id), $msg, $db);
}
return $args;
}
示例5: updatePrevisionStateWithDeliveryType
function updatePrevisionStateWithDeliveryType($deliveryType)
{
global $country;
$resultInfo = array();
$clothIds = "";
$query = "SELECT distinct(pc.clothId) as id, c.name, p.orderNumber\n\t\t\t\t\t\tFROM previsions p\n\t\t\t\t\t\tJOIN previsioncloth pc on p.id=pc.previsionId\n\t\t\t\t\t\tLEFT JOIN plotters pl on pl.previsionId = p.id\n\t\t\t\t\t\tJOIN cloths c on c.id=pc.clothId\n\t\t\t\t\t\twhere (p.designed=false or (p.designed=true and pl.id is not null))\n\t\t\t\t\t\tand (pl.cutted is null or pl.cutted=false)\n\t\t\t\t\t\tand p.state = '{$deliveryType}'\n\t\t\t\t\t\tand p.country = '{$country}'\n\t\t\t\t\t\torder by p.orderNumber, p.id, pc.clothId";
$result = mysql_query($query);
foreach (fetch_array($result) as $cloth) {
$clothResult = new stdClass();
$res = updatePrevisionState($cloth['id']);
$clothResult->countModified = count($res->modifiedPrevisions);
$clothResult->clothId = $cloth['id'];
$clothResult->clothName = $cloth['name'];
$clothResult->orderNumber = $cloth['orderNumber'];
$clothIds .= $cloth['id'] . " / " . $cloth['orderNumber'] . ", ";
array_push($resultInfo, $clothResult);
}
$obj->successful = true;
$obj->method = "updatePrevisionStateWithDeliveryType({$deliveryType})";
$obj->resultInfo = $resultInfo;
// log manual action of previ state update
$log->type = "info.updatePrevisionStateWithDeliveryType({$deliveryType})";
$log->log = $clothIds;
//implode(" == ", $resultInfo);
$log->user = 'admin';
addLog($log);
return $obj;
}
示例6: login
/**
* 登录接口
* @param string $username 用户名
* @param string $password 用户密码
* @param int|string $type 用户名类型 (1-用户名,2-邮箱,3-手机,4-UID)
* @param string $from
* @return int 登录成功-用户ID,登录失败-错误编号
*/
public function login($username, $password, $type = '1', $from = '')
{
$result = apiCall(UserApi::LOGIN, array($username, $password, $type));
$notes = "[用户" . $username . ",类型:" . $type . "],调用登录接口";
addLog("/Account/login", "", "", $notes);
return $result;
}
示例7: products
/**
* 产品
*/
public function products()
{
$request = new SFProduct();
$carrier = 0;
$result = $request->getProductList(1, 20, $carrier);
if (!$result['status']) {
addLog("products", $result, $_POST, "[getProductList]");
$this->error($result['info']);
}
$prodList = $result['info']['prodList'];
$resultCode = $result['info']['resultCode'];
$resultReason = $result['info']['resultReason'];
if ($resultCode == '1000') {
$this->assign('prod_list', $prodList);
} else {
addLog("products", $resultReason, $resultReason, "[getProductList result]");
$this->error($resultReason);
}
$request = new SFOrder();
$result = $request->queryBalance();
if ($result['status']) {
$this->assign('channel', $result['info']);
}
$this->assign("appkey", $request->getAppKey());
$this->display();
}
示例8: index
/**
* 流量购回调地址
*/
public function index()
{
/*
* {"channelOrderNo":"158581990641014538769441118","extraData":"",
* "orderNo":"1453876701223039",
* "orderStatus":"4","providerResultCode":"1",
* "providerResultReason":"\u8ba2\u8d2d\u6210\u529f",
* "resultCode":"1000","resultMessage":"\u6210\u529f",
* "sign":"8194b64649a34e8619a74c76c5ef436e"}*/
addLog("Santi/callback", $_GET, $_POST, '[调试]三体回调地址');
// exit;
$order_no = $this->_get('orderNo', '', '缺失orderNo参数');
$order_status = $this->_get('orderStatus', '');
$channel_order_no = $this->_get('channelOrderNo', '');
$result_code = $this->_get('resultCode', '');
$result_message = $this->_get('resultMessage', '');
$provider_result_code = $this->_get('providerResultCode', '');
$provider_result_reason = $this->_get('providerResultReason', '');
$extraData = $this->_get('extraData', '');
$sign = $this->_get('sign', '', '缺失sign参数');
$entity = array('order_no' => $order_no, 'order_status' => $order_status, 'channel_order_no' => $channel_order_no, 'result_code' => $result_code, 'result_message' => $result_message, 'provider_result_code' => $provider_result_code, 'provider_result_reason' => $provider_result_reason, 'extra_data' => $extraData, 'sign' => $sign, 'create_time' => time());
$update_entity = array('order_status' => $order_status);
$result = apiCall(SantiCallbackApi::ADD, array($entity));
$result = apiCall(SantiOrderApi::SAVE, array(array('order_no' => $order_no), $update_entity));
if ($result['status']) {
echo "SUCCESS";
} else {
echo "FAIL";
}
}
示例9: run
public function run($route)
{
global $routes;
//Si la route n'est pas dans le tableau des routes - on en déduit qu'il s'agit d'une route à argument
if (!in_array($route, $routes)) {
$potentialRoute = [];
$nbParamRoute = count(explode("/", $route)) - 1;
//On vérifie les routes qui contiennent le même nombre de paramètre que la route récupérée
foreach ($routes as $routeList => $controller) {
$nb = count(explode("/", $routeList)) - 1;
if ($nb === $nbParamRoute) {
$potentialRoute[$routeList] = $controller;
}
}
//On vérifie si les routes potentielles ont les mêmes données hors arguments, si non, non valable
foreach ($potentialRoute as $routeString => $controller) {
$routeExpl = explode("/", $route);
$potExpl = explode("/", $routeString);
foreach ($routeExpl as $key => $value) {
if ($value !== $potExpl[$key] && strpos($potExpl[$key], "{") === FALSE) {
unset($potentialRoute[$routeString]);
}
}
}
$road = array_keys($potentialRoute)[0];
$ArgRoad = explode("/", $road);
$nbArgRoad = 0;
foreach ($ArgRoad as $item) {
if (strpos($item, "{") === FALSE && !empty($item)) {
$nbArgRoad++;
}
}
$ArgRoute = explode("/", $route);
$route = $road;
$args = [];
for ($i = $nbArgRoad + 1; $i < count($ArgRoute); $i++) {
$args[str_replace(["{", "}"], "", $ArgRoad[$i])] = $ArgRoute[$i];
}
}
if (!empty($routes[$route])) {
$parts = explode(':', $routes[$route]);
$controller_name = $parts[0] . 'Controller';
addLog($route);
require_once '../src/controller/' . $controller_name . '.php';
$controller = new $controller_name();
if (!empty($args)) {
return $controller->{$parts}[1]($args);
} else {
return $controller->{$parts}[1]();
}
} else {
addErrorLog("No route for :" . $route, __FILE__);
header("HTTP/1.0 404 Not Found");
require_once "../web/error/404.php";
throw new Exception('No route for : ' . $route);
}
}
示例10: desactive_mach_serv
function desactive_mach_serv($list_id, $packid)
{
global $l;
$id_pack = found_id_pack_serv($packid);
$sql_desactive = "delete from devices where hardware_id in ";
$arg_desactive = mysql2_prepare($sql_desactive, array(), $list_id);
$arg_desactive = mysql2_prepare($arg_desactive['SQL'] . " and name='DOWNLOAD' and IVALUE in ", $arg_desactive['ARG'], $id_pack);
$res_active = mysql2_query_secure($arg_desactive['SQL'], $_SESSION['OCS']["writeServer"], $arg_desactive['ARG']);
addLog($l->g(512), $l->g(876) . $packid . " => " . $list_id);
}
示例11: setUp
function setUp()
{
addLog("\n\n====== Testcase: " . $this->getName() . " ======\n\n");
if (self::$skipAll) {
$this->markTestSkipped('Skip all as critical case fails.');
}
if (self::$isIT && self::$skipIT) {
$this->markTestSkipped('Skip scenario test as sanity case fails.');
}
}
示例12: queryNoPaging
/**
* 查看收货地址
*/
public function queryNoPaging()
{
$notes = "应用" . $this->client_id . ",调用Address查询接口";
addLog("Address/add", $_GET, $_POST, $notes);
$map = array('uid' => I('uid'));
$result = apiCall(AddressApi::QUERY_NO_PAGING, array($map));
if ($result['status']) {
$this->apiReturnSuc($result['info']);
} else {
$this->apiReturnErr("查询失败");
}
}
示例13: app
public function app()
{
$notes = "客户端" . $this->client_id . ",调用APP配置查询接口";
addLog("Config/app", $_GET, $_POST, $notes);
$group = 6;
//6是接口参数
$result = apiCall(ConfigApi::QUERY_NO_PAGING, array(array('group' => $group)));
if (!$result['status']) {
$this->apiReturnErr($result['info']);
}
$this->apiReturnSuc($this->simpleResult($result['info']));
}
示例14: query
/**
* 广告分页查询
* position广告位置
* pageNo页码
* pageSize 显示个数
*/
public function query()
{
$notes = "应用" . $this->client_id . ",调用Banners分页查询接口";
addLog("Banners/query", $_GET, $_POST, $notes);
$postion = I('position', 18);
$map = array('position' => $postion);
$page = array('curpage' => I('pageNo', 0), 'size' => I('pageSize', 10));
//分页
$result = apiCall(BannersApi::QUERY, array($map, $page));
if ($result['status']) {
$this->apiReturnSuc($result['info']['list']);
} else {
$this->apiReturnErr("暂无广告");
}
}
示例15: queryNoPaging
/**
* 不分页查询
* parentId 父项ID
*/
public function queryNoPaging()
{
$notes = "应用" . $this->client_id . ",调用数据字典不分页查询接口";
addLog("Datatree/queryNoPaging", $_GET, $_POST, $notes);
$parentId = I('parentId', 0);
if ($parentId == 0) {
$this->apiReturnErr("父类ID不能为0或空");
}
$map = array('parentId' => $parentId);
$result = apiCall(DatatreeApi::QUERY_NO_PAGING, array($map));
if ($result['status']) {
$this->apiReturnSuc($result['info']);
} else {
$this->apiReturnErr("暂无信息");
}
}