当前位置: 首页>>代码示例>>PHP>>正文


PHP wlog函数代码示例

本文整理汇总了PHP中wlog函数的典型用法代码示例。如果您正苦于以下问题:PHP wlog函数的具体用法?PHP wlog怎么用?PHP wlog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了wlog函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: bindPhoneCode

 public function bindPhoneCode($param = null)
 {
     if (isset($param)) {
         $post_data = $param;
         $exit_type = 'array';
     } else {
         $post_data = I('post.');
         $exit_type = 'json';
     }
     wlog('/share/weixinLog/artisans/58_phone.log', $post_data['phone']);
     $access_token = $post_data['access_token'];
     $this->_checkToken($access_token);
     if (!$this->_access_token) {
         return $this->returnJsonData($exit_type, 10002);
         //没有权限
     }
     $phone = $post_data['phone'];
     if (empty($phone)) {
         return $this->returnJsonData($exit_type, 300);
     }
     if (!check_phone($phone)) {
         return $this->returnJsonData($exit_type, 10003);
         //手机号格式有误
     }
     $now_time = date('Y-m-d H:i:s');
     $rand_code = mt_rand('100000', '999999');
     $data['CouponsId'] = 1;
     $data['Phone'] = $phone;
     $data['CodeNum'] = $rand_code;
     $data['Source'] = 1;
     $data['IsUse'] = 0;
     $data['CreateTime'] = $now_time;
     $where = array('Source' => 1, 'Phone' => $phone);
 }
开发者ID:legendRD,项目名称:artisans,代码行数:34,代码来源:ProActiveApiController.class.php

示例2: GetResponse

 public function GetResponse()
 {
     wlog(get_class($this), "I Requests sent. Reading responses...");
     $reply = "";
     // MAIN PROGRAM LOOP
     while ($reply .= $this->oApi->readRequestBinary()) {
         // append to data left from previous request
         // if the last character isn't the EOT character, then this contains a part response
         //print ".";
         if ($reply[strlen($reply) - 1] != chr(10)) {
             $nlpos = strrpos($reply, chr(10));
             if ($nlpos !== false) {
                 // has a full response plus a part response
                 // process the full response sub string
                 $aResponses = explode(chr(10), trim(substr($reply, 0, $nlpos + 1)));
                 $reply = substr($reply, $nlpos + 1);
                 // keep the part response
             }
             // else it is only part of another response so leave $reply set
         } else {
             // is simply a full response, so process it
             $aResponses = explode(chr(10), trim($reply));
             $reply = "";
         }
         // now parse each message one at a time
         foreach ($aResponses as $response) {
             $rid = substr($response, 0, strpos($response, chr(31)));
             $response = substr($response, strpos($response, chr(31)) + 1);
             $this->ParseResponse($rid, $response);
         }
     }
     // while
 }
开发者ID:BackupTheBerlios,项目名称:phpapi2db-svn,代码行数:33,代码来源:class.RequestRTD.php

示例3: lists

 /**
  * 数据列表
  */
 public function lists()
 {
     if (IS_POST) {
         $username = PUT('username');
         $map = array();
         $map['username'] = array('like', "%{$username}%");
         $map['b.realname'] = array('like', "%{$username}%");
         $map['b.nickname'] = array('like', "%{$username}%");
         $map['b.id_number'] = array('like', "%{$username}%");
         $map['b.company'] = array('like', "%{$username}%");
         $map['_logic'] = 'or';
         $size = PUT('size', 10);
         $page = PUT('p');
         $count = $this->model->alias('a')->join('__USER_INFO__ b on a.id=b.user_id', 'LEFT')->where($map)->where($map)->count();
         $items = $this->model->alias('a')->join('__USER_INFO__ b on a.id=b.user_id', 'LEFT')->field('a.id,username,login_count,last_login_time,register_time,updated,status,portrait,realname,nickname,cat_id,name_cert,sex,age,birthday,id_number,email,company,work_status,alternative_phone')->where($map)->page($page, $size)->order('id desc')->select();
         $result['status'] = true;
         $result['count'] = $count;
         $result['size'] = $size;
         $result['page'] = $page;
         $result['items'] = $items;
         wlog('user', $result);
         $this->ajaxReturn($result);
     } else {
         $this->display();
     }
 }
开发者ID:Orchild,项目名称:mt,代码行数:29,代码来源:ResetController.class.php

示例4: jump

 /**
  * 跳转
  */
 public function jump()
 {
     $p = I('p');
     $url = U('Log/jump', '', false);
     wlog('url', $url);
     $this->redirect($url, array('p' => $p));
 }
开发者ID:Orchild,项目名称:mt,代码行数:10,代码来源:LogController.class.php

示例5: DecodeResponse

 public function DecodeResponse(&$sMessage)
 {
     $aMessage = explode(chr(31), $sMessage);
     $key = "fid_exchange_id";
     for ($i = 0; $i < count($aMessage); $i++) {
         switch ($this->aFieldTypes[$aMessage[$i]]) {
             case $key:
             case "fid_exchange_symbol":
             case "fid_exchange_country":
             case "fid_text":
                 $aFields[$this->aFieldTypes[$aMessage[$i]]] = $aMessage[++$i];
                 break;
             default:
                 $i++;
                 break;
         }
     }
     // check that key exists
     if (array_key_exists($key, $aFields)) {
         // It exists
         $this->aaExchanges[$aFields[$key]] = $aFields;
     } else {
         // THIS SHOULD NEVER HAPPEN!
         wlog(get_class($this), "W Exchange message failed to decode. Response was: " . $sMessage);
     }
 }
开发者ID:BackupTheBerlios,项目名称:phpapi2db-svn,代码行数:26,代码来源:class.MessageRTDExchanges.php

示例6: query

 /**
  * 执行mysql query()操作
  * @param string $sql
  * @return mixed
  */
 public function query($sql)
 {
     // 是否记录 SQL log
     if (true == C('sql_log')) {
         wlog('SQL-Log', $sql);
     }
     $error_msg = '';
     $_key = strtolower(substr($sql, 0, 6));
     if ($_key == 'select') {
         $rs = sqlite_query($this->db, $sql, SQLITE_BOTH, $error_msg);
     } else {
         $rs = sqlite_exec($this->db, $sql, $error_msg);
     }
     if (!empty($rs)) {
         $GLOBALS['run_dbquery_count']++;
         return $rs;
     } else {
         if (C('show_errors')) {
             show_error('执行sqlite_query()出现错误: ' . $error_msg . '<br />原SQL: ' . $sql);
         } else {
             exit('db_sqlite2::query() error.');
         }
     }
     //return false;
 }
开发者ID:wangxian,项目名称:ePHP,代码行数:30,代码来源:db_sqlite2.class.php

示例7: connect

function connect($name, $db_type, $params)
{
    global $g_db;
    //try to connect one of connection parameter that works..
    $exceptions = array();
    foreach ($params as $param) {
        try {
            $db = Zend_Db::factory($db_type, $param);
            $db->setFetchMode(Zend_Db::FETCH_OBJ);
            $db->getConnection();
            //profile db via firebug
            if (config()->debug) {
                $profiler = new Zend_Db_Profiler_Firebug('All DB Queries');
                $profiler->setEnabled(true);
                $db->setProfiler($profiler);
            }
            //slog("success $name");
            $g_db[$name] = $db;
            return;
        } catch (Zend_Db_Adapter_Exception $e) {
            // perhaps a failed login credential, or perhaps the RDBMS is not running
            wlog("Couldn't connect to {$name} (trying another connection - if available):: " . $e->getMessage());
            $exceptions[] = $e;
        } catch (Zend_Exception $e) {
            // perhaps factory() failed to load the specified Adapter class
            wlog("Couldn't connect to {$name} (trying another connection - if available):: " . $e->getMessage());
            $exceptions[] = $e;
        }
    }
    $msg = "";
    foreach ($exceptions as $e) {
        $msg .= $e->getMessage() . "\n";
    }
    throw new Exception("Failed to connect to {$name}");
}
开发者ID:wangfeilong321,项目名称:myosg,代码行数:35,代码来源:db.php

示例8: after_select

 protected function after_select(&$items)
 {
     foreach ($items as &$value) {
         $msg_id = $value['id'];
         $map['status'] = array('in', '1,3,5,7,9,11,13,15');
         if ($value['msg_cat'] == 0) {
             $total = M('User')->where($map)->count();
         } else {
             $map['cat_id'] = $value['msg_cat'];
             $total = M('UserInfo')->where($map)->count();
         }
         $where['status'] = 1;
         $where['msg_id'] = $msg_id;
         $read = M('Msg_read')->where($where)->select();
         $read_count = 0;
         if ($read) {
             foreach ($read as $v) {
                 unset($map);
                 $map = array();
                 $map['user_id'] = $v['user_id'];
                 $map['cat_id'] = $value['msg_cat'];
                 $res = M('UserInfo')->where($map)->find();
                 if ($res) {
                     ++$read_count;
                     wlog('count', $read_count);
                 }
             }
         }
         $value['read'] = $read_count;
         $value['unread'] = $total - $read_count;
         if ($value['unread'] == 0) {
             $value['disable'] = true;
         }
     }
 }
开发者ID:Orchild,项目名称:mt,代码行数:35,代码来源:MsgReadController.class.php

示例9: comWlog

 public function comWlog($log_data = array(), $log_url = '')
 {
     if (empty($log_url)) {
         $log_url = C('WWW_LOG_URL') . ACTION_NAME . date(Ymd) . '.log';
     }
     $this->log_url = $log_url;
     $this->log_dat = $log_data;
     if ($this->log_status) {
         wlog($this->log_url, $this->log_data);
     }
 }
开发者ID:legendRD,项目名称:artisans,代码行数:11,代码来源:ApiCommController.class.php

示例10: getUserCenterToken

 /**
  * 获取用户中心token
  * @access	public
  * @param	string $url
  * @return	mixed
  */
 public function getUserCenterToken($url)
 {
     if (!$url) {
         return false;
     }
     $post_data = json_encode(array('realm' => 'XXX'));
     $receive = send_curl($url, $post_data);
     $parse_data = json_decode($receive, true);
     if (is_array($parse_data['data']) && $parse_data['data']['access_token']) {
         $token = $parse_data['data']['access_token'];
     } else {
         wlog('/share/weixinLog/artisans/user_center_api/user_center_token' . date('Ymd') . '.log', $parse_data);
     }
     return $token;
 }
开发者ID:legendRD,项目名称:artisans,代码行数:21,代码来源:TokenModel.class.php

示例11: conn

 /**
  * 连接数据库
  * @access protected
  * @param string $db_config_name 使用那个数据库连接
  */
 protected function conn($db_config_name = '')
 {
     $db_config_name = $db_config_name ? $db_config_name : $this->db_config_name;
     if (!isset(self::$_db_handle[$db_config_name])) {
         if (true == C('sql_log')) {
             wlog('SQL-Log', '#' . $db_config_name);
         }
         $dbdriver = 'db_' . C('dbdriver');
         include_once FW_PATH . '/dbdrivers/' . $dbdriver . '.class.php';
         self::$_db_handle[$db_config_name] = $this->db = new $dbdriver($db_config_name);
     } else {
         $this->db = self::$_db_handle[$db_config_name];
     }
     return $this->db;
 }
开发者ID:beyondzgz,项目名称:mophp,代码行数:20,代码来源:modelMS.class.php

示例12: __toString

 public function __toString()
 {
     if (C('exception_log')) {
         $str = "\n异常信息:{$this->getMessage()}\n错误文件:{$this->getFile()}\n错误行数:{$this->getLine()}\n异常代码:{$this->getCode()}\n------------------------------";
         wlog('ExceptionLog', $str);
     }
     //ob_start();
     $tpl = C('tpl_exception');
     if (!$tpl) {
         include FW_PATH . '/tpl/ephpException.tpl.php';
     } else {
         include APP_PATH . '/views/public/' . $tpl;
     }
     //return ob_get_clean();
     return '';
 }
开发者ID:beyondzgz,项目名称:ePHP,代码行数:16,代码来源:ephpException.class.php

示例13: __construct

 function __construct(array &$settings)
 {
     $this->aaSettings = $settings;
     wLog(get_class($this), " \n--- Loading ---");
     // Check DB Clear settings
     if (!isset($this->aaSettings["DB"]["HOST"], $this->aaSettings["DB"]["USERNAME"], $this->aaSettings["DB"]["PASSWORD"])) {
         wlog(get_class($this), "E  Arggghhhh DB settings not found in INI file!!! Blowing up ungracefully...");
         exit;
     }
     $this->oDatabase = new CDbMssql($this->aaSettings["DB"]["HOST"], $this->aaSettings["DB"]["USERNAME"], $this->aaSettings["DB"]["PASSWORD"]);
     // Check TRADE (P&L) settings
     if (!isset($this->aaSettings["RTDHOST"]["IP"], $this->aaSettings["RTDHOST"]["PORT"])) {
         wlog(get_class($this), "E  Arggghhhh RTDHOST settings not found in INI file!!! Blowing up ungracefully...");
         exit;
     }
     $this->oApi = new CSocketStream($this->aaSettings["RTDHOST"]["IP"], $this->aaSettings["RTDHOST"]["PORT"]);
 }
开发者ID:BackupTheBerlios,项目名称:phpapi2db-svn,代码行数:17,代码来源:class.RequestRTDPrices.php

示例14: query

 /**
  * MYSQL query
  * @param  string $sql
  * @return mixed
  */
 function query($sql)
 {
     #是否记录 SQL log
     if (true == C('sql_log')) {
         wlog('SQL-Log', $sql);
     }
     if (true == ($rs = $this->db->query($sql))) {
         $GLOBALS['run_dbquery_count']++;
         return $rs;
     } else {
         if (C('show_errors')) {
             throw new ephpException('执行mysqli::query()出现错误: ' . $this->db->error . '<br />原SQL: ' . $sql, 2045);
         } else {
             exit('db_mysqli::query() error.');
         }
     }
 }
开发者ID:beyondzgz,项目名称:ePHP,代码行数:22,代码来源:db_mysqli.class.php

示例15: select_redbag

 public function select_redbag()
 {
     if (I("code")) {
         $code = I("code");
         $shop = D("WeiXinApi");
         $userinfo = $shop->getOAuthAccessToken($code);
         $openid = $userinfo["openid"];
         if (!$openid) {
             wlog('/share/weixinLog/artisans/user_center_api/no_find_openid.log', $userinfo);
             //auth验证没有获取到openid
         }
     } else {
         $openid = $this->reGetOAuthDebug(U('Redbag/' . ACTION_NAME));
     }
     $info = M('ord_submit_info')->where("UserOpenid='%s'", $openid)->order('InfoId desc')->find();
     $pro_id = $info['ProductId'];
     //用户卡券
     $transfer_data['city_id'] = $this->_city_id;
     $transfer_data['pro_id'] = $pro_id;
     $transfer_data['uid'] = $uid;
     $user_card_info = send_curl($this->_user_coupons_url, $transfer_data);
     $parse_data = json_decode($user_card_info, true);
     if ($parse_data['code'] == 200 && $parse_data['code']['data']) {
         $data = $parse_data['code']['data'];
     } else {
         $data = array();
     }
     //卡券列表
     $cardid = $this->_card[$pro_id];
     $num = count($cardid);
     $cardinfo = array();
     for ($i = 0; $i < $num; $i++) {
         $cardinfo = $this->getcard_info($cardid[$i], $openid);
     }
     $card_num = count($cardinfo);
     if ($card_num > 0) {
         $this->assign('status', 200);
     } else {
         $this->assing('status', 500);
     }
     $this->assign('list', array($cardinfo));
     //跳转链接
     $jump_url = U('Craft/selectCard') . '?haoren=1';
     $this->assign('jump_url', $jump_url);
     $this->display(T('Craft/qcs_card'));
 }
开发者ID:legendRD,项目名称:artisans,代码行数:46,代码来源:RedbagController.class.php


注:本文中的wlog函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。