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


PHP WebUtils::outputWebApi方法代码示例

本文整理汇总了PHP中WebUtils::outputWebApi方法的典型用法代码示例。如果您正苦于以下问题:PHP WebUtils::outputWebApi方法的具体用法?PHP WebUtils::outputWebApi怎么用?PHP WebUtils::outputWebApi使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WebUtils的用法示例。


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

示例1: run

 public function run()
 {
     $res = $this->initWebApiArray();
     $uid = $this->getController()->uid;
     $res = $this->_runAction($res, $uid);
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:7,代码来源:UploadAvatarExAction.php

示例2: run

 public function run($attachment)
 {
     $res = WebUtils::initWebApiArray_oldVersion();
     $uid = $this->getController()->uid;
     // $attachment ="{'head': {'errCode': 0, 'errInfo': ''}, 'body': {'attachment': {'name': 'test', 'isPost': 1, 'data': 'ss', 'type': 'image', 'module':'forum'}, 'externInfo': {}}}";
     $attachment = rawurldecode($attachment);
     $attachment = WebUtils::jsonDecode($attachment);
     $attachment = isset($attachment['body']['attachment']) ? $attachment['body']['attachment'] : array();
     !isset($attachment['module']) && ($attachment['module'] = 'forum');
     $resAttachment = false;
     if (!empty($attachment)) {
         if ($attachment['isPost'] == 1) {
             if (($data = file_get_contents('php://input')) === false) {
                 $attachment['data'] = $GLOBALS['HTTP_RAW_POST_DATA'];
             } else {
                 $attachment['data'] = $data;
             }
         }
         // $attachment['data'] = WebUtils::httpRequest('http://bbs.appbyme.com/static/image/common/logo.png');// test
         $resAttachment = $this->_saveAttachment($uid, $attachment);
     }
     if ($resAttachment === false) {
         $attachmentTypes = array('audio' => WebUtils::t('语音'), 'image' => WebUtils::t('图片'));
         $res = WebUtils::makeErrorInfo_oldVersion($res, 'UPLOAD_ATTACHMENT_ERROR', array('{attachment}' => $attachmentTypes[$attachment['type']]));
     } else {
         $res['body']['attachment'] = $resAttachment;
     }
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:29,代码来源:SendAttachmentAction.php

示例3: run

 public function run($keyword, $page = 1, $pageSize = 10, $searchid = 0)
 {
     $keyword = rawurldecode($keyword);
     $res = WebUtils::initWebApiArray_oldVersion();
     $res = $this->_getForumData($res, $keyword, $page, $pageSize, $searchid);
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:7,代码来源:SearchAction.php

示例4: run

 public function run($getSetting, $longitude = 0, $latitude = 0, $location = '')
 {
     $res = $this->initWebApiArray();
     // $longitude='116.3093650';$latitude='40.0611250';$location='北京市海淀区上地东路';
     $location = WebUtils::t(rawurldecode($location));
     global $_G;
     ($uid = $_G['uid']) && $this->_saveUserLocation($uid, $longitude, $latitude, $location);
     // $getSetting ="{'body': {'postInfo': {'forumIds': '0'}}}";
     $settings = rawurldecode($getSetting);
     $settings = WebUtils::jsonDecode($settings);
     $postInfo = isset($settings['body']['postInfo']) ? $settings['body']['postInfo'] : array();
     if (!empty($postInfo)) {
         $res['body']['postInfo'] = $this->_getPostInfo($postInfo);
     }
     $res['body']['serverTime'] = time() . '000';
     $res['body']['misc'] = $this->_getMiscSetting();
     $res['body']['plugin'] = $this->_getPluginSetting();
     $res['body']['forum'] = $this->_getForumSetting();
     $res['body']['portal'] = $this->_getPortalSetting();
     $res['body']['user'] = $this->_getUserSetting();
     $res['body']['message'] = $this->_getMessageSetting();
     $res['body']['moduleList'] = PortalUtils::getModuleList(6);
     // 2014/11/4 门户资讯分类模块列表
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:caidongyun,项目名称:CS,代码行数:25,代码来源:GetSettingAction.php

示例5: run

 public function run($type = 'follow', $page = 1, $pageSize = 10, $orderBy = 'dateline', $longitude = '', $latitude = '', $radius = 100000)
 {
     $res = WebUtils::initWebApiArray_oldVersion();
     switch ($orderBy) {
         case 'register':
             $sortType = 'regdate';
             break;
         case 'login':
             $sortType = 'lastvisit';
             break;
         case 'followed':
             $sortType = 'follower';
             break;
         case 'distance':
             $sortType = 'range';
             break;
         case 'dateline':
             $sortType = 'default';
             break;
         case 'at':
             $sortType = 'at';
             break;
         default:
             break;
     }
     global $_G;
     $uid = $_G['uid'];
     $viewUid = isset($_GET['uid']) ? $_GET['uid'] : $uid;
     $res = $this->_getUserInfoList($res, $type, $uid, $viewUid, $page, $pageSize, $sortType, $longitude, $latitude, $radius);
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:caidongyun,项目名称:CS,代码行数:31,代码来源:UserListAction.php

示例6: run

 public function run($tid, $act = 'apply')
 {
     $res = WebUtils::initWebApiArray_oldVersion();
     $uid = $this->getController()->uid;
     // $_REQUEST['json'] = "{'payment':1,'payvalue':100, 'realname': '请求参数11', 'qq': '8', 'message': '请求参数'}";
     $json = isset($_REQUEST['json']) ? $_REQUEST['json'] : '';
     $json = rawurldecode($json);
     $data = WebUtils::jsonDecode($json);
     if (!empty($data)) {
         foreach ($data as $key => $value) {
             if (is_string($value)) {
                 $data[$key] = WebUtils::t($value);
             }
         }
         switch ($act) {
             case 'apply':
                 $res = $this->_applyActivityTopic($res, $tid, $uid, $data);
                 break;
             case 'cancel':
                 $res = $this->_cancelActivityTopic($res, $tid, $uid, $data);
                 break;
             default:
                 $res = $this->_makeErrorInfo($res, 'activity_apply_params_error');
                 break;
         }
     } else {
         $res = $this->_makeErrorInfo($res, 'activity_apply_params_error');
     }
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:30,代码来源:TopicActivityAction.php

示例7: run

 public function run($custom = 0)
 {
     $res = $this->initWebApiArray();
     $res['body'] = $this->_getUIconfig($custom);
     $res['head']['errInfo'] = '';
     echo WebUtils::outputWebApi($res, 'utf-8', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:7,代码来源:InitUIAction.php

示例8: run

 public function run($uid, $albumId, $page = 1, $pageSize = 10)
 {
     $res = WebUtils::initWebApiArray_oldVersion();
     $landUid = $this->getController()->uid;
     $res = $this->_getImageInfoList($res, $landUid, $uid, $page, $pageSize, $albumId);
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:7,代码来源:PhotoListAction.php

示例9: run

 public function run($ids, $picDesc, $albumId = -1)
 {
     $albumId = $albumId == 0 ? -1 : $albumId;
     $res = $this->initWebApiArray();
     $res = $this->_saveAlbum($ids, $picDesc, $albumId);
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:7,代码来源:SaveAlbumAction.php

示例10: run

 public function run($avatar)
 {
     $res = $this->initWebApiArray();
     $uid = $this->getController()->uid;
     $res = $this->_runAction(array('res' => $res, 'uid' => $uid, 'avatar' => $avatar));
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:7,代码来源:SaveAvatarAction.php

示例11: endAppWithErrorInfo

 public static function endAppWithErrorInfo($res, $message, $params = array())
 {
     $tmpRes = WebUtils::initWebApiArray_oldVersion();
     $tmpRes = WebUtils::makeErrorInfo_oldVersion($tmpRes, $message, $params);
     $tmpRes = array_merge($tmpRes, $res);
     WebUtils::outputWebApi($tmpRes);
 }
开发者ID:caidongyun,项目名称:CS,代码行数:7,代码来源:WebUtils.php

示例12: run

 public function run($openId, $oauthToken, $platformId = 20)
 {
     $this->password .= FileUtils::getRandomFileName('', 3);
     $res = $this->initWebApiArray();
     $openId = rawurldecode($openId);
     $res = $this->getBindInfo($res, $openId, $oauthToken, $platformId);
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:8,代码来源:PlatFormInfoAction.php

示例13: run

 public function run($longitude, $latitude, $location)
 {
     $res = $res = $this->initWebApiArray();
     // $longitude='116.3093650';$latitude='40.0611250';$location='北京市海淀区上地东路xxx';
     $location = WebUtils::t(rawurldecode($location));
     $this->_getSaveUserLocation($longitude, $latitude, $location);
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:8,代码来源:LocationAction.php

示例14: run

 public function run($username, $oauthToken, $password, $openId, $email = '', $gender = 0, $act = 'register', $platformId = 20)
 {
     $username = WebUtils::t(rawurldecode($username));
     $email = WebUtils::t(rawurldecode($email));
     $res = $this->initWebApiArray();
     $res = $this->getPlatFormInfo($res, $username, $oauthToken, $password, $openId, $email, $gender, $act, $platformId);
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:8,代码来源:SavePlatFormInfoAction.php

示例15: run

 public function run($share)
 {
     $res = $this->initWebApiArray();
     // $share = "{'body': {'shareInfo': {'shareId':8,'shareType': 'news'}}}";
     $share = rawurldecode($share);
     $shareInfo = WebUtils::jsonDecode($share);
     $res['body']['shareData'] = $this->_getShareData($shareInfo);
     echo WebUtils::outputWebApi($res, '', false);
 }
开发者ID:caidongyun,项目名称:CS,代码行数:9,代码来源:ShareAction.php


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