本文整理汇总了PHP中Q_Request::OSVersion方法的典型用法代码示例。如果您正苦于以下问题:PHP Q_Request::OSVersion方法的具体用法?PHP Q_Request::OSVersion怎么用?PHP Q_Request::OSVersion使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Q_Request
的用法示例。
在下文中一共展示了Q_Request::OSVersion方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Users_device_post
function Users_device_post()
{
$user = Users::loggedInUser(true);
$token = isset($_REQUEST['token']) ? $_REQUEST['token'] : null;
$platform = Q_Request::platform();
$version = Q_Request::OSVersion();
$formFactor = Q_Request::isMobile() ? 'mobile' : (Q_Request::isTablet() ? 'tablet' : null);
$device = new Users_Device();
$device->userId = $user->id;
$device->deviceId = $token;
$device->platform = $platform;
$device->version = $version;
$device->formFactor = $formFactor;
$device->sessionId = Q_Session::id();
$_SESSION['Users']['deviceId'] = $token;
Q_Response::setSlot('data', !!$device->save(true));
Q_Utils::sendToNode(array("Q/method" => "Users/device", "userId" => $user->id, "deviceId" => $token));
}
示例2: userAgentInfo
/**
* Some standard info to be stored in sessions, devices, etc.
* @return {array}
*/
static function userAgentInfo()
{
$info = array('formFactor' => Q_Request::formFactor(), 'platform' => Q_Request::platform(), 'version' => Q_Request::OSVersion());
$fields = Q_Config::get('Q', 'session', 'userAgentInfo', array());
return Q::take($info, $fields);
}