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


PHP FileUtils::getRandomFileName方法代码示例

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


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

示例1: _qqInfo

 private function _qqInfo($res, $openId, $oauthToken, $platformId)
 {
     global $_G;
     $password = MOBCENT_HACKER_PASSWORD;
     require_once libfile('function/member');
     if (!empty($platformId) && $platformId == 20) {
         $qqUserInfo = $this->_getQQinfoByOpenId($openId);
         if (isset($qqUserInfo) && !empty($qqUserInfo)) {
             $userInfo = UserUtils::getUserInfo($qqUserInfo['uid']);
             setloginstatus($userInfo, $_GET['cookietime'] ? 2592000 : 0);
             C::t('common_member_status')->update($userInfo['uid'], array('lastip' => $_G['clientip'], 'lastvisit' => TIMESTAMP, 'lastactivity' => TIMESTAMP));
             $ipArray = explode('.', $_G['clientip']);
             $sid = FileUtils::getRandomFileName('', 6);
             $data = array('sid' => $sid, 'ip1' => $ipArray[0], 'ip2' => $ipArray[1], 'ip3' => $ipArray[2], 'ip4' => $ipArray[3], 'uid' => $userInfo['uid'], 'username' => $userInfo['username'], 'groupid' => $userInfo['groupid'], 'invisible' => '0', 'action' => '', 'lastactivity' => time(), 'fid' => '0', 'tid' => '0', 'lastolupdate' => '0');
             $comSess = DzCommonSession::getComSessByUid($userInfo['uid']);
             if (!empty($comSess)) {
                 DzCommonSession::delComSess($userInfo['uid']);
             }
             DzCommonSession::insertComSess($data);
             $userAccess = AppbymeUserAccess::loginProcess($userInfo['uid'], $password);
             $res['body']['register'] = 0;
             $res['body']['uid'] = (int) $userInfo['uid'];
             $res['body']['userName'] = (string) $userInfo['username'];
             $res['body']['avatar'] = (string) UserUtils::getUserAvatar($userInfo['uid']);
             $res['body']['token'] = (string) $userAccess['token'];
             $res['body']['secret'] = (string) $userAccess['secret'];
             return $res;
         } else {
             $res['body']['register'] = 1;
             $res['body']['openId'] = (string) $openId;
             $res['body']['oauthToken'] = (string) $oauthToken;
             $res['body']['platformId'] = (int) $platformId;
             return $res;
         }
     }
     // 客户端参数不正确
     return $this->makeErrorInfo($res, 'mobcent_error_params');
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:38,代码来源:QQInfoAction.php

示例2: _saveInfo

 private function _saveInfo($res, $username, $email, $oauthToken, $openId, $gender, $platformId)
 {
     $username = WebUtils::t(rawurldecode($username));
     $email = WebUtils::t(rawurldecode($email));
     $password = MOBCENT_HACKER_PASSWORD;
     $regInfo = UserUtils::register($username, $password, $email, 'qq');
     if ($regInfo['errcode']) {
         return $this->makeErrorInfo($res, $regInfo['message']);
     }
     $uid = $regInfo['info']['uid'];
     $userInfo = UserUtils::getUserInfo($uid);
     $userAccess = AppbymeUserAccess::registerProcess($uid, $password);
     if (!empty($platformId) && $platformId == 20) {
         $qqdata = array('uid' => $uid, 'conuin' => $oauthToken, 'conuinsecret' => '', 'conopenid' => $openId, 'conisfeed' => 1, 'conispublishfeed' => 1, 'conispublisht' => 1, 'conisregister' => 1, 'conisqzoneavatar' => 1, 'conisqqshow' => 1);
         $qqbind = array('mblid' => '', 'uid' => $uid, 'uin' => $openId, 'type' => 1, 'dateline' => time());
         $this->_inserBindlog($qqbind);
         $this->_inserConnect($qqdata);
         $updateInfo = array('avatarstatus' => 1, 'conisbind' => 1);
         // 用户是否绑定QQ
         DzCommonMember::updateMember($updateInfo, array('uid' => $uid));
         $setarr['gender'] = intval($gender);
         C::t('common_member_profile')->update($uid, $setarr);
         $ipArray = explode('.', $_G['clientip']);
         $sid = FileUtils::getRandomFileName('', 6);
         $data = array('sid' => $sid, 'ip1' => $ipArray[0], 'ip2' => $ipArray[1], 'ip3' => $ipArray[2], 'ip4' => $ipArray[3], 'uid' => $userInfo['uid'], 'username' => $userInfo['username'], 'groupid' => $userInfo['groupid'], 'invisible' => '0', 'action' => '', 'lastactivity' => time(), 'fid' => '0', 'tid' => '0', 'lastolupdate' => '0');
         DzCommonSession::insertComSess($data);
         require_once libfile('cache/userstats', 'function');
         build_cache_userstats();
         $res['token'] = (string) $userAccess['token'];
         $res['secret'] = (string) $userAccess['secret'];
         $res['uid'] = (int) $regInfo['info']['uid'];
         return $res;
     }
     // 客户端参数不正确
     return $this->makeErrorInfo($res, 'mobcent_error_params');
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:36,代码来源:SaveQQInfoAction.php

示例3: _updateQqMember

 private function _updateQqMember($uid, $oauthToken, $openId, $gender)
 {
     global $_G;
     $qqdata = array('uid' => $uid, 'conuin' => $oauthToken, 'conuinsecret' => '', 'conopenid' => $openId, 'conisfeed' => 1, 'conispublishfeed' => 1, 'conispublisht' => 1, 'conisregister' => 1, 'conisqqshow' => 1);
     $qqbind = array('mblid' => '', 'uid' => $uid, 'uin' => $openId, 'type' => 1, 'dateline' => time());
     $this->_inserBindlog($qqbind);
     $this->_inserConnect($qqdata);
     $updateInfo = array('avatarstatus' => 1, 'conisbind' => 1);
     // 用户是否绑定QQ
     DzCommonMember::updateMember($updateInfo, array('uid' => $uid));
     $setarr['gender'] = intval($gender);
     C::t('common_member_profile')->update($uid, $setarr);
     $ipArray = explode('.', $_G['clientip']);
     $sid = FileUtils::getRandomFileName('', 6);
     $data = array('sid' => $sid, 'ip1' => $ipArray[0], 'ip2' => $ipArray[1], 'ip3' => $ipArray[2], 'ip4' => $ipArray[3], 'uid' => $userInfo['uid'], 'username' => $userInfo['username'], 'groupid' => $userInfo['groupid'], 'invisible' => '0', 'action' => '', 'lastactivity' => time(), 'fid' => '0', 'tid' => '0', 'lastolupdate' => '0');
     DzCommonSession::insertComSess($data);
     require_once libfile('cache/userstats', 'function');
     build_cache_userstats();
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:19,代码来源:SavePlatFormInfoAction.php

示例4: _getRondomFileName

 private function _getRondomFileName($type, $fileName)
 {
     $defExt = '';
     switch ($type) {
         case 'audio':
             $defExt = 'mp3';
             break;
         case 'image':
             $defExt = 'jpg';
             break;
         default:
             break;
     }
     return FileUtils::getRandomFileName('', 12, '.' . FileUtils::getFileExtension($fileName, $defExt));
 }
开发者ID:frogoscar,项目名称:mobcent-discuz,代码行数:15,代码来源:SendAttachmentAction.php


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