当前位置: 首页>>代码示例>>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;未经允许,请勿转载。