本文整理汇总了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');
}
示例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');
}
示例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();
}
示例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));
}