當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Logs::factory方法代碼示例

本文整理匯總了PHP中Logs::factory方法的典型用法代碼示例。如果您正苦於以下問題:PHP Logs::factory方法的具體用法?PHP Logs::factory怎麽用?PHP Logs::factory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Logs的用法示例。


在下文中一共展示了Logs::factory方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

        Lib_Mobile::jsonRet($ret, 0);
    }
    $userInfo['isFirst'] = 1;
    //用戶注冊上報
    DCDATA && @Data_Dcdata::factory($api)->sendNewLog('user_signup', array('uid' => $userInfo['mid'], 'platform_uid' => $userInfo['sitemid'], 'signup_at' => time(), 'ip' => Helper::getip(), 'entrance_id' => $sid, 'version_info' => $version, 'm_imei' => $imei));
}
if ($userInfo['mstatus'] == 1) {
    $ret['code'] = '-10';
    $ret['noAllowLogin'] = 1;
    $ret['msg'] = Core_Loginerror::$forbidden;
    Lib_Mobile::jsonRet($ret, 0);
}
//用戶登陸上報
DCDATA && @Data_Dcdata::factory($api)->sendNewLog('user_login', array('uid' => $userInfo['mid'], 'platform_uid' => $userInfo['sitemid'], 'login_at' => time(), 'ip' => Helper::getip(), 'entrance_id' => $sid, 'version_info' => $version, 'user_gamecoins' => $userInfo['money'], 'm_imei' => $imei));
if (empty($param['imei'])) {
    Logs::factory()->debugNew("imei", $param);
}
//渠道推廣上報
if (DCHANNEL) {
    if ($appid && $appKey && $mobid) {
        $aData = array('appid' => $appid, 'appkey' => $appKey, 'mobid' => $mobid, 'userid' => $userInfo['mid'], 'ip' => Helper::getip(), 'isFirst' => $userInfo['isFirst'] ? 1 : 0);
        $sData = json_encode($aData);
        Data_Cache::redisChannel()->lPush(Data_Keys::$channelKey, $sData);
        Data_Cache::redisChannel()->set(Data_Keys::$channelPerKey . $userInfo['mid'], json_encode(array('appid' => $appid, 'appkey' => $appKey, 'mobid' => $mobid)));
        //保存用戶登陸的appid和key
        Data_Cache::redisChannel()->setTimeout(Data_Keys::$channelPerKey . $userInfo['mid'], 3600);
    }
}
Mobile_Member::factory()->loginBid($userInfo['mid'], $api);
$userInfo['result'] = 1;
$userInfo['loginType'] = 3;
開發者ID:hamily,項目名稱:sblack,代碼行數:31,代碼來源:androidGuestbak.php

示例2: setAccessTokenn

 /**
  * 設置access_token
  * @author functions
  * @param unknown_type $secret
  * @return unknown
  */
 public function setAccessTokenn($secret)
 {
     try {
         $result = $this->setAccessToken($secret);
         return true;
     } catch (FacebookApiException $e) {
         Logs::factory()->debug('email/emailerror', $e);
         return false;
     }
 }
開發者ID:hamily,項目名稱:sblack,代碼行數:16,代碼來源:facebook.api.php

示例3: update

 /**
  * 更新用戶資料 js取了之後發過來
  * @param $aInfo array()
  */
 public function update($aInfo)
 {
     $flag = 0;
     if (empty($aInfo)) {
         return false;
     }
     $sitemid = $aInfo['id'] ? $aInfo['id'] : $aInfo['sitemid'];
     if (!$sitemid) {
         return $flag;
     }
     $time = time();
     $sid = $aInfo['sid'] ? $aInfo['sid'] : PLATFORM_ID;
     if ($aInfo['mid']) {
         $userinfo = $this->getOneById($aInfo['mid'], false);
     } else {
         $userinfo = $this->getOneBySitemid($sitemid, $sid, false);
     }
     $mid = $userinfo['mid'];
     Logs::factory()->debug('updateuser', $aInfo['sex']);
     $sex = $userinfo['sex'] = Core_Member::factory()->getGender($aInfo['sex']);
     Logs::factory()->debug('updateuser', $sex);
     $unid = $userinfo['unid'] = Helper::uint($aInfo['unid']);
     //子站ID
     $mnick = $userinfo['mnick'] = Loader_Mysql::dbmaster()->escape($aInfo['name']);
     //用戶別名
     $name = $userinfo['name'] = Loader_Mysql::dbmaster()->escape($aInfo['username']);
     //用戶姓名
     $icon = $userinfo['icon'] = Loader_Mysql::dbmaster()->escape($aInfo['icon']);
     //小頭像
     $middle = $userinfo['middle'] = Loader_Mysql::dbmaster()->escape($aInfo['middle']);
     //中頭像
     $big = $userinfo['big'] = Loader_Mysql::dbmaster()->escape($aInfo['big']);
     //大頭像
     $location = isset($userInfo['location']['name']) ? $userInfo['location']['name'] : $userInfo['location'];
     $userDetail['location'] = iconv('GB2312', 'UTF-8', $location);
     $hometown = isset($userInfo['hometown']['name']) ? $userInfo['hometown']['name'] : $userInfo['hometown'];
     $userDetail['hometown'] = iconv('GB2312', 'UTF-8', $hometown);
     $email = Loader_Mysql::dbmaster()->escape($aInfo['email']);
     //郵件地址
     $locale = Core_Member::factory()->getLocale($aInfo['locale']);
     $tmpprofile = empty($aInfo['link']) ? "https://www.facebook.com/profile.php?id=" . $sitemid : Loader_Mysql::dbmaster()->escape($aInfo['link']);
     $profile = $userinfo['profile'] = $tmpprofile;
     //添加用戶email信息
     if (!empty($email)) {
         $sql = "INSERT DELAYED INTO {$this->membermail} SET mid={$mid},email='{$email}',mactivetime={$time} ON DUPLICATE KEY UPDATE email='{$email}',mactivetime={$time}";
         Loader_Mysql::dbmaster()->query($sql);
     }
     //更新members表
     $sql = "UPDATE LOW_PRIORITY {$this->members} SET mnick='{$mnick}',name='{$mnick}' WHERE mid={$mid} LIMIT 1";
     Loader_Mysql::dbmaster()->query($sql);
     //更新memberfield表
     $sql = "UPDATE LOW_PRIORITY {$this->memberfield} SET sex={$sex},location='{$location}',hometown='{$hometown}',muchid={$locale} WHERE mid={$mid} LIMIT 1";
     Logs::factory()->debug('updateuser', $sql);
     Loader_Mysql::dbmaster()->query($sql);
     //更新cache
     $cacheKey = Core_Keys::getOneById($mid);
     $flag = Loader_Memcached::minfo($mid)->set($cacheKey, Values::combine(Values::getmb(), $userinfo), 10 * 24 * 3600);
     return $flag;
 }
開發者ID:hamily,項目名稱:sblack,代碼行數:63,代碼來源:member.php

示例4: resetLogin

 /**
  * [resetLogin 令牌過期,重新登錄,生成令牌]
  *
  * @author 
  * 
  * @return [void] 獲得access_token信息
  */
 private function resetLogin()
 {
     // no session exists
     try {
         $this->helper->disableSessionStatusCheck();
         $this->session = $this->helper->getSessionFromRedirect();
         if (!isset($this->session) || $this->session === null) {
             $this->toAuth($this->facebook_default_scope);
         }
     } catch (FacebookRequestException $ex) {
         // When Facebook returns an error
         // handle this better in production code
         Logs::factory()->debug("facebookapi", $ex->getMessage());
         //exit($ex->getMessage());
     } catch (Exception $ex) {
         // When validation fails or other local issues
         // handle this better in production code
         Logs::factory()->debug("facebookapi2", $ex->getMessage());
         //exit($ex->getMessage());
     }
 }
開發者ID:hamily,項目名稱:sblack,代碼行數:28,代碼來源:facebooksdk4.newapi.php

示例5: SendData

 /**
  * 實際做的發送操作
  * @param String $ip
  * @param int $port
  * @param GameSocketPacket $packet
  * @return Boolean
  */
 private function SendData($ip, $port, &$packet, $reuse = false)
 {
     if (!$this->connect($ip, $port, $reuse)) {
         return false;
     }
     if (@socket_write($this->aSockets[$ip][$port], $packet->GetPacketBuffer(), $packet->GetPacketSize()) === false) {
         Logs::factory()->debug(@implode('-', array(socket_strerror(socket_last_error()), __LINE__)), 'C_sendData.txt');
         return false;
     }
     return true;
 }
開發者ID:hamily,項目名稱:sblack,代碼行數:18,代碼來源:cserver.api.php

示例6: error_print

 /**
  * 致命錯誤中斷
  */
 public function error_print($description)
 {
     Logs::factory()->debug(json_encode(array("Error: {$description}", 'time' => date("Y-m-d", time()), 'sitemid' => $this->getUser())), "pay.ErrorDebug");
 }
開發者ID:hamily,項目名稱:sblack,代碼行數:7,代碼來源:myzone.php

示例7: foreach

        if (!($param = self::${$act_name})) {
            return false;
        }
        $signValue = self::$pconfig[4];
        $postUrl = '';
        foreach ((array) $arrays as $key => $array) {
            if (in_array($key, $param['param'])) {
                $signValue .= $array;
            }
            $postUrl .= '/' . $array;
        }
        $signValue .= self::$pconfig[5];
        return $param['url'] . self::$pconfig[4] . '/' . md5($signValue) . $postUrl;
    }
    /**
	 * boyaa log report
	 * 
	 * 向日誌服務器上遊戲報日誌
	 *
	 * @game_data array 關聯數組,遊戲數據,最終通過byl_encode_argument()去掉\r, \n, |並且json格式上報給日誌服務器
	 * @act_name string API名稱
	 * @bpid string 32位,由數據中心分配給相應用產品線
	 * @keep_socket 默認為false, false:發送後關閉socket連接 true:保持socket鏈接在一個PHP的生命周期
	 * @error_code 引用錯誤代碼 
	 * @error_message 引用錯誤信息
	 * @host 日誌服務器綁定Ip。一般使用默認127.0.0.1即可。
	 * @port 日誌服務器綁定端口.一般使用默認端口號即可
	 **/
    function byl_watchdog($act_name, $game_data, $keep_socket = false, &$error_code = 0, &$error_message = '', $host = '127.0.0.1', $port = 1106)
    {
        if ($act_name == "user_signup") {
            Logs::factory()->debug("updata/register", $game_data, self::$pconfig);
        }
        static $socket = null;
        $bpid = self::$pconfig[4];
        if (strlen($bpid) != 32) {
            $error_code = 10002;
            $error_message = "valid bpid({$bpid})";
            Logs::factory()->debug('updata/error10002', $bpid);
            return false;
        }
        if (empty($game_data) || !is_array($game_data)) {
            $error_code = 10003;
            $error_message = "empty game data";
            Logs::factory()->debug('updata/error10003', $game_data);
            return false;
開發者ID:hamily,項目名稱:sblack,代碼行數:46,代碼來源:watchdog.php

示例8: error_log

 /**
  * 業務錯誤日誌上報
  * @param  [type] $mode      [description]
  * @param  [type] $error_msg [description]
  * @return [type]            [description]
  */
 private function error_log($mode, $errors = '', $params_error = '')
 {
     $array = array('time' => date('Y-m-d H:i:s'), 'error' => $errors, 'api' => $params_error);
     if (self::ISOPENLOGS === true && class_exists('Kkdatacenter_Module')) {
         Kkdatacenter_Module::factory()->sendNewLog('guest_error', $mode, $array);
     } else {
         Logs::factory()->debug($array, 'guest_error_' . $mode);
     }
 }
開發者ID:hamily,項目名稱:sblack,代碼行數:15,代碼來源:mobile.member.php

示例9: sendHeader

 /**
  * 單純發頭部命令
  **/
 public function sendHeader($mid, $port)
 {
     if (!($mid = Helper::uint($mid)) || empty($port)) {
         return false;
     }
     $body = array(array($mid, API_INT));
     $buffer = '';
     //獲得BODY長度
     $this->_head = "";
     $this->_body = "";
     $this->setBody($body);
     $len = $this->getBodyLen($body);
     //設置頭部HEADER
     $this->setHeader($len, CLIENT_COMMAND_PHP_SEND_GIFE);
     $checkcode = $this->encryptData($len);
     //設置校驗碼
     $this->setCheckcode($checkcode);
     //獲得全部數據
     $string = Packer::factory()->getPackage();
     //發起socket
     //if(!Socket::factory()->isConnect()){
     Socket::factory()->set_server(Core_Game::$serverIP, $port);
     Socket::factory()->connect();
     Logs::factory()->debug('packer/socketheader', Socket::factory()->get_errmsg(), Core_Game::$serverIP, $port);
     //}
     //發送內容
     $ret = Socket::factory()->write_line($string);
     $buffer = Socket::factory()->read_line_str(JW_HEADER_LEN + $len);
     Socket::factory()->close();
     $decrypt = $this->decryptData($buffer, JW_SOCKET_BACK_LEN, 'back');
     Logs::factory()->debug('packer/header', $decrypt);
     return $decrypt;
 }
開發者ID:hamily,項目名稱:sblack,代碼行數:36,代碼來源:packer.php


注:本文中的Logs::factory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。