本文整理汇总了PHP中Generator::formatRid方法的典型用法代码示例。如果您正苦于以下问题:PHP Generator::formatRid方法的具体用法?PHP Generator::formatRid怎么用?PHP Generator::formatRid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Generator
的用法示例。
在下文中一共展示了Generator::formatRid方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: generateRid
public static function generateRid()
{
self::actToken();
User::$rid = Generator::uniqueRid();
DB::createUser(Generator::unformatRid(User::$rid), User::$ip, User::$sid, User::$token);
Utilities::log("Generated new Rid " . User::toString());
return self::encodeRid(Generator::formatRid(User::$rid));
}
示例2: checkByUserRid
public static function checkByUserRid($rid)
{
$data = array();
$stmt = DB::getInstance()->prepare("SELECT number.number, number.date, user.rid FROM user JOIN number ON user.id = number.user WHERE ip IN (SELECT ip FROM user WHERE rid LIKE :rid1) OR sid IN (SELECT ip FROM user WHERE rid LIKE :rid2) ORDER BY number.date DESC;");
$stmt->execute(array('rid1' => $rid, 'rid2' => $rid));
while ($row = $stmt->fetch()) {
$row['rid'] = Generator::formatRid($row['rid']);
array_push($data, $row);
}
return $data;
}
示例3: define
<?php
define('RND', true);
require_once 'core/includes.php';
User::startSession();
$getRid = Utilities::getOrNull('rid');
if (DB::isSidExist(User::getSid())) {
// if user has loaded once
User::load();
if ($getRid != null) {
User::$rid = $getRid;
}
} else {
// first time user
User::generate();
}
$data['rid'] = Generator::formatRid(User::$rid);
$data['shortLink'] = SITE . '/prove/' . Generator::formatRid(User::$rid);
$index['token'] = User::$token;
$title['pageName'] = Utilities::getOrNull('route');
Render::render('head', $title);
Render::render('header');
Render::render('section_header', $data);
Render::render('section_index', $index);
Render::render('section_prove');
Render::render('footer');
DB::close();