本文整理汇总了PHP中myPartnerUtils::getExpiry方法的典型用法代码示例。如果您正苦于以下问题:PHP myPartnerUtils::getExpiry方法的具体用法?PHP myPartnerUtils::getExpiry怎么用?PHP myPartnerUtils::getExpiry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myPartnerUtils
的用法示例。
在下文中一共展示了myPartnerUtils::getExpiry方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createKSessionNoValidations
public static function createKSessionNoValidations($partner_id, $puser_id, &$ks_str, $desired_expiry_in_seconds = 86400, $admin = false, $partner_key = "", $privileges = "")
{
$ks_max_expiry_in_seconds = myPartnerUtils::getExpiry($partner_id);
if ($ks_max_expiry_in_seconds && $ks_max_expiry_in_seconds < $desired_expiry_in_seconds) {
$desired_expiry_in_seconds = $ks_max_expiry_in_seconds;
}
$ks = new ks();
$ks->valid_until = kApiCache::getTime() + $desired_expiry_in_seconds;
// store in milliseconds to make comparison easier at validation time
// $ks->type = $admin ? ks::TYPE_KAS : ks::TYPE_KS;
if ($admin == false) {
$ks->type = ks::TYPE_KS;
} else {
$ks->type = $admin;
}
// if the admin > 1 - use it rather than automatially setting it to be 2
$ks->partner_id = $partner_id;
$ks->partner_pattern = $partner_id;
$ks->error = 0;
$ks->rand = microtime(true);
$ks->user = $puser_id;
$ks->privileges = $privileges;
$ks_str = $ks->toSecureString();
return 0;
}